glDrawVkImageNV crashes from an EGL context in Ubuntu 16.04

Hi,

I experience a crash when trying to use glDrawVkImageNV from an EGL context in Ubuntu 16.04.

The crash does NOT happen when using a GLX context in the same test app, and also does not happen from an EGL context in Ubuntu 20.04, so the issue seems to be with Ubuntu 16.04.

System info:

  • Ubuntu 16.04
  • libvulkan1 1.2.154.1
  • nvidia-driver 495.44 (but it happens also with 465 and 470)
  • GPU Quadro M3000M

This is the backtrace:

#0  0xffffffff3ffffff3 in ?? ()
#1  0x00007fffe2e4e57f in ?? () from /usr/lib/x86_64-linux-gnu/libnvidia-eglcore.so.495.44
#2  0x00007fffe2e5770a in ?? () from /usr/lib/x86_64-linux-gnu/libnvidia-eglcore.so.495.44
#3  0x00007fffe2fcf8b3 in ?? () from /usr/lib/x86_64-linux-gnu/libnvidia-eglcore.so.495.44
#4  0x00007fffe2fcfb20 in ?? () from /usr/lib/x86_64-linux-gnu/libnvidia-eglcore.so.495.44
#5  0x0000000000405b6c in draw_scene (target_texture=1, width=2048, height=2048) at ../vulkan-render-to-texture.cpp:177
#6  0x0000000000404bdc in main (argc=1, argv=0x7fffffffdbb8) at ../display-opengl-texture.cpp:195

The exact version of the binary is:

$ sha1sum /usr/lib/x86_64-linux-gnu/libnvidia-eglcore.so.495.44
e20aad57255425e2be02d591df9f67bad118aa4c  /usr/lib/x86_64-linux-gnu/libnvidia-eglcore.so.495.44

The Vulkan rendering code is based on Vulkan/renderheadless.cpp at master · SaschaWillems/Vulkan · GitHub

This is the apitrace dump before the call to glDrawVkImageNV:

0 eglGetDisplay(display_id = NULL) = 0x1f35ea0
1 eglInitialize(dpy = 0x1f35ea0, major = NULL, minor = NULL) = EGL_TRUE
2 eglBindAPI(api = EGL_OPENGL_API) = EGL_TRUE
3 eglChooseConfig(dpy = 0x1f35ea0, attrib_list = {EGL_SURFACE_TYPE, EGL_PBUFFER_BIT, EGL_BLUE_SIZE, 8, EGL_GREEN_SIZE, 8, EGL_RED_SIZE, 8, EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT, EGL_NONE}, configs = &0xcaf35c, config_size = 1, num_config = &1) = EGL_TRUE
4 eglCreatePbufferSurface(dpy = 0x1f35ea0, config = 0xcaf35c, attrib_list = {EGL_WIDTH, 2048, EGL_HEIGHT, 2048, EGL_NONE}) = 0x1f59b71
5 eglCreateContext(dpy = 0x1f35ea0, config = 0xcaf35c, share_context = NULL, attrib_list = {}) = 0x1f59211
6 eglMakeCurrent(dpy = 0x1f35ea0, draw = NULL, read = NULL, ctx = 0x1f59211) = EGL_TRUE
7 glGetIntegerv(pname = GL_NUM_EXTENSIONS, params = &390)
401 glEnable(cap = GL_DEBUG_OUTPUT)
402 glDebugMessageCallback(callback = 0x405e4d, userParam = NULL)

Buts as said, this is fine on newer systems.

Please let me know if there is interest in investigating the issue on Ubuntu 16.04 or if I should just look into upgrading the system (it’s from work, so it’s not so simple).

I also see that recent official drivers packages are not released for Ubuntu 16.04:
http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/

Thansk,
Antonio