dotnet/maui · critical · EntryPointNotFoundException

Glx entry point not found!

Error message

Glx entry point not found!

What it means

XWindowInfoInitializer.GetVisualInfo calls glXChooseVisual via P/Invoke. If the GL library loads but does not export glXChooseVisual (the GLX extension entry point is missing — e.g. an EGL-only or stub GL stack), an EntryPointNotFoundException is raised, caught, and re-thrown as 'Glx entry point not found!' wrapping the original.

Source

Thrown at src/Compatibility/Core/src/GTK/Controls/GLWidget/X11/XWindowInfoInitializer.cs:77

		private static IntPtr XGetVisualInfo(IntPtr display, XVisualInfoMask infoMask, ref XVisualInfo template, out int nitems)
		{
			return XGetVisualInfoInternal(display, (IntPtr)(int)infoMask, ref template, out nitems);
		}

		private static IntPtr GetVisualInfo(GraphicsMode mode, IntPtr display, int screenNumber)
		{
			try
			{
				int[] attributes = CreateAttributeList(mode).ToArray();
				return glXChooseVisual(display, screenNumber, attributes);
			}
			catch (DllNotFoundException e)
			{
				throw new DllNotFoundException("OpenGL dll not found!", e);
			}
			catch (EntryPointNotFoundException enf)
			{
				throw new EntryPointNotFoundException("Glx entry point not found!", enf);
			}
		}

		private static List<int> CreateAttributeList(GraphicsMode mode)
		{
			List<int> attributeList = new List<int>(24);

			attributeList.Add((int)GLXAttribute.RGBA);

			if (mode.Buffers > 1)
			{
				attributeList.Add((int)GLXAttribute.DOUBLEBUFFER);
			}

			if (mode.Stereo)
			{
				attributeList.Add((int)GLXAttribute.STEREO);
			}

View on GitHub (pinned to f377ff1c5e)

Solutions

  1. Install a full Mesa GLX implementation: `apt-get install libglx-mesa0 libgl1` (or distro equivalent).
  2. If on NVIDIA, ensure the GLX module is loaded (libGLX_nvidia.so) and not stubbed.
  3. Confirm GLX with `glxinfo` — it must list GLX visuals; if glxinfo fails on glX entry points, the stack is EGL-only.
  4. Fall back to a software Mesa renderer or EGL-based GLWidget path if GLX is unavailable.

Example fix

# before — EGL-only / stub GL stack
# (control throws 'Glx entry point not found!')
# after — install full Mesa GLX
sudo apt-get install -y libglx-mesa0 libgl1 mesa-utils
glxinfo | grep -i GLX   # confirm GLX visuals present
Defensive patterns

Strategy: try-catch

Validate before calling

static bool HasGlx()
{
    try
    {
        if (!System.Runtime.InteropServices.NativeLibrary.TryLoad("libGL.so.1", out IntPtr h)) return false;
        var addr = System.Runtime.InteropServices.NativeLibrary.GetExport(h, "glXChooseVisual");
        return addr != IntPtr.Zero;
    }
    catch { return false; }
}

Try / catch

try { /* construct GLWidget */ }
catch (EntryPointNotFoundException ex) when (ex.Message.Contains("Glx"))
{ /* install libglx-mesa0; fall back to software/EGL renderer */ }

Prevention

When it happens

Trigger: An OpenGL library is present but it lacks the GLX 1.x entry points (no glXChooseVisual). Occurs with EGL-only stacks, NVIDIA proprietary drivers in certain configs, or GL libraries that don't implement GLX.

Common situations: Systems where libGL.so is a stub or EGL-only (some embedded/SBC stacks, certain container images); driver mismatch where the loaded GL library is not the Mesa GLX implementation; running under a headless EGL context without GLX support.

Related errors


AI-assisted analysis of dotnet/maui@f377ff1c5e (2026-08-13). Data as JSON: /api/errors/d1474230f3d6784b. Report an issue: GitHub.