bayasdev / envycontrol

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

[QUESTION] #174

Open Xdavius opened 2 months ago

Xdavius commented 2 months ago

Hi,

Now that 555 drivers are released and Wayland is working, is there a possibility to use envycontrol with Wayland ? (Is it works on Wayland as it works on X11)

Thanks for spending time to answer.

Regards.

bayasdev commented 2 months ago

@Xdavius I've been out of the loop but AFAIK the primary GPU selection on Wayland is DE/WM specific

klmcwhirter commented 2 months ago

My experience has been, as @Xdavius mentioned that at least with Fedora Workstation up to 39, because Wayland is implemented via the Xwayland adapter - envycontrol seems to work fine.

Note my testing has not been extensive - I am not a gamer and do not use an external monitor, for example.

But I did do a project using Pytorch that needs CUDA support and also was using integrated mode primarily for quite a while to try to stretch battery life.

Once X11 is completely dropped in version 41 I believe things will change. Even getting the nvidia driver installed in version 40 has been dicey for me. So the situation will need to be monitored closely once version 41 is released.

But realistically, I have stopped using envycontrol at this point in favor of the stock, out-of-the-box hybrid mode which works fine for me. I just gave up on the battery life pursuit. I simply just expect to keep my laptop plugged into power except for brief excursions unplugged - less than 2 hours.

Xdavius commented 1 month ago

@Xdavius I've been out of the loop but AFAIK the primary GPU selection on Wayland is DE/WM specific

I have found something but I don't know if it can be useful for envycontrol.

You can add theses lines to /etc/environment to force the use of the Nvidia GPU by default

DRI_PRIME=pci-0000_01_00_0
VK_LAYER_NV_optimus=NVIDIA_only
GLX_VENDOR_LIBRARY_NAME=nvidia

Maybe it needs more investigations to have the switch option on your app.

Maybe it's not useful for you but, I share the info in case :)