Skip to content

fix(sdl): limit NVIDIA Wayland workaround to drivers below 600 - #751

Open
teamnotus wants to merge 2 commits into
CleanroomMC:mainfrom
teamnotus:fix/sdl-nvidia-workaround-version-gate
Open

teamnotus wants to merge 2 commits into
CleanroomMC:mainfrom
teamnotus:fix/sdl-nvidia-workaround-version-gate

Conversation

@teamnotus

@teamnotus teamnotus commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #732.

That fix set __GL_THREADED_OPTIMIZATIONS=0 for every NVIDIA driver on Wayland with PRIME
offload. As discussed, the failure is limited to the legacy branch (570.x/580.x, reportedly
582.x); 620.x was reported unaffected, but 595.x has a reported case, so this uses a
conservative < 600 heuristic instead of applying it globally.

  • Read the version from /sys/module/nvidia/version, falling back to /proc/driver/nvidia/version.
  • Parse the numeric major and skip the workaround at 600 and above.
  • If the version cannot be read, keep the workaround: failing open only disables an
    optimization, while failing closed restores the EGL_BAD_DISPLAY crash.

The Linux/Wayland/PRIME conditions and the -Dcleanroom.sdl.nvidiaWaylandWorkaround=false
opt-out are unchanged. Tested on 580.178.04 + GTX 1050 + PRIME offload on Wayland; the
workaround still applies and the client starts normally.

@tttsaurus

tttsaurus commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

I'm on 595.71.05 and also had the exact same issue once.

But I'm only able to replicate the EGL_BAD_DISPLAY crash by manually calling SDLHints.SDL_SetHintWithPriority(SDLHints.SDL_HINT_VIDEO_DRIVER, "wayland,x11", SDLHints.SDL_HINT_DEFAULT) to force Wayland. No crash for XWayland. Env: 4060 Laptop. Hope this information helps.

@teamnotus

Copy link
Copy Markdown
Contributor Author

Going to update this: bump the cutoff to < 600 given the 595 report above, try /sys/module/nvidia/version then /proc/driver/nvidia/version, and keep applying the workaround if the major can't be parsed. I'll update the title/body to match.

Address review feedback: try /proc/driver/nvidia/version as a fallback
for /sys/module/nvidia/version, keep the fail-safe when no major can be
parsed, and raise the heuristic cutoff to < 600 given the 595.x report.
@teamnotus teamnotus changed the title fix(sdl): limit NVIDIA Wayland workaround to drivers below 590 fix(sdl): limit NVIDIA Wayland workaround to drivers below 600 Nov 23, 2026
@teamnotus
teamnotus requested a review from Ecdcaeb November 23, 2026 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants