glutin icon indicating copy to clipboard operation
glutin copied to clipboard

Proprietary Nvidia (Wayland): eglCreateWindowSurface failed

Open aidanharris opened this issue 6 years ago • 22 comments

Migrated from jwilm/alacritty#1269

A segfault occurs when using glutin with the binary Nvidia driver and a Wayland compositor.

Backtrace obtained from rust-gdb from running glutin's window example:

https://gist.github.com/aidanharris/f1fe409c463e79c575242a9edd255ea8

If I force the mesa driver to be used instead of Nvidia's library (env LD_PRELOAD=/usr/lib64/libEGL.so cargo run --example window) no segfault occurs and the example runs fine (I assume mesa is doing software rendering but it does work so perhaps this is an issue with the Nvidia driver?).

aidanharris avatar Jul 14 '19 12:07 aidanharris

@aidanharris Which wayland compositor are you running?

kchibisov avatar Jul 14 '19 14:07 kchibisov

@kchibisov GNOME (mutter) but I'm not sure it matters. The issue also occurs with KDE's Kwin.

aidanharris avatar Jul 14 '19 14:07 aidanharris

@aidanharris Some wayland compositors don't work with nvidia binary driver, so was ensuring that your compositor supports it.

kchibisov avatar Jul 14 '19 14:07 kchibisov

Can you do the following export LD_PRELOAD=/usr/lib64/libEGL.so ; glxinfo && eglinfo && glinfo?

goddessfreya avatar Jul 14 '19 21:07 goddessfreya

glxinfo fails as follows:

name of display: :0
Error: couldn't find RGB GLX visual or fbconfig

(this is actually expected because XWayland currently doesn't work properly with Nvidia's driver so any X11 applications using glx won't work at all but egl should work with Wayland applications that don't use X11)

eglinfo
EGL client extensions string:
    EGL_EXT_client_extensions EGL_EXT_device_base
    EGL_EXT_device_enumeration EGL_EXT_device_query EGL_EXT_platform_base
    EGL_KHR_client_get_all_proc_addresses EGL_KHR_debug
    EGL_EXT_platform_wayland EGL_EXT_platform_x11 EGL_MESA_platform_gbm
    EGL_MESA_platform_surfaceless EGL_EXT_platform_device

GBM platform:
eglinfo: eglInitialize failed

Wayland platform:
EGL API version: 1.4
EGL vendor string: Mesa Project
EGL version string: 1.4
EGL client APIs: OpenGL OpenGL_ES 
EGL extensions string:
    EGL_KHR_cl_event2 EGL_KHR_config_attribs
    EGL_KHR_context_flush_control EGL_KHR_create_context
    EGL_KHR_create_context_no_error EGL_KHR_fence_sync
    EGL_KHR_get_all_proc_addresses EGL_KHR_gl_colorspace
    EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image
    EGL_KHR_gl_texture_3D_image EGL_KHR_gl_texture_cubemap_image
    EGL_KHR_image_base EGL_KHR_no_config_context EGL_KHR_reusable_sync
    EGL_KHR_surfaceless_context EGL_EXT_pixel_format_float
    EGL_KHR_wait_sync EGL_MESA_configless_context EGL_MESA_drm_image
    EGL_MESA_query_driver
Configurations:
     bf lv colorbuffer dp st  ms    vis   cav bi  renderable  supported
  id sz  l  r  g  b  a th cl ns b    id   eat nd gl es es2 vg surfaces 
---------------------------------------------------------------------
0x01 32  0  8  8  8  8  0  0  0 0 0x00--         y  y  y     win
0x02 32  0  8  8  8  8 16  0  0 0 0x00--         y  y  y     win
0x03 32  0  8  8  8  8 24  0  0 0 0x00--         y  y  y     win
0x04 32  0  8  8  8  8 24  8  0 0 0x00--         y  y  y     win
0x05 32  0  8  8  8  8 32  0  0 0 0x00--         y  y  y     win
0x06 24  0  8  8  8  0  0  0  0 0 0x00--         y  y  y     win
0x07 24  0  8  8  8  0 16  0  0 0 0x00--         y  y  y     win
0x08 24  0  8  8  8  0 24  0  0 0 0x00--         y  y  y     win
0x09 24  0  8  8  8  0 24  8  0 0 0x00--         y  y  y     win
0x0a 24  0  8  8  8  0 32  0  0 0 0x00--         y  y  y     win

X11 platform:
EGL API version: 1.4
EGL vendor string: Mesa Project
EGL version string: 1.4
EGL client APIs: OpenGL OpenGL_ES 
EGL extensions string:
    EGL_KHR_cl_event2 EGL_KHR_config_attribs
    EGL_KHR_context_flush_control EGL_KHR_create_context
    EGL_KHR_create_context_no_error EGL_KHR_fence_sync
    EGL_KHR_get_all_proc_addresses EGL_KHR_gl_colorspace
    EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image
    EGL_KHR_gl_texture_3D_image EGL_KHR_gl_texture_cubemap_image
    EGL_KHR_image_base EGL_KHR_no_config_context EGL_KHR_reusable_sync
    EGL_KHR_surfaceless_context EGL_EXT_pixel_format_float
    EGL_KHR_wait_sync EGL_MESA_configless_context EGL_MESA_drm_image
    EGL_MESA_query_driver
Configurations:
     bf lv colorbuffer dp st  ms    vis   cav bi  renderable  supported
  id sz  l  r  g  b  a th cl ns b    id   eat nd gl es es2 vg surfaces 
---------------------------------------------------------------------
0x01 32  0  8  8  8  8  0  0  0 0 0x23TC      a  y  y  y     win,pb,pix
0x02 32  0  8  8  8  8 16  0  0 0 0x23TC      a  y  y  y     win,pb,pix
0x03 32  0  8  8  8  8 24  0  0 0 0x23TC      a  y  y  y     win,pb,pix
0x04 32  0  8  8  8  8 24  8  0 0 0x23TC      a  y  y  y     win,pb,pix
0x05 32  0  8  8  8  8 32  0  0 0 0x23TC      a  y  y  y     win,pb,pix
0x06 24  0  8  8  8  0  0  0  0 0 0x23TC      y  y  y  y     win,pb,pix
0x07 24  0  8  8  8  0 16  0  0 0 0x23TC      y  y  y  y     win,pb,pix
0x08 24  0  8  8  8  0 24  0  0 0 0x23TC      y  y  y  y     win,pb,pix
0x09 24  0  8  8  8  0 24  8  0 0 0x23TC      y  y  y  y     win,pb,pix
0x0a 24  0  8  8  8  0 32  0  0 0 0x23TC      y  y  y  y     win,pb,pix
0x0b 32  0  8  8  8  8  0  0  0 0 0x24DC      a  y  y  y     win,pb,pix
0x0c 32  0  8  8  8  8 16  0  0 0 0x24DC      a  y  y  y     win,pb,pix
0x0d 32  0  8  8  8  8 24  0  0 0 0x24DC      a  y  y  y     win,pb,pix
0x0e 32  0  8  8  8  8 24  8  0 0 0x24DC      a  y  y  y     win,pb,pix
0x0f 32  0  8  8  8  8 32  0  0 0 0x24DC      a  y  y  y     win,pb,pix
0x10 24  0  8  8  8  0  0  0  0 0 0x24DC      y  y  y  y     win,pb,pix
0x11 24  0  8  8  8  0 16  0  0 0 0x24DC      y  y  y  y     win,pb,pix
0x12 24  0  8  8  8  0 24  0  0 0 0x24DC      y  y  y  y     win,pb,pix
0x13 24  0  8  8  8  0 24  8  0 0 0x24DC      y  y  y  y     win,pb,pix
0x14 24  0  8  8  8  0 32  0  0 0 0x24DC      y  y  y  y     win,pb,pix
0x15 16  0  5  6  5  0  0  0  0 0 0x00--      y  y  y  y     pb

Device platform:
eglinfo: eglInitialize failed

For comparison here's eglinfo without the LD_PRELOAD:

eglinfo
EGL client extensions string:
    EGL_EXT_platform_base EGL_EXT_device_base
    EGL_KHR_client_get_all_proc_addresses EGL_EXT_client_extensions
    EGL_KHR_debug EGL_KHR_platform_x11 EGL_EXT_platform_x11
    EGL_EXT_platform_device EGL_KHR_platform_wayland
    EGL_EXT_platform_wayland

Wayland platform:
EGL API version: 1.5
EGL vendor string: NVIDIA
EGL version string: 1.5
EGL client APIs: OpenGL_ES OpenGL
EGL extensions string:
    EGL_EXT_client_sync EGL_EXT_create_context_robustness
    EGL_EXT_output_base EGL_EXT_output_drm
    EGL_EXT_stream_consumer_egloutput EGL_EXT_stream_acquire_mode
    EGL_EXT_sync_reuse EGL_IMG_context_priority EGL_KHR_config_attribs
    EGL_KHR_create_context_no_error EGL_KHR_context_flush_control
    EGL_KHR_create_context EGL_KHR_display_reference EGL_KHR_fence_sync
    EGL_KHR_get_all_proc_addresses EGL_KHR_swap_buffers_with_damage
    EGL_KHR_no_config_context EGL_KHR_gl_colorspace
    EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image
    EGL_KHR_gl_texture_3D_image EGL_KHR_gl_texture_cubemap_image
    EGL_KHR_image EGL_KHR_image_base EGL_KHR_reusable_sync EGL_KHR_stream
    EGL_KHR_stream_attrib EGL_KHR_stream_consumer_gltexture
    EGL_KHR_stream_cross_process_fd EGL_KHR_stream_fifo
    EGL_KHR_stream_producer_eglsurface EGL_KHR_surfaceless_context
    EGL_KHR_wait_sync EGL_NV_nvrm_fence_sync EGL_NV_quadruple_buffer
    EGL_NV_stream_cross_display EGL_NV_stream_cross_object
    EGL_NV_stream_cross_process EGL_NV_stream_cross_system
    EGL_NV_stream_flush EGL_NV_stream_metadata EGL_NV_stream_remote
    EGL_NV_stream_reset EGL_NV_stream_socket EGL_NV_stream_socket_inet
    EGL_NV_stream_socket_unix EGL_NV_stream_sync EGL_NV_stream_fifo_next
    EGL_NV_stream_fifo_synchronous EGL_NV_stream_consumer_gltexture_yuv
    EGL_NV_stream_attrib EGL_NV_stream_origin EGL_NV_system_time
    EGL_NV_output_drm_flip_event EGL_NV_triple_buffer
    EGL_WL_bind_wayland_display EGL_WL_wayland_eglstream
Configurations:
     bf lv colorbuffer dp st  ms    vis   cav bi  renderable  supported
  id sz  l  r  g  b  a th cl ns b    id   eat nd gl es es2 vg surfaces 
---------------------------------------------------------------------
0x01 32  0  8  8  8  8 24  8  0 0 0x00--         y  y  y     win,pb,str
0x02 32  0  8  8  8  8 24  0  0 0 0x00--         y  y  y     win,pb,str
0x03 32  0  8  8  8  8  0  8  0 0 0x00--         y  y  y     win,pb,str
0x04 32  0  8  8  8  8  0  0  0 0 0x00--         y  y  y     win,pb,str
0x05 32  0  8  8  8  8 24  8  2 1 0x00--         y  y  y     win,pb,str
0x06 32  0  8  8  8  8 24  0  2 1 0x00--         y  y  y     win,pb,str
0x07 32  0  8  8  8  8  0  8  2 1 0x00--         y  y  y     win,pb,str
0x08 32  0  8  8  8  8  0  0  2 1 0x00--         y  y  y     win,pb,str
0x09 32  0  8  8  8  8 24  8  4 1 0x00--         y  y  y     win,pb,str
0x0a 32  0  8  8  8  8 24  8  4 1 0x00--         y  y  y     win,pb,str
0x0b 32  0  8  8  8  8 24  0  4 1 0x00--         y  y  y     win,pb,str
0x0c 32  0  8  8  8  8 24  0  4 1 0x00--         y  y  y     win,pb,str
0x0d 32  0  8  8  8  8  0  8  4 1 0x00--         y  y  y     win,pb,str
0x0e 32  0  8  8  8  8  0  8  4 1 0x00--         y  y  y     win,pb,str
0x0f 32  0  8  8  8  8  0  0  4 1 0x00--         y  y  y     win,pb,str
0x10 32  0  8  8  8  8  0  0  4 1 0x00--         y  y  y     win,pb,str
0x11 32  0  8  8  8  8 24  8  8 1 0x00--         y  y  y     win,pb,str
0x12 32  0  8  8  8  8 24  0  8 1 0x00--         y  y  y     win,pb,str
0x13 32  0  8  8  8  8  0  8  8 1 0x00--         y  y  y     win,pb,str
0x14 32  0  8  8  8  8  0  0  8 1 0x00--         y  y  y     win,pb,str
0x15 24  0  8  8  8  0 24  8  0 0 0x00--         y  y  y     win,pb,str
0x16 24  0  8  8  8  0 24  0  0 0 0x00--         y  y  y     win,pb,str
0x17 24  0  8  8  8  0  0  8  0 0 0x00--         y  y  y     win,pb,str
0x18 24  0  8  8  8  0  0  0  0 0 0x00--         y  y  y     win,pb,str
0x19 24  0  8  8  8  0 24  8  2 1 0x00--         y  y  y     win,pb,str
0x1a 24  0  8  8  8  0 24  0  2 1 0x00--         y  y  y     win,pb,str
0x1b 24  0  8  8  8  0  0  8  2 1 0x00--         y  y  y     win,pb,str
0x1c 24  0  8  8  8  0  0  0  2 1 0x00--         y  y  y     win,pb,str
0x1d 24  0  8  8  8  0 24  8  4 1 0x00--         y  y  y     win,pb,str
0x1e 24  0  8  8  8  0 24  8  4 1 0x00--         y  y  y     win,pb,str
0x1f 24  0  8  8  8  0 24  0  4 1 0x00--         y  y  y     win,pb,str
0x20 24  0  8  8  8  0 24  0  4 1 0x00--         y  y  y     win,pb,str
0x21 24  0  8  8  8  0  0  8  4 1 0x00--         y  y  y     win,pb,str
0x22 24  0  8  8  8  0  0  8  4 1 0x00--         y  y  y     win,pb,str
0x23 24  0  8  8  8  0  0  0  4 1 0x00--         y  y  y     win,pb,str
0x24 24  0  8  8  8  0  0  0  4 1 0x00--         y  y  y     win,pb,str
0x25 24  0  8  8  8  0 24  8  8 1 0x00--         y  y  y     win,pb,str
0x26 24  0  8  8  8  0 24  0  8 1 0x00--         y  y  y     win,pb,str
0x27 24  0  8  8  8  0  0  8  8 1 0x00--         y  y  y     win,pb,str
0x28 24  0  8  8  8  0  0  0  8 1 0x00--         y  y  y     win,pb,str
0x29 16  0  5  6  5  0 24  8  0 0 0x00--         y  y  y     win,pb,str
0x2a 16  0  5  6  5  0 24  0  0 0 0x00--         y  y  y     win,pb,str
0x2b 16  0  5  6  5  0 16  0  0 0 0x00--         y  y  y     win,pb,str
0x2c 16  0  5  6  5  0  0  8  0 0 0x00--         y  y  y     win,pb,str
0x2d 16  0  5  6  5  0  0  0  0 0 0x00--         y  y  y     win,pb,str
0x2e 16  0  5  6  5  0 24  8  2 1 0x00--         y  y  y     win,pb,str
0x2f 16  0  5  6  5  0 24  0  2 1 0x00--         y  y  y     win,pb,str
0x30 16  0  5  6  5  0 16  0  2 1 0x00--         y  y  y     win,pb,str
0x31 16  0  5  6  5  0  0  8  2 1 0x00--         y  y  y     win,pb,str
0x32 16  0  5  6  5  0  0  0  2 1 0x00--         y  y  y     win,pb,str
0x33 16  0  5  6  5  0 24  8  4 1 0x00--         y  y  y     win,pb,str
0x34 16  0  5  6  5  0 24  8  4 1 0x00--         y  y  y     win,pb,str
0x35 16  0  5  6  5  0 24  0  4 1 0x00--         y  y  y     win,pb,str
0x36 16  0  5  6  5  0 24  0  4 1 0x00--         y  y  y     win,pb,str
0x37 16  0  5  6  5  0 16  0  4 1 0x00--         y  y  y     win,pb,str
0x38 16  0  5  6  5  0 16  0  4 1 0x00--         y  y  y     win,pb,str
0x39 16  0  5  6  5  0  0  8  4 1 0x00--         y  y  y     win,pb,str
0x3a 16  0  5  6  5  0  0  8  4 1 0x00--         y  y  y     win,pb,str
0x3b 16  0  5  6  5  0  0  0  4 1 0x00--         y  y  y     win,pb,str
0x3c 16  0  5  6  5  0  0  0  4 1 0x00--         y  y  y     win,pb,str
0x3d 16  0  5  6  5  0 24  8  8 1 0x00--         y  y  y     win,pb,str
0x3e 16  0  5  6  5  0 24  0  8 1 0x00--         y  y  y     win,pb,str
0x3f 16  0  5  6  5  0 16  0  8 1 0x00--         y  y  y     win,pb,str
0x40 16  0  5  6  5  0  0  8  8 1 0x00--         y  y  y     win,pb,str
0x41 16  0  5  6  5  0  0  0  8 1 0x00--         y  y  y     win,pb,str

X11 platform:
eglinfo: eglInitialize failed

Device platform:
EGL API version: 1.5
EGL vendor string: NVIDIA
EGL version string: 1.5
EGL client APIs: OpenGL_ES OpenGL
EGL extensions string:
    EGL_EXT_client_sync EGL_EXT_create_context_robustness
    EGL_EXT_output_base EGL_EXT_output_drm
    EGL_EXT_stream_consumer_egloutput EGL_EXT_stream_acquire_mode
    EGL_EXT_sync_reuse EGL_IMG_context_priority EGL_KHR_config_attribs
    EGL_KHR_create_context_no_error EGL_KHR_context_flush_control
    EGL_KHR_create_context EGL_KHR_display_reference EGL_KHR_fence_sync
    EGL_KHR_get_all_proc_addresses EGL_KHR_swap_buffers_with_damage
    EGL_KHR_no_config_context EGL_KHR_gl_colorspace
    EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image
    EGL_KHR_gl_texture_3D_image EGL_KHR_gl_texture_cubemap_image
    EGL_KHR_image EGL_KHR_image_base EGL_KHR_reusable_sync EGL_KHR_stream
    EGL_KHR_stream_attrib EGL_KHR_stream_consumer_gltexture
    EGL_KHR_stream_cross_process_fd EGL_KHR_stream_fifo
    EGL_KHR_stream_producer_eglsurface EGL_KHR_surfaceless_context
    EGL_KHR_wait_sync EGL_NV_nvrm_fence_sync EGL_NV_quadruple_buffer
    EGL_NV_stream_cross_display EGL_NV_stream_cross_object
    EGL_NV_stream_cross_process EGL_NV_stream_cross_system
    EGL_NV_stream_flush EGL_NV_stream_metadata EGL_NV_stream_remote
    EGL_NV_stream_reset EGL_NV_stream_socket EGL_NV_stream_socket_inet
    EGL_NV_stream_socket_unix EGL_NV_stream_sync EGL_NV_stream_fifo_next
    EGL_NV_stream_fifo_synchronous EGL_NV_stream_consumer_gltexture_yuv
    EGL_NV_stream_attrib EGL_NV_stream_origin EGL_NV_system_time
    EGL_NV_output_drm_flip_event EGL_NV_triple_buffer
    EGL_WL_bind_wayland_display EGL_WL_wayland_eglstream
Configurations:
     bf lv colorbuffer dp st  ms    vis   cav bi  renderable  supported
  id sz  l  r  g  b  a th cl ns b    id   eat nd gl es es2 vg surfaces 
---------------------------------------------------------------------
0x01 32  0  8  8  8  8 24  8  0 0 0x00--         y  y  y     pb,str
0x02 32  0  8  8  8  8 24  0  0 0 0x00--         y  y  y     pb,str
0x03 32  0  8  8  8  8  0  8  0 0 0x00--         y  y  y     pb,str
0x04 32  0  8  8  8  8  0  0  0 0 0x00--         y  y  y     pb,str
0x05 32  0  8  8  8  8 24  8  2 1 0x00--         y  y  y     pb,str
0x06 32  0  8  8  8  8 24  0  2 1 0x00--         y  y  y     pb,str
0x07 32  0  8  8  8  8  0  8  2 1 0x00--         y  y  y     pb,str
0x08 32  0  8  8  8  8  0  0  2 1 0x00--         y  y  y     pb,str
0x09 32  0  8  8  8  8 24  8  4 1 0x00--         y  y  y     pb,str
0x0a 32  0  8  8  8  8 24  8  4 1 0x00--         y  y  y     pb,str
0x0b 32  0  8  8  8  8 24  0  4 1 0x00--         y  y  y     pb,str
0x0c 32  0  8  8  8  8 24  0  4 1 0x00--         y  y  y     pb,str
0x0d 32  0  8  8  8  8  0  8  4 1 0x00--         y  y  y     pb,str
0x0e 32  0  8  8  8  8  0  8  4 1 0x00--         y  y  y     pb,str
0x0f 32  0  8  8  8  8  0  0  4 1 0x00--         y  y  y     pb,str
0x10 32  0  8  8  8  8  0  0  4 1 0x00--         y  y  y     pb,str
0x11 32  0  8  8  8  8 24  8  8 1 0x00--         y  y  y     pb,str
0x12 32  0  8  8  8  8 24  0  8 1 0x00--         y  y  y     pb,str
0x13 32  0  8  8  8  8  0  8  8 1 0x00--         y  y  y     pb,str
0x14 32  0  8  8  8  8  0  0  8 1 0x00--         y  y  y     pb,str
0x15 24  0  8  8  8  0 24  8  0 0 0x00--         y  y  y     pb,str
0x16 24  0  8  8  8  0 24  0  0 0 0x00--         y  y  y     pb,str
0x17 24  0  8  8  8  0  0  8  0 0 0x00--         y  y  y     pb,str
0x18 24  0  8  8  8  0  0  0  0 0 0x00--         y  y  y     pb,str
0x19 24  0  8  8  8  0 24  8  2 1 0x00--         y  y  y     pb,str
0x1a 24  0  8  8  8  0 24  0  2 1 0x00--         y  y  y     pb,str
0x1b 24  0  8  8  8  0  0  8  2 1 0x00--         y  y  y     pb,str
0x1c 24  0  8  8  8  0  0  0  2 1 0x00--         y  y  y     pb,str
0x1d 24  0  8  8  8  0 24  8  4 1 0x00--         y  y  y     pb,str
0x1e 24  0  8  8  8  0 24  8  4 1 0x00--         y  y  y     pb,str
0x1f 24  0  8  8  8  0 24  0  4 1 0x00--         y  y  y     pb,str
0x20 24  0  8  8  8  0 24  0  4 1 0x00--         y  y  y     pb,str
0x21 24  0  8  8  8  0  0  8  4 1 0x00--         y  y  y     pb,str
0x22 24  0  8  8  8  0  0  8  4 1 0x00--         y  y  y     pb,str
0x23 24  0  8  8  8  0  0  0  4 1 0x00--         y  y  y     pb,str
0x24 24  0  8  8  8  0  0  0  4 1 0x00--         y  y  y     pb,str
0x25 24  0  8  8  8  0 24  8  8 1 0x00--         y  y  y     pb,str
0x26 24  0  8  8  8  0 24  0  8 1 0x00--         y  y  y     pb,str
0x27 24  0  8  8  8  0  0  8  8 1 0x00--         y  y  y     pb,str
0x28 24  0  8  8  8  0  0  0  8 1 0x00--         y  y  y     pb,str
0x29 16  0  5  6  5  0 24  8  0 0 0x00--         y  y  y     pb,str
0x2a 16  0  5  6  5  0 24  0  0 0 0x00--         y  y  y     pb,str
0x2b 16  0  5  6  5  0 16  0  0 0 0x00--         y  y  y     pb,str
0x2c 16  0  5  6  5  0  0  8  0 0 0x00--         y  y  y     pb,str
0x2d 16  0  5  6  5  0  0  0  0 0 0x00--         y  y  y     pb,str
0x2e 16  0  5  6  5  0 24  8  2 1 0x00--         y  y  y     pb,str
0x2f 16  0  5  6  5  0 24  0  2 1 0x00--         y  y  y     pb,str
0x30 16  0  5  6  5  0 16  0  2 1 0x00--         y  y  y     pb,str
0x31 16  0  5  6  5  0  0  8  2 1 0x00--         y  y  y     pb,str
0x32 16  0  5  6  5  0  0  0  2 1 0x00--         y  y  y     pb,str
0x33 16  0  5  6  5  0 24  8  4 1 0x00--         y  y  y     pb,str
0x34 16  0  5  6  5  0 24  8  4 1 0x00--         y  y  y     pb,str
0x35 16  0  5  6  5  0 24  0  4 1 0x00--         y  y  y     pb,str
0x36 16  0  5  6  5  0 24  0  4 1 0x00--         y  y  y     pb,str
0x37 16  0  5  6  5  0 16  0  4 1 0x00--         y  y  y     pb,str
0x38 16  0  5  6  5  0 16  0  4 1 0x00--         y  y  y     pb,str
0x39 16  0  5  6  5  0  0  8  4 1 0x00--         y  y  y     pb,str
0x3a 16  0  5  6  5  0  0  8  4 1 0x00--         y  y  y     pb,str
0x3b 16  0  5  6  5  0  0  0  4 1 0x00--         y  y  y     pb,str
0x3c 16  0  5  6  5  0  0  0  4 1 0x00--         y  y  y     pb,str
0x3d 16  0  5  6  5  0 24  8  8 1 0x00--         y  y  y     pb,str
0x3e 16  0  5  6  5  0 24  0  8 1 0x00--         y  y  y     pb,str
0x3f 16  0  5  6  5  0 16  0  8 1 0x00--         y  y  y     pb,str
0x40 16  0  5  6  5  0  0  8  8 1 0x00--         y  y  y     pb,str
0x41 16  0  5  6  5  0  0  0  8 1 0x00--         y  y  y     pb,str

I don't have the glinfo command (I can't seem to find any package providing it either) so I can't test that.

aidanharris avatar Jul 14 '19 21:07 aidanharris

Do you still experience this issue with nouveau?

goddessfreya avatar Jul 14 '19 22:07 goddessfreya

A reboot later and it seems to work fine with Nouveau. The examples run and I know I'm using Nouveau (other than lsmod telling me so) because I managed to cause the Linux kernel to hang which is sadly typical behaviour for Nouveau :(

aidanharris avatar Jul 14 '19 22:07 aidanharris

That's unfortunate. I was hoping this issue would also take place on Nouveau, so that we could rebuild mesa with debug symbols and look into why it was seg faulting.

Since the NVIDIA binary driver does not release it's source, you can't compile it with debug symbols.

Can you use apitrace to trace all the EGL calls w/ the proprietary driver?

goddessfreya avatar Jul 14 '19 23:07 goddessfreya

Other question: do other programs that use EGL also fail, or is this a glutin only thing?

goddessfreya avatar Jul 14 '19 23:07 goddessfreya

I can run weston-simple-egl and eglgears_wayland (from mesa-demos).

~~I've installed apitrace but I'm not sure what I need to do to capture a trace. Running apitrace trace --api egl ./target/debug/examples/window produced a .trace file.~~

Scratch that, the trace file is empty so I don't think it worked.

aidanharris avatar Jul 14 '19 23:07 aidanharris

The trace file should not be empty. Just upload it when you make one successfully. Make sure the glutin examples are not panicing.

goddessfreya avatar Jul 14 '19 23:07 goddessfreya

Here is my EGL trace of running the window example.

window_trace.zip

bertin0 avatar Feb 11 '21 20:02 bertin0

Same issue here, it prevents alacritty from working under Wayland.

System: GTX 760, nvidia 465.27, wlroots-eglstreams + sway.

I ran apitrace trace --api=egl -o window.egl.trace target/debug/examples/window, here's the gzipped output:

window.egl.trace.gz

Does that help? Is there anything else I can provide?

dbrgn avatar May 02 '21 12:05 dbrgn

Comment in https://github.com/danvd/wlroots-eglstreams/issues/15:

Yes, It's a bug of nvidia blob. There are probably some constraints on egl context.

dbrgn avatar May 02 '21 13:05 dbrgn

Remark. eglGetError(), if called just before the subject error is raised, returns the following:

EGL_BAD_NATIVE_WINDOW 0x300B
An EGLNativeWindowType argument does not refer to a valid
native window.

native window is usually created with call to wl_compositor_create_surface followed by wl_egl_window_create. And looks like the latter returns invalid handle (or maybe this handle becomes invalid when eglCreateWindowSurface is executed)

danvd avatar May 11 '21 04:05 danvd

Same issue here.

(My guess is that more and more peeps will have this issue now that the Nvidia-driver supports hardware accelerated xwayland and more people make the switch to Wayland.)

flindeberg avatar Jul 01 '21 12:07 flindeberg

@flindeberg

(My guess is that more and more peeps will have this issue now that the Nvidia-driver supports hardware accelerated xwayland and more people make the switch to Wayland.)

Yeah the support for Wayland and hardware accleration for Xwayland of Nvidia 470 driver seduced me into switching from nouveau to the proprietary driver. But this issue is really a big problem for me. All apps based on winit can't launch, and we can't build Wayland apps with game engines or GUI libraries which use winit.

I wonder if Nvidia proprietary driver never supports glutin for this issue opened in 2019 is still open today? If so, it's too bad.

VitalyAnkh avatar Jul 21 '21 16:07 VitalyAnkh

All major UI libraries do support 470 driver. Among them: GTK3, SDL2, GLFW, KDE. The issue with winit became more important after termite was obsoleted by alacritty.

danvd avatar Jul 24 '21 17:07 danvd

@danvd

All major UI libraries do support 470 driver. Among them: GTK3, SDL2, GLFW, KDE. The issue with winit became more important after termite was obsoleted by alacritty.

In fact winit do support nvidia 470 driver as long as we add a environment variable: WINIT_UNIX_BACKEND=x11, then apps based on winit could run under x11 with nvidia 470 driver. This is a workaround you could try if you just want your apps run with 470 driver. Thus the problem is winit's Wayland backend does not support nvidia 470 driver.

VitalyAnkh avatar Jul 25 '21 03:07 VitalyAnkh

Yes, I meant Wayland support of course. X11 backend works just fine.

danvd avatar Jul 25 '21 03:07 danvd

This seems likely to be caused by NVIDIA/egl-wayland#34.

tchebb avatar Aug 15 '21 07:08 tchebb

This is fixed by https://github.com/NVIDIA/egl-wayland/commit/2eb4628d64a8297fb4c08aa796fdf33ff54a670f. I tested many examples and they worked well!

VitalyAnkh avatar Aug 31 '21 01:08 VitalyAnkh