Skip to content

X11 desktop host aborts the process on glXCreateNewContext failure instead of falling back #23338

Closed

Description

@ajpinedam

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):

  1. No graceful fallback. A fatal BadValue from X_GLXCreateNewContext aborts the whole process. The host should trap the GLX failure and fall back to Software (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.)
  2. A null FBConfig is passed to glXCreateNewContext. Value in failed request: 0x0 indicates a null/0 GLX FBConfig was handed to context creation — i.e. glXChooseFBConfig likely 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

  1. dotnet new unoapp (Uno.Sdk 6.7.0-dev.62), default Platforms/Desktop/Program.cs:
    var host = UnoPlatformHostBuilder.Create()
        .App(() => new App())
        .UseX11()
        .UseLinuxFrameBuffer()
        .UseMacOS()
        .UseWin32()
        .Build();
    host.Run();
  2. dotnet run -f net10.0-desktop on the machine described below.
  3. App crashes immediately with the GLX BadValue error 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 .Software

Environment

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

  1. github-actions commented on Nov 9, 2026

    @github-actions
    Contributor

    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.

  2. added
    stale
    on Nov 9, 2026
  3. added a commit that references this issue on Nov 10, 2026
    231f13a
  4. removed
    stale
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions