Askannz / optimus-manager

A Linux program to handle GPU switching on Optimus laptops.
MIT License
2.28k stars 166 forks source link

optimus-manager doesn't switch: A GPU switch from integrated to nvidia is pending. #502

Closed dextertd closed 2 years ago

dextertd commented 2 years ago

Describe the bug Thinkpad UEFI display mode set to "hybrid mode". Fresh Manjaro install. pamac upgrade. Follow optimus-manager installation instructions.

Run optimus-manager --switch nvidia and log back in. Now in terminal:

$ optimus-manager --status
A GPU switch from integrated to nvidia is pending.
Log out and log back in to apply.
Optimus Manager (Client) version 1.4

Current GPU mode : integrated
GPU mode requested for next login : nvidia
GPU at startup : integrated
Temporary config path: no

Manually logging in and out again yields the same result. Rebooting brings me back to integrated with no pending switch but trying to switch again yields the same result.

System info Please include :

Logs See above. Also, the output of nohup optimus-manager --no-confirm --switch nvidia > output

Switching to mode : nvidia

Follow instructions at https://github.com/Askannz/optimus-manager/wiki/A-guide--to-power-management-options to enable power management.
WARNING : no power management option is currently enabled (this is the default since v1.2). Switching between GPUs will work but you will likely experience poor battery life.
Log out and log back in to apply.
A GPU switch from integrated to nvidia is pending.
/bin/sh: line 1: qtile-cmd: command not found
/bin/sh: line 1: bspc: command not found
/bin/sh: line 1: awesome-client: command not found
/bin/sh: line 1: openbox: command not found
/bin/sh: line 1: i3-msg: command not found

Using UEFI "discrete mode", after installing optimus and rebooting, gets me stuck on black screen with text "... clean... files". I saved the journalctl for that boot and then restored using timeshift. Grepping for "python3" shows:

Jun 14 12:43:46 dexter-thinkpad kernel: random: python3: uninitialized urandom read (24 bytes read)
Jun 14 12:43:46 dexter-thinkpad python3[532]: [14] INFO: # Daemon pre-start hook
Jun 14 12:43:46 dexter-thinkpad python3[532]: [14] INFO: Removing /etc/X11/xorg.conf.d/10-optimus-manager.conf (if present)
Jun 14 12:43:46 dexter-thinkpad python3[532]: [15] INFO: Startup mode is: integrated
Jun 14 12:43:46 dexter-thinkpad python3[532]: [15] INFO: Writing state {'type': 'pending_pre_xorg_start', 'requested_mode': 'integrated', 'current_mode': None}
Jun 14 12:43:46 dexter-thinkpad python3[532]: [15] INFO: Daemon pre-start hook completed successfully.
Jun 14 12:43:46 dexter-thinkpad python3[532]: [15] INFO: Calling Xorg pre-start hook.
Jun 14 12:43:46 dexter-thinkpad python3[577]: [5] INFO: # Xorg pre-start hook
Jun 14 12:43:46 dexter-thinkpad python3[577]: [6] INFO: Previous state was: {'type': 'pending_pre_xorg_start', 'requested_mode': 'integrated', 'current_mode': None}
Jun 14 12:43:46 dexter-thinkpad python3[577]: [6] INFO: Requested mode is: integrated
Jun 14 12:43:46 dexter-thinkpad python3[612]: modinfo: ERROR: Module bbswitch not found.
Jun 14 12:43:46 dexter-thinkpad python3[613]: modinfo: ERROR: Module acpi_call not found.
Jun 14 12:43:48 dexter-thinkpad python3[577]: [2053] INFO: Available modules: ['nouveau', 'nvidia', 'nvidia_drm', 'nvidia_modeset', 'nvidia_uvm']
Jun 14 12:43:48 dexter-thinkpad python3[577]: [2053] INFO: Unloading modules ['nvidia_drm', 'nvidia_modeset', 'nvidia_uvm', 'nvidia'] (if loaded)
Jun 14 12:43:48 dexter-thinkpad python3[577]: [2056] INFO: switching=none, nothing to do
Jun 14 12:43:49 dexter-thinkpad python3[577]: [2850] ERROR: Xorg pre-start setup error
Jun 14 12:43:49 dexter-thinkpad python3[577]: Traceback (most recent call last):
Jun 14 12:43:49 dexter-thinkpad python3[577]:   File "/usr/lib/python3.10/site-packages/optimus_manager/hooks/pre_xorg_start.py", line 52, in main
Jun 14 12:43:49 dexter-thinkpad python3[577]:     configure_xorg(config, requested_mode)
Jun 14 12:43:49 dexter-thinkpad python3[577]:   File "/usr/lib/python3.10/site-packages/optimus_manager/xorg.py", line 18, in configure_xorg
Jun 14 12:43:49 dexter-thinkpad python3[577]:     bus_ids = get_gpus_bus_ids()
Jun 14 12:43:49 dexter-thinkpad python3[577]:   File "/usr/lib/python3.10/site-packages/optimus_manager/pci.py", line 100, in get_gpus_bus_ids
Jun 14 12:43:49 dexter-thinkpad python3[577]:     raise PCIError("Cannot find the integrated GPU. Is this an Optimus system ?")
Jun 14 12:43:49 dexter-thinkpad python3[577]: optimus_manager.pci.PCIError: Cannot find the integrated GPU. Is this an Optimus system ?
Jun 14 12:43:49 dexter-thinkpad python3[577]: [2850] INFO: Removing /etc/X11/xorg.conf.d/10-optimus-manager.conf (if present)
Jun 14 12:43:49 dexter-thinkpad python3[577]: [2851] INFO: Writing state {'type': 'pre_xorg_start_failed', 'switch_id': '20220614T124346', 'requested_mode': 'integrated'}
Jun 14 12:43:49 dexter-thinkpad python3[691]: [0] INFO: # Commands daemon
Jun 14 12:43:49 dexter-thinkpad python3[691]: [1] INFO: Opening UNIX socket
Jun 14 12:43:49 dexter-thinkpad python3[691]: [1] INFO: Awaiting commands
dextertd commented 2 years ago

Returned the laptop as I couldn't get this to work.