Closed garyvdm closed 3 years ago
Examples of other people encountering this issue:
https://askubuntu.com/questions/1267834/nouveau-drivers-doesnt-work-on-ubuntu-20-04-with-prime https://unix.stackexchange.com/questions/594273/how-do-i-switch-gpus-with-libglvnd https://askubuntu.com/questions/1272422/run-application-using-a-specific-gpu-on-a-system-with-multiple-gpus
Libglvnd has been moved over to Freedesktop, so any new bug reports should go there: https://gitlab.freedesktop.org/glvnd/libglvnd
That said, DRI_PRIME is specific to Mesa, not libglvnd. Libglvnd can't use it because it has no knowledge of available hardware.
To use GPU offloading with the NVIDIA driver, you'd need to set these:
# Tell libglvnd to use the NVIDIA vendor library even if the X server would tell it to use Mesa
__GLX_VENDOR_LIBRARY_NAME=nvidia
# Tell the NVIDIA vendor library to use GPU offloading
__NV_PRIME_RENDER_OFFLOAD=1
I have a hybrid graphic setup with a Nvidia & Intel graphics cards. When I set my machine to use either
nvidia
orintel
usingprime-select
then all works as expected. However when I try useon-demand
and I try to run an application withDRI_PRIME=1
to get it to use the Nvidia card, libglvnd incorrectly loads mesa, which tries to load nouveau, which fails, and then falls back to using the Intel card.It would be nice if libglvnd detected when run with
DRI_PRIME=1
and used the correct vendor.