Switching to NVIDIA GPU does not work after suspend
See original GitHub issueDescribe the bug
I recently did a reinstall of my system and now I can’t get switching to the NVIDIA GPU to work reliably anymore. It works just fine after rebooting, but once I suspend the system while in Intel mode, the NVIDIA GPU won’t turn on again when trying to switch to it. I had been using switching=bbswitch
just fine for ~2 years, since this was the only configuration that was working with my laptop model.
Unfortunately I can’t really tell if this started with the reinstall itself, a newer version of optimus-manager, a NVIDIA driver update or something else. I just noticed it after the reinstall while testing if optimus-manager works. I also upgraded the BIOS firmware recently, but downgrading it again did not resolve the issue, so I’d rule that out.
System info Laptop Model: Dell XPS 15 9560 OS: Arch Linux Kernel: 5.7.7-arch1-1 KDE Plasma: 5.19.3 SDDM: 0.18.1 bspwm: 0.9.9 optimus-manager: 1.3.1
optimus-manager.conf
:
[optimus]
switching=bbswitch
pci_power_control=no
pci_remove=no
pci_reset=no
Only had the first two lines in there before the reinstall, but different values for the settings below do not make a difference. I also tried switching=acpi_call
but that did not help either.
Logs
optimus-manager --status
output:
ERROR: the latest GPU setup attempt failed at Xorg pre-start hook.
Log at /var/log/optimus-manager/switch/switch-20200712T134536.log
Cannot execute command because of previous errors.
/var/log/optimus-manager/switch/switch-20200712T134536.log
:
[17] INFO: # Xorg pre-start hook
[17] INFO: Previous state was: {'type': 'pending_pre_xorg_start', 'requested_mode': 'nvidia', 'current_mode': 'intel'}
[17] INFO: Requested mode is: nvidia
[17] INFO: Checking for GDM display servers
[796] INFO: Available modules: ['nouveau', 'bbswitch', 'nvidia', 'nvidia_drm', 'nvidia_modeset', 'nvidia_uvm']
[796] INFO: Unloading modules ['nouveau'] (if loaded)
[799] INFO: Loading module bbswitch
[801] INFO: Setting GPU power to ON via bbswitch
[829] INFO: Loading module nvidia
[1557] ERROR: Xorg pre-start setup error
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/optimus_manager/bash.py", line 11, in exec_bash
out = subprocess.check_output(
File "/usr/lib/python3.8/subprocess.py", line 411, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib/python3.8/subprocess.py", line 512, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['bash', '-c', 'modprobe nvidia NVreg_UsePageAttributeTable=1']' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/optimus_manager/kernel.py", line 179, in _load_module
exec_bash("modprobe %s %s" % (module, options))
File "/usr/lib/python3.8/site-packages/optimus_manager/bash.py", line 18, in exec_bash
raise BashError(
optimus_manager.bash.BashError: Failed to execute 'modprobe nvidia NVreg_UsePageAttributeTable=1' :
modprobe: ERROR: could not insert 'nvidia': No such device
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/optimus_manager/hooks/pre_xorg_start.py", line 45, in main
setup_kernel_state(config, prev_state, requested_mode)
File "/usr/lib/python3.8/site-packages/optimus_manager/kernel.py", line 21, in setup_kernel_state
_nvidia_up(config)
File "/usr/lib/python3.8/site-packages/optimus_manager/kernel.py", line 56, in _nvidia_up
_load_nvidia_modules(config, available_modules)
File "/usr/lib/python3.8/site-packages/optimus_manager/kernel.py", line 109, in _load_nvidia_modules
_load_module(available_modules, "nvidia", options="NVreg_UsePageAttributeTable=%d" % pat_value)
File "/usr/lib/python3.8/site-packages/optimus_manager/kernel.py", line 181, in _load_module
raise KernelSetupError("error running modprobe for %s : %s" % (module, str(e)))
optimus_manager.kernel.KernelSetupError: error running modprobe for nvidia : Failed to execute 'modprobe nvidia NVreg_UsePageAttributeTable=1' :
modprobe: ERROR: could not insert 'nvidia': No such device
[1557] INFO: Removing /etc/X11/xorg.conf.d/10-optimus-manager.conf (if present)
[1558] INFO: Writing state {'type': 'pre_xorg_start_failed', 'switch_id': '20200712T134536', 'requested_mode': 'nvidia'}
Part of dmesg
output:
[ 248.049467] bbswitch: enabling discrete graphics
[ 248.049482] pci 0000:01:00.0: can't change power state from D3cold to D0 (config space inaccessible)
[ 248.051760] pci 0000:01:00.0: can't change power state from D3cold to D0 (config space inaccessible)
[ 248.674732] nvidia-nvlink: Nvlink Core is being initialized, major device number 236
[ 248.675238] NVRM: This is a 64-bit BAR mapped above 4GB by the system
NVRM: BIOS or the Linux kernel, but the PCI bridge
NVRM: immediately upstream of this GPU does not define
NVRM: a matching prefetchable memory window.
[ 248.675239] NVRM: This may be due to a known Linux kernel bug. Please
NVRM: see the README section on 64-bit BARs for additional
NVRM: information.
[ 248.675242] nvidia: probe of 0000:01:00.0 failed with error -1
[ 248.675265] NVRM: The NVIDIA probe routine failed for 1 device(s).
[ 248.675265] NVRM: None of the NVIDIA devices were initialized.
[ 248.675729] nvidia-nvlink: Unregistered the Nvlink Core, major device number 236
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (3 by maintainers)
Top GitHub Comments
Thank you, @Askannz! Now it works again without the systemd-sleep script.
I am experiencing the same issue right now. It was working fine after the first install but it doesn’t work anymore. Any suggestions?