{"record":{"id":"516d9fdee321f107","repo":"Comfy-Org/ComfyUI","slug":"eglchooseconfig-failed","errorCode":null,"errorMessage":"eglChooseConfig() failed","messagePattern":"eglChooseConfig\\(\\) failed","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"comfy_extras/nodes_glsl.py","lineNumber":271,"sourceCode":"        try:\n            self._display, self._egl_major, self._egl_minor = _get_egl_display()\n\n            if not EGL.eglBindAPI(EGL.EGL_OPENGL_ES_API):\n                raise RuntimeError(\"eglBindAPI(EGL_OPENGL_ES_API) failed\")\n\n            config = EGL.EGLConfig()\n            n_configs = ctypes.c_int32(0)\n            if not EGL.eglChooseConfig(\n                self._display,\n                _egl_attribs(\n                    EGL.EGL_RENDERABLE_TYPE, EGL.EGL_OPENGL_ES3_BIT,\n                    EGL.EGL_SURFACE_TYPE, EGL.EGL_PBUFFER_BIT,\n                    EGL.EGL_RED_SIZE, 8, EGL.EGL_GREEN_SIZE, 8,\n                    EGL.EGL_BLUE_SIZE, 8, EGL.EGL_ALPHA_SIZE, 8,\n                ),\n                ctypes.byref(config), 1, ctypes.byref(n_configs),\n            ) or n_configs.value == 0:\n                raise RuntimeError(\"eglChooseConfig() failed\")\n\n            self._surface = EGL.eglCreatePbufferSurface(\n                self._display, config,\n                _egl_attribs(EGL.EGL_WIDTH, 64, EGL.EGL_HEIGHT, 64),\n            )\n            if not self._surface:\n                raise RuntimeError(\"eglCreatePbufferSurface() failed\")\n\n            self._context = EGL.eglCreateContext(\n                self._display, config, EGL.EGL_NO_CONTEXT,\n                _egl_attribs(EGL.EGL_CONTEXT_CLIENT_VERSION, 3),\n            )\n            if not self._context:\n                raise RuntimeError(\"eglCreateContext() failed\")\n\n            if not EGL.eglMakeCurrent(self._display, self._surface, self._surface, self._context):\n                raise RuntimeError(\"eglMakeCurrent() failed\")\n","sourceCodeStart":253,"sourceCodeEnd":289,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_extras/nodes_glsl.py#L253-L289","documentation":"Raised during GLSL renderer initialization when eglChooseConfig returns false or zero configs for the requested attributes: an OpenGL ES 3 renderable, pbuffer-capable config with 8-bit RGBA. The display and API bind succeeded, but no framebuffer configuration on this system matches — usually meaning the driver exposes no ES3-capable surfaceless/pbuffer config (common on bare software rendering setups or incomplete driver installs).","triggerScenarios":"Initializing the GLSL node on a GPU/driver combo that lacks ES3 pbuffer configs (older Intel/NVIDIA drivers, some VM GPUs, llvmpipe without ES3), or where the chosen EGL platform (surfaceless/ANGLE Vulkan fallback) supports fewer configs than a real display would.","commonSituations":"Headless fallback platforms (MESA surfaceless) on drivers that do not list pbuffer ES3 configs there; VMs with 3D acceleration disabled; older Mesa versions predating ES3.2; proprietary driver containers missing vendor ICDs.","solutions":["Update Mesa / GPU drivers to a version advertising ES 3.x configs on the platform in use.","In containers/VMs, enable 3D acceleration or pass through a real GPU so full config sets are exposed.","If a display server is available, set DISPLAY so the default platform (with richer configs) is used instead of the surfaceless fallback.","Diagnose with eglinfo listing configs for the same platform to confirm an ES3 pbuffer config exists."],"exampleFix":"# confirm an ES3 + pbuffer config exists on this host\neglinfo -B | grep -A3 'OpenGL ES'  # need ES3 renderable, pbuffer surface configs\n# docker: prefer a full GPU runtime image or install matching vendor ICDs\napt-get install -y libegl-mesa0 mesa-utils","handlingStrategy":"try-catch","validationCode":"import ctypes\nfrom OpenGL import EGL\n\ndef es3_pbuffer_config_exists() -> bool:\n    d = EGL.eglGetDisplay(EGL.EGL_DEFAULT_DISPLAY)\n    m, n = ctypes.c_int32(0), ctypes.c_int32(0)\n    if not d or not EGL.eglInitialize(d, ctypes.byref(m), ctypes.byref(n)):\n        return False\n    if not EGL.eglBindAPI(EGL.EGL_OPENGL_ES_API):\n        return False\n    cfg = EGL.EGLConfig()\n    cnt = ctypes.c_int32(0)\n    ok = EGL.eglChooseConfig(d, _egl_attribs(\n        EGL.EGL_RENDERABLE_TYPE, EGL.EGL_OPENGL_ES3_BIT,\n        EGL.EGL_SURFACE_TYPE, EGL.EGL_PBUFFER_BIT,\n        EGL.EGL_RED_SIZE, 8, EGL.EGL_GREEN_SIZE, 8,\n        EGL.EGL_BLUE_SIZE, 8, EGL.EGL_ALPHA_SIZE, 8),\n        ctypes.byref(cfg), 1, ctypes.byref(cnt))\n    return bool(ok) and cnt.value > 0","typeGuard":null,"tryCatchPattern":"try:\n    renderer = GlslRenderer()\nexcept RuntimeError as e:\n    if 'eglChooseConfig' in str(e):\n        raise RuntimeError('no ES3 pbuffer EGL config; update Mesa/GPU drivers or enable a real GPU') from e\n    raise","preventionTips":["Use a Mesa/GPU driver version advertising ES3 pbuffer configs (check with eglinfo).","Enable 3D acceleration in VMs; avoid llvmpipe-only images for GLSL nodes.","Prefer platforms with a display (set DISPLAY) since the surfaceless fallback exposes fewer configs."],"tags":["egl","opengl","gles3","driver","environment"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}