I spent some time stepping through this and the problem seems to be in the glXChooseVisual
request that SDL makes here:
(gdb) bt
#0 glXChooseVisual (dpy=0x555556176f00, screen=0, attrib_list=0x7fffffffdbc0)
#1 0x00007ffff7f1259c in X11_GL_GetVisual (_this=0x555556176110, display=0x555556176f00, screen=0) at /home/aaron/git/SDL/src/video/x11/SDL_x11opengl.c:610
#2 0x00007ffff7f11779 in X11_GL_InitExtensions (_this=0x555556176110) at /home/aaron/git/SDL/src/video/x11/SDL_x11opengl.c:346
#3 0x00007ffff7f11425 in X11_GL_LoadLibrary (_this=0x555556176110, path=0x7ffff7f790a2 "libGL.so.1") at /home/aaron/git/SDL/src/video/x11/SDL_x11opengl.c:238
#4 0x00007ffff7e06e34 in SDL_GL_LoadLibrary_REAL (path=0x0) at /home/aaron/git/SDL/src/video/SDL_video.c:3086
#5 0x00007ffff7e019c2 in SDL_CreateWindow_REAL (title=0x7fffffffdf20 "USC-Game", x=805240832, y=805240832, w=1280, h=720, flags=34) at /home/aaron/git/SDL/src/video/SDL_video.c:1500
#6 0x00007ffff7d11917 in SDL_CreateWindow (a=0x7fffffffdf20 "USC-Game", b=805240832, c=805240832, d=1280, e=720, f=34) at /home/aaron/git/SDL/src/dynapi/SDL_dynapi_procs.h:542
#7 0x00005555558bd73f in Graphics::Window_Impl::Window_Impl (this=0x5555561715f0, outer=..., size=..., sampleCount=2 '\002') at ../Graphics/src/Window.cpp:78
#8 0x00005555558bc49d in Graphics::Window::Window (this=0x555556170e90, size=..., samplecount=2 '\002') at ../Graphics/src/Window.cpp:614
#9 0x00005555555957c2 in Application::m_Init (this=0x555556084170) at ../Main/src/Application.cpp:886
#10 0x00005555555916bb in Application::Run (this=0x555556084170) at ../Main/src/Application.cpp:117
#11 0x000055555572b554 in main (argc=1, argv=0x7fffffffe3c8) at ../Main/src/Main.cpp:23
In the attrib list for this particular call, it’s asking for a visual with multisample:
(gdb) x/17wd attrib_list
0x7fffffffdbc0: 4 8 3 9
0x7fffffffdbd0: 3 10 2 11
0x7fffffffdbe0: 8 5 12 16
0x7fffffffdbf0: 13 2 100001 2
0x7fffffffdc00: 0
(that decodes as RGBA, red >= 3, green >= 3, blue >= 2, alpha >= 8, double buffered, depth >= 16, stencil >= 2, samples >= 2)
Unfortunately, when running in render offload mode the NVIDIA GLX driver has to piggyback off of the X11 visuals provided by the host X screen because it’s not able to inject its own into a foreign X screen’s visual list. In order to make that more likely to work, the NVIDIA driver creates many GLXFBConfigs that share a single GLXVisual in order to minimize the number of visuals required from the host screen. In this particular case, the GLXFBConfigs with multisample share visuals with the one without multisample, and the one without are the ones presented via the legacy GLX 1.2 glXChooseVisuals
function.
In order to make this code more reliable, SDL should be using the GLX 1.3 glXChooseFBConfig
function when available.