bayasdev / envycontrol

Easy GPU switching for Nvidia Optimus laptops under Linux
MIT License
1.33k stars 62 forks source link

[BUG] Nvidia dgpu becomes unusable after using envycontrol, even after switching to hybrid mode/reset #182

Closed Fredolx closed 3 months ago

Fredolx commented 3 months ago

Describe the bug Nvidia dgpu becomes unusable after using envycontrol, even after switching to hybrid mode/reset

To Reproduce Steps to reproduce the behavior:

  1. Run sudo envycontrol -s integrated
  2. Reboot
  3. Run sudo envycontrol -s hybrid
  4. Reboot
  5. Try to play games using dgpu on Bottles/Steam

System Information:

Additional context I can't launch games/programs using the dgpu after using envycontrol. Only fully reinstalling the nvidia driver fixes the problem. I have tried --reset and switching to hybrid and also rebuilding the initramfs myself.

Fredolx commented 3 months ago

I think the issue stems from flatpak removing the nvidia libs after a while (becomes unused)

nvidia-535-183-01                            org.freedesktop.Platform.GL32.nvidia-535-183-01                                        1.4                user
nvidia-535-183-01                            org.freedesktop.Platform.GL.nvidia-535-183-01                                          1.4                user

I'll try to see if this is the case

Fredolx commented 3 months ago

I went to check my logs and I can confirm that flatpak considers nvidia runtimes as unused in integrated mode. Flatpak on my system auto-updates and removes unused, so it kept deleting my nvidia runtimes in integrated mode. I would add a warning to not run flatpak uninstall --unused in integrated mode or to pin them.