I’m having issues when attempting to run an OpenGL or OpenGL ES application on the Nvidia GPU while using a Wayland desktop environment. I’m running Pop!_OS 22.04 LTS with GNOME 42 Wayland (although the issue still presents under Weston). My graphics setup includes an integrated Intel GPU with two outputs (internal display and HDMI port). My laptop also has a headless Nvidia GeForce GTX 1650 Mobile / Max-Q GPU with no display output (PRIME offload only).
I recently upgraded to the 565.77 Nvidia drivers, the latest supported by my distro. I was able to run Wayland applications on the Nvidia GPU before the upgrade, but now I can’t. (I can’t downgrade as the next oldest supported drivers on my distro are the 470 ones.) No one else appears to be experiencing my issue.
Here’s what happens: I’m testing using mesa-demos version 9.0.0, compiled myself (because the mesa-utils 8.4.0 package shipped with the distro is borked, it uses wl_shell). When I run any program that uses EGL on the Nvidia GPU under Wayland, It crashes.
When I attempt to run either eglgears_wayland
or es2gears_wayland
(the result is the same), this is what I get.
# First attempt, running on intel graphics
$ ./eglgears_wayland
# Works fine
# Second attempt, tries to run on Nvidia graphics, but falls back to Intel
$ __NV_PRIME_RENDER_OFFLOAD=1 ./eglgears_wayland
# Works
# Third attempt, force to run on Nvidia graphics
$ __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/10_nvidia.json __NV_PRIME_RENDER_OFFLOAD=1 ./eglgears_wayland
# Crashes. Gives the error "EGLUT: failed to initialize EGL display"
I modified the code for eglut, used by eglgears to show the output of eglGetDisplay, which is what is failing. It returns NULL instead of a pointer to an EGLDisplay struct, and it sets an error value of 12296 (0x3008) which equates to EGL_BAD_DISPLAY.
eglgears_x11 and es2gears_x11 both work fine, on both Intel and Nvidia graphics. When I run a different application (supertuxkart) under Wayland, it also crashes when I set __EGL_VENDOR_LIBRARY_FILENAMES and __NV_PRIME_RENDER_OFFLOAD=1. Works fine under X11.
This is the output of eglinfo -B
:
GBM platform:
eglinfo: eglInitialize failed
Wayland platform:
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES
OpenGL core profile vendor: Intel
OpenGL core profile renderer: Mesa Intel(R) UHD Graphics (CML GT2)
OpenGL core profile version: 4.6 (Core Profile) Mesa 24.0.3-1pop1~1711635559~22.04~7a9f319
OpenGL core profile shading language version: 4.60
OpenGL compatibility profile vendor: Intel
OpenGL compatibility profile renderer: Mesa Intel(R) UHD Graphics (CML GT2)
OpenGL compatibility profile version: 4.6 (Compatibility Profile) Mesa 24.0.3-1pop1~1711635559~22.04~7a9f319
OpenGL compatibility profile shading language version: 4.60
OpenGL ES profile vendor: Intel
OpenGL ES profile renderer: Mesa Intel(R) UHD Graphics (CML GT2)
OpenGL ES profile version: OpenGL ES 3.2 Mesa 24.0.3-1pop1~1711635559~22.04~7a9f319
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20
X11 platform:
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES
OpenGL core profile vendor: Intel
OpenGL core profile renderer: Mesa Intel(R) UHD Graphics (CML GT2)
OpenGL core profile version: 4.6 (Core Profile) Mesa 24.0.3-1pop1~1711635559~22.04~7a9f319
OpenGL core profile shading language version: 4.60
OpenGL compatibility profile vendor: Intel
OpenGL compatibility profile renderer: Mesa Intel(R) UHD Graphics (CML GT2)
OpenGL compatibility profile version: 4.6 (Compatibility Profile) Mesa 24.0.3-1pop1~1711635559~22.04~7a9f319
OpenGL compatibility profile shading language version: 4.60
OpenGL ES profile vendor: Intel
OpenGL ES profile renderer: Mesa Intel(R) UHD Graphics (CML GT2)
OpenGL ES profile version: OpenGL ES 3.2 Mesa 24.0.3-1pop1~1711635559~22.04~7a9f319
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20
Surfaceless platform:
EGL API version: 1.5
EGL vendor string: NVIDIA
EGL version string: 1.5
EGL client APIs: OpenGL_ES OpenGL
OpenGL core profile vendor: NVIDIA Corporation
OpenGL core profile renderer: NVIDIA GeForce GTX 1650 with Max-Q Design/PCIe/SSE2
OpenGL core profile version: 4.6.0 NVIDIA 565.77
OpenGL core profile shading language version: 4.60 NVIDIA
OpenGL compatibility profile vendor: NVIDIA Corporation
OpenGL compatibility profile renderer: NVIDIA GeForce GTX 1650 with Max-Q Design/PCIe/SSE2
OpenGL compatibility profile version: 4.6.0 NVIDIA 565.77
OpenGL compatibility profile shading language version: 4.60 NVIDIA
OpenGL ES profile vendor: NVIDIA Corporation
OpenGL ES profile renderer: NVIDIA GeForce GTX 1650 with Max-Q Design/PCIe/SSE2
OpenGL ES profile version: OpenGL ES 3.2 NVIDIA 565.77
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20
Device platform:
Device #0:
Platform Device platform:
EGL API version: 1.5
EGL vendor string: NVIDIA
EGL version string: 1.5
EGL client APIs: OpenGL_ES OpenGL
OpenGL core profile vendor: NVIDIA Corporation
OpenGL core profile renderer: NVIDIA GeForce GTX 1650 with Max-Q Design/PCIe/SSE2
OpenGL core profile version: 4.6.0 NVIDIA 565.77
OpenGL core profile shading language version: 4.60 NVIDIA
OpenGL compatibility profile vendor: NVIDIA Corporation
OpenGL compatibility profile renderer: NVIDIA GeForce GTX 1650 with Max-Q Design/PCIe/SSE2
OpenGL compatibility profile version: 4.6.0 NVIDIA 565.77
OpenGL compatibility profile shading language version: 4.60 NVIDIA
OpenGL ES profile vendor: NVIDIA Corporation
OpenGL ES profile renderer: NVIDIA GeForce GTX 1650 with Max-Q Design/PCIe/SSE2
OpenGL ES profile version: OpenGL ES 3.2 NVIDIA 565.77
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20
Device #1:
Platform Device platform:
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES
OpenGL core profile vendor: Intel
OpenGL core profile renderer: Mesa Intel(R) UHD Graphics (CML GT2)
OpenGL core profile version: 4.6 (Core Profile) Mesa 24.0.3-1pop1~1711635559~22.04~7a9f319
OpenGL core profile shading language version: 4.60
OpenGL compatibility profile vendor: Intel
OpenGL compatibility profile renderer: Mesa Intel(R) UHD Graphics (CML GT2)
OpenGL compatibility profile version: 4.6 (Compatibility Profile) Mesa 24.0.3-1pop1~1711635559~22.04~7a9f319
OpenGL compatibility profile shading language version: 4.60
OpenGL ES profile vendor: Intel
OpenGL ES profile renderer: Mesa Intel(R) UHD Graphics (CML GT2)
OpenGL ES profile version: OpenGL ES 3.2 Mesa 24.0.3-1pop1~1711635559~22.04~7a9f319
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20
Device #2:
Platform Device platform:
libEGL warning: egl: failed to create dri2 screen
libEGL warning: egl: failed to create dri2 screen
libEGL warning: egl: failed to create dri2 screen
eglinfo: eglInitialize failed
Device #3:
Platform Device platform:
EGL API version: 1.5
EGL vendor string: Mesa Project
EGL version string: 1.5
EGL client APIs: OpenGL OpenGL_ES
OpenGL core profile vendor: Mesa
OpenGL core profile renderer: llvmpipe (LLVM 15.0.7, 256 bits)
OpenGL core profile version: 4.5 (Core Profile) Mesa 24.0.3-1pop1~1711635559~22.04~7a9f319
OpenGL core profile shading language version: 4.50
OpenGL compatibility profile vendor: Mesa
OpenGL compatibility profile renderer: llvmpipe (LLVM 15.0.7, 256 bits)
OpenGL compatibility profile version: 4.5 (Compatibility Profile) Mesa 24.0.3-1pop1~1711635559~22.04~7a9f319
OpenGL compatibility profile shading language version: 4.50
OpenGL ES profile vendor: Mesa
OpenGL ES profile renderer: llvmpipe (LLVM 15.0.7, 256 bits)
OpenGL ES profile version: OpenGL ES 3.2 Mesa 24.0.3-1pop1~1711635559~22.04~7a9f319
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20
Output when running with __EGL_VENDOR_LIBRARY_FILENAMES and __NV_PRIME_RENDER_OFFLOAD set:
GBM platform:
eglinfo: eglInitialize failed
X11 platform:
EGL API version: 1.5
EGL vendor string: NVIDIA
EGL version string: 1.5
EGL client APIs: OpenGL_ES OpenGL
OpenGL core profile vendor: NVIDIA Corporation
OpenGL core profile renderer: NVIDIA GeForce GTX 1650 with Max-Q Design/PCIe/SSE2
OpenGL core profile version: 4.6.0 NVIDIA 565.77
OpenGL core profile shading language version: 4.60 NVIDIA
OpenGL compatibility profile vendor: NVIDIA Corporation
OpenGL compatibility profile renderer: NVIDIA GeForce GTX 1650 with Max-Q Design/PCIe/SSE2
OpenGL compatibility profile version: 4.6.0 NVIDIA 565.77
OpenGL compatibility profile shading language version: 4.60 NVIDIA
OpenGL ES profile vendor: NVIDIA Corporation
OpenGL ES profile renderer: NVIDIA GeForce GTX 1650 with Max-Q Design/PCIe/SSE2
OpenGL ES profile version: OpenGL ES 3.2 NVIDIA 565.77
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20
Surfaceless platform:
EGL API version: 1.5
EGL vendor string: NVIDIA
EGL version string: 1.5
EGL client APIs: OpenGL_ES OpenGL
OpenGL core profile vendor: NVIDIA Corporation
OpenGL core profile renderer: NVIDIA GeForce GTX 1650 with Max-Q Design/PCIe/SSE2
OpenGL core profile version: 4.6.0 NVIDIA 565.77
OpenGL core profile shading language version: 4.60 NVIDIA
OpenGL compatibility profile vendor: NVIDIA Corporation
OpenGL compatibility profile renderer: NVIDIA GeForce GTX 1650 with Max-Q Design/PCIe/SSE2
OpenGL compatibility profile version: 4.6.0 NVIDIA 565.77
OpenGL compatibility profile shading language version: 4.60 NVIDIA
OpenGL ES profile vendor: NVIDIA Corporation
OpenGL ES profile renderer: NVIDIA GeForce GTX 1650 with Max-Q Design/PCIe/SSE2
OpenGL ES profile version: OpenGL ES 3.2 NVIDIA 565.77
OpenGL ES profile shading language version: OpenGL ES GLSL ES 3.20
I noticed that in both cases, the GBM platform shows “eglinfo: eglInitialize failed”, and when running with environment variables, the Wayland platform is outright missing.
Are there any other environment variables that I should be aware of to try running stuff with, or anything you think might be missing/broken from my installation? Anything to install/uninstall/reinstall? Anyone that has the same issue? Thanks
nvidia-bug-report.log.gz (620.5 KB)