bayasdev / envycontrol

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

Disable nvidia from EGL when in integrated mode #70

Open russelltg opened 1 year ago

russelltg commented 1 year ago

EGL applications have an extra second of startup when in integrated mode, because nvidia's glvnd library runs nvidia-modprobe, which takes a while when the nvidia GPU is off.

It seems like this project is unmaintained as stated on the website, but it would be cool if this project could do something similar to what I do here https://github.com/alacritty/alacritty/issues/6359#issuecomment-1364724766

I'm happy to open a PR if there is interest from the maintainer(s)

bayasdev commented 1 year ago

I'm not sure if this could break stuff for others, however I found this in the Arch Wiki as a workaround for apps that use libglvnd on Bumblebee setups that disable the Nvidia card like envycontrol does.

Feel free to open a PR in the meantime ;)

the-spyke commented 1 year ago

Is it okay to use integrated mode with nvidia proprietary drivers removed? I mean if the GPU will be properly turned off. In the case if the driver is installed there's also an additional NVIDIA Optimus layer with you can see in $ vulkaninfo --summary. It could be disabled by, but it doesn't work for me:

export DISABLE_LAYER_NV_OPTIMUS_1=1

And nvidia's ICD file is loaded by Vulkan as well. I'm currently fixing this by:

export VK_ICD_FILENAMES="/usr/share/vulkan/icd.d/intel_icd.x86_64.json:/usr/share/vulkan/icd.d/lvp_icd.x86_64.json"
bayasdev commented 1 year ago

Currently, I'm a bit busy but I've made some experiments adding and removing the __EGL_VENDOR_LIBRARY_FILENAMES workaround from the /etc/profile but if you have a clean solution in Python please let me know.

On Sat, Jan 28, 2023, 18:37 Anton Alexandrenok @.***> wrote:

Is it okay to use integrated mode with nvidia proprietary drivers removed? I mean if the GPU will be properly turned off. In the case if the driver is installed there's also an additional NVIDIA Optimus layer with you can see in $ vulkaninfo --summary.

— Reply to this email directly, view it on GitHub https://github.com/bayasdev/envycontrol/issues/70#issuecomment-1407512049, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALY7IYOO575PXDV6SQY6OPLWUWUS5ANCNFSM6AAAAAATJD5XRU . You are receiving this because you commented.Message ID: @.***>

diniamo commented 4 months ago

I don't have nvidia-modprobe, and the strace says so too (No such file or directory), but I still get a noticable delay. The workaround results in

libEGL warning: egl: failed to create dri2 screen
DRM kernel driver 'nvidia-drm' in use. NVK requires nouveau.
MESA: warning: zink: PERF WARNING! > 100 copy boxes detected for 0x55651f510040

Any ideas?