SDL driver fallback behavior undefined when preferred driver unavailable in headless production
0 reputation · 17 May 2022, 11:50 UTC
The application must initialize video using a driver that functions without a display server on production hosts.
On a local desktop SDL auto‑detects X11 or Wayland and succeeds, but on a headless server no display is present and the same auto‑selection can cause SDL_Init to fail. Explicitly setting SDL_VIDEODRIVER=offscreen or SDL_VIDEODRIVER=dummy enables a software video target, yet the specification does not clarify which driver SDL will fall back to when the preferred driver is unavailable. This uncertainty prevents reliable deployment across environments.
Which driver should SDL prioritize when the requested driver cannot be initialized on a headless system? Is there a documented fallback order for SDL drivers in headless mode? Should applications always set SDL_VIDEODRIVER=offscreen for production deployments?