{"record":{"id":"d1474230f3d6784b","repo":"dotnet/maui","slug":"glx-entry-point-not-found","errorCode":null,"errorMessage":"Glx entry point not found!","messagePattern":"Glx entry point not found!","errorType":"exception","errorClass":"EntryPointNotFoundException","httpStatus":null,"severity":"critical","filePath":"src/Compatibility/Core/src/GTK/Controls/GLWidget/X11/XWindowInfoInitializer.cs","lineNumber":77,"sourceCode":"\t\tprivate static IntPtr XGetVisualInfo(IntPtr display, XVisualInfoMask infoMask, ref XVisualInfo template, out int nitems)\n\t\t{\n\t\t\treturn XGetVisualInfoInternal(display, (IntPtr)(int)infoMask, ref template, out nitems);\n\t\t}\n\n\t\tprivate static IntPtr GetVisualInfo(GraphicsMode mode, IntPtr display, int screenNumber)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tint[] attributes = CreateAttributeList(mode).ToArray();\n\t\t\t\treturn glXChooseVisual(display, screenNumber, attributes);\n\t\t\t}\n\t\t\tcatch (DllNotFoundException e)\n\t\t\t{\n\t\t\t\tthrow new DllNotFoundException(\"OpenGL dll not found!\", e);\n\t\t\t}\n\t\t\tcatch (EntryPointNotFoundException enf)\n\t\t\t{\n\t\t\t\tthrow new EntryPointNotFoundException(\"Glx entry point not found!\", enf);\n\t\t\t}\n\t\t}\n\n\t\tprivate static List<int> CreateAttributeList(GraphicsMode mode)\n\t\t{\n\t\t\tList<int> attributeList = new List<int>(24);\n\n\t\t\tattributeList.Add((int)GLXAttribute.RGBA);\n\n\t\t\tif (mode.Buffers > 1)\n\t\t\t{\n\t\t\t\tattributeList.Add((int)GLXAttribute.DOUBLEBUFFER);\n\t\t\t}\n\n\t\t\tif (mode.Stereo)\n\t\t\t{\n\t\t\t\tattributeList.Add((int)GLXAttribute.STEREO);\n\t\t\t}","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/dotnet/maui/blob/f377ff1c5ee04d334d8a925f50c83a6b7afddf03/src/Compatibility/Core/src/GTK/Controls/GLWidget/X11/XWindowInfoInitializer.cs#L59-L95","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Install a full Mesa GLX implementation: `apt-get install libglx-mesa0 libgl1` (or distro equivalent).","If on NVIDIA, ensure the GLX module is loaded (libGLX_nvidia.so) and not stubbed.","Confirm GLX with `glxinfo` — it must list GLX visuals; if glxinfo fails on glX entry points, the stack is EGL-only.","Fall back to a software Mesa renderer or EGL-based GLWidget path if GLX is unavailable."],"exampleFix":"# before — EGL-only / stub GL stack\n# (control throws 'Glx entry point not found!')\n# after — install full Mesa GLX\nsudo apt-get install -y libglx-mesa0 libgl1 mesa-utils\nglxinfo | grep -i GLX   # confirm GLX visuals present","handlingStrategy":"try-catch","validationCode":"static bool HasGlx()\n{\n    try\n    {\n        if (!System.Runtime.InteropServices.NativeLibrary.TryLoad(\"libGL.so.1\", out IntPtr h)) return false;\n        var addr = System.Runtime.InteropServices.NativeLibrary.GetExport(h, \"glXChooseVisual\");\n        return addr != IntPtr.Zero;\n    }\n    catch { return false; }\n}","typeGuard":null,"tryCatchPattern":"try { /* construct GLWidget */ }\ncatch (EntryPointNotFoundException ex) when (ex.Message.Contains(\"Glx\"))\n{ /* install libglx-mesa0; fall back to software/EGL renderer */ }","preventionTips":["Install a full Mesa GLX stack (libglx-mesa0, libgl1).","Confirm `glxinfo` lists GLX visuals before enabling GL surfaces.","Avoid EGL-only/stub GL libraries in deployment images.","Provide a software-renderer fallback when GLX is unavailable."],"tags":["gtk","opengl","x11","glx","native-library","linux","glwidget","maui-compat"],"backgroundTag":null,"analyzedSha":"f377ff1c5ee04d334d8a925f50c83a6b7afddf03","analyzedAt":"2026-08-13T14:26:18.069Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}