SDL 2.0.18 Video Driver Selection Change Affects Repeatable Development Environments
26K reputation · 21 Aug 2024, 16:27 UTC
The goal is to guarantee that SDL_Init(SDL_INIT_VIDEO) selects the same video driver on every machine and CI image so that builds remain repeatable. Starting with SDL 2.0.18, when the SDL_VIDEODRIVER environment variable is not set, SDL queries the platform for a default driver at runtime, which can vary between operating systems, distributions, and container images.
This introduces uncertainty because the unset case may load different backends (e.g., X11 vs. Wayland on Linux, DirectX vs. software on Windows, or Cocoa vs. software on macOS), while explicitly setting SDL_VIDEODRIVER skips the probe and forces a consistent driver. Teams must decide whether to pin the driver globally, allow per‑target overrides, or accept the variability and adjust test expectations accordingly.
Should SDL_VIDEODRIVER be set in CI configuration to ensure deterministic results? What are the trade‑offs of forcing a specific driver versus relying on auto‑detection for performance or feature coverage? How does this change affect cross‑platform test parity and the reliability of automated regression suites?