Askannz / optimus-manager

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

xorg seems to be losing the configuration during the suspension #336

Closed eyuphuro closed 22 hours ago

eyuphuro commented 3 years ago

After a period of suspension (after closing the lid of the laptop), when starting the section I receive a notification that I do not have gdm prime installed (although it is installed), this notification is probably of the prime-indicator extension. And seeing in the menu (topbar) of that extension comes options the three options (intel, nvidia, hybrid) which is not normal, and when trying to "change" to one of the modes, it does not close the section automatically. In those cases, after the suspension I have to close the section and re-enter and everything is normal. xorg seems to be losing the configurations during the suspension.

System info

Logs /var/log/optimus-manager/switch/ `cat /var/log/optimus-manager/switch/switch-20201023T025716.log [11] INFO: # Xorg pre-start hook [11] INFO: Previous state was: {'type': 'pending_pre_xorg_start', 'requested_mode': 'intel', 'current_mode': None} [12] INFO: Requested mode is: intel [12] INFO: Checking for GDM display servers [921] INFO: Available modules: ['nouveau', 'acpi_call', 'nvidia', 'nvidia_drm', 'nvidia_modeset', 'nvidia_uvm'] [921] INFO: Unloading modules ['nvidia_drm', 'nvidia_modeset', 'nvidia_uvm', 'nvidia'] (if loaded) [926] INFO: Removing Nvidia from PCI bus [940] WARNING: pci_remove is enabled, pci_power_control option ignored. [1342] INFO: Loaded extra Intel Xorg options (0 lines) [1343] INFO: Loaded extra Intel Xorg options (0 lines) [1343] INFO: Writing to /etc/X11/xorg.conf.d/10-optimus-manager.conf [1343] INFO: Writing state {'type': 'pending_post_xorg_start', 'switch_id': '20201023T025716', 'requested_mode': 'intel'} [1343] INFO: Xorg pre-start hook completed successfully. [4] INFO: # Xorg post-start hook [4] INFO: Running /etc/optimus-manager/xsetup-intel.sh [16] INFO: Writing state {'type': 'done', 'switch_id': '20201023T025716', 'current_mode': 'intel'} [16] INFO: Xorg post-start hook completed successfully. [10] INFO: # Xorg pre-start hook [10] INFO: Previous state was: {'type': 'done', 'switch_id': '20201023T025716', 'current_mode': 'intel'} [10] INFO: Requested mode is: intel [10] INFO: Checking for GDM display servers [317] INFO: Loaded extra Intel Xorg options (0 lines) [317] INFO: Loaded extra Intel Xorg options (0 lines) [317] INFO: Writing to /etc/X11/xorg.conf.d/10-optimus-manager.conf [317] INFO: Writing state {'type': 'pending_post_xorg_start', 'switch_id': '20201023T025716', 'requested_mode': 'intel'} [318] INFO: Xorg pre-start hook completed successfully.

and/var/log/optimus-manager/daemon/. cat /var/log/optimus-manager/daemon/daemon-20201023T032449.log [28] INFO: # Daemon pre-start hook [29] INFO: Removing /etc/X11/xorg.conf.d/10-optimus-manager.conf (if present) [29] INFO: Copying /etc/optimus-manager/optimus-manager.conf to /var/lib/optimus-manager/tmp/config_copy.conf [32] INFO: Startup mode is: intel [32] INFO: Writing state {'type': 'pending_pre_xorg_start', 'requested_mode': 'intel', 'current_mode': None} [32] INFO: Daemon pre-start hook completed successfully. [32] INFO: Calling Xorg pre-start hook. [1] INFO: # Commands daemon [1] INFO: Opening UNIX socket [1] INFO: Awaiting commands `

branalba commented 3 years ago

I have the same issues (Arch, Gnome, GDM, latest stable release, using Optimus manager indicator extension). It doesn't happen every suspension, and I haven't been able to pick out a pattern to it, but sometimes when I return from suspension I'll get that same "You aren't using GDM-Prime" message and I see all three mode options in the indicator menu. From that point, either clicking the "Switch" buttons in the indicator or running the optimus-manager --switch command won't work. A reboot or logout fixes the problem, but this is obviously annoying because I have to restart my session.

The only "fix" I've found so far is running the command "prime-offload" after returning from the suspension makes the switch buttons actually work, i.e., clicking "Switch to Hybrid" will actually switch my graphics mode, and the optimius-manager --switch commands also work after this.

nwildner commented 3 days ago

Sup @eyuphuro and @branalba . Is this still reproducible on a modern distribution with updated linux kernel, nvidia driver version and using the optimus-manager-git package? The project is facing a revamp so, please stick with the -git version of this package.

Let me know if this issue is still relevant to you ok?

Have a nice week.