Repository navigation
Description
X11 desktop host aborts the process on glXCreateNewContext failure instead of falling back
Current behavior
On a default net10.0-desktop Uno app, the Skia X11 host (X11RenderingBackend.Default) creates a hardware OpenGL context via GLX at startup. On this machine that glXCreateNewContext call fails, and instead of falling back to another renderer the process is killed by Xlib's default error handler with a raw X protocol error:
X Error of failed request: BadValue (integer parameter out of range for operation)
Major opcode of failed request: 152 (GLX)
Minor opcode of failed request: 24 (X_GLXCreateNewContext)
Value in failed request: 0x0
Serial number of failed request: 31
Current serial number in output stream: 32
There is no managed exception to catch — the app just dies on first launch.
Two things look wrong on the Uno side (independent of the underlying driver quirk):
- No graceful fallback. A fatal
BadValuefromX_GLXCreateNewContextaborts the whole process. The host should trap the GLX failure and fall back toSoftware(or another working backend) rather than letting Xlib terminate the app. (cf. Support Software Rendering for X11 by allowing to disable GLX fyne-io/fyne#4782, which added exactly this kind of GLX-disable/software fallback.) - A null FBConfig is passed to
glXCreateNewContext.Value in failed request: 0x0indicates a null/0 GLX FBConfig was handed to context creation — i.e.glXChooseFBConfiglikely returned no match and the code proceeded anyway instead of bailing out. A guard for "no matching FBConfig" seems to be missing.
Expected behavior
The default desktop host should start successfully (falling back to software/Vulkan rendering if hardware GLX context creation fails), instead of aborting with a raw Xlib error on first run.
How to reproduce
dotnet new unoapp(Uno.Sdk 6.7.0-dev.62), defaultPlatforms/Desktop/Program.cs:var host = UnoPlatformHostBuilder.Create() .App(() => new App()) .UseX11() .UseLinuxFrameBuffer() .UseMacOS() .UseWin32() .Build(); host.Run();
dotnet run -f net10.0-desktopon the machine described below.- App crashes immediately with the GLX
BadValueerror above.
Backend test matrix
Tested by explicitly setting .UseX11(x11 => x11.RenderingBackend(...)) on the same machine:
X11RenderingBackend |
Result |
|---|---|
Default |
❌ crash — X_GLXCreateNewContext BadValue |
OpenGL |
❌ crash — same error |
OpenGLES |
❌ crash — same error (also routes through GLX context creation) |
Vulkan |
✅ launches, GPU-accelerated |
Software |
✅ launches |
So the box is fully capable of running the app — only the GLX/OpenGL context-creation path is broken, and it takes the process down with it.
Workaround
Force a non-GLX backend in Program.cs:
.UseX11(x11 => x11.RenderingBackend(X11RenderingBackend.Vulkan)) // or .SoftwareEnvironment
| OS | Ubuntu 24.04.3 LTS |
| Session | Xorg, DISPLAY=:1 (X11, not Wayland) |
| GPU | NVIDIA GeForce RTX 2070 SUPER (TU104) |
| NVIDIA driver | 580.126.09 |
| GLX libraries present | libGLX_nvidia.so.0 and libGLX_mesa.so.0 (GLVND) |
| .NET SDK | 10.0.201 |
| Uno.Sdk | 6.7.0-dev.62 (runtime packages 6.7.0-dev.211) |
| Target | net10.0-desktop |
Notes
The generic "GLX BadValue on NVIDIA" failure shows up across many toolkits (SDL, Godot, Open3D, etc.), so the driver-level cause may not be Uno's to fix. The actionable Uno-side issues are the missing fallback (#1) and the null-FBConfig guard (#2) — a first-run hard crash is a poor out-of-box experience on an otherwise capable machine.
Activity
github-actions commentedon Nov 9, 2026
This issue has had no activity for 120 days. It will be closed in 10 days if there is no further activity. Remove the Stale label or leave a comment to keep it open.
fix(x11): Decline a GLX context the X server rejected