{"record":{"id":"893ee773cb0b82c2","repo":"Comfy-Org/ComfyUI","slug":"eglcreatecontext-failed","errorCode":null,"errorMessage":"eglCreateContext() failed","messagePattern":"eglCreateContext\\(\\) failed","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"comfy_extras/nodes_glsl.py","lineNumber":285,"sourceCode":"                    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\n            self._vao = gl.glGenVertexArrays(1)\n            gl.glBindVertexArray(self._vao)\n\n        except Exception:\n            self._cleanup()\n            raise\n\n        elapsed = (time.perf_counter() - start) * 1000\n\n        renderer = _gl_str(gl.GL_RENDERER)\n        vendor = _gl_str(gl.GL_VENDOR)\n        version = _gl_str(gl.GL_VERSION)\n\n        GLContext._initialized = True","sourceCodeStart":267,"sourceCodeEnd":303,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_extras/nodes_glsl.py#L267-L303","documentation":"Raised during GLContext initialization when eglCreateContext() with EGL_CONTEXT_CLIENT_VERSION=3 returns EGL_NO_CONTEXT. The display and pbuffer surface were created fine, but the driver refused to create a GLES 3.x context on the chosen config. The GLSL nodes require OpenGL ES 3.0 (MRT rendering to RGBA32F textures), so a GLES2-only stack fails here.","triggerScenarios":"eglChooseConfig matched a config whose RENDERABLE_TYPE bits allow ES3 but the driver cannot create a version-3 context (driver bug or mismatched vendor); EGL 1.4-only implementations without proper ES3 support; containers with only libgles2 (GLES2) installed while libgles3 is missing.","commonSituations":"Minimal Docker images that install libgles2 but not libgles3; older embedded/ARM drivers advertising ES3 configs but lacking a working ES3 runtime; mixing Mesa EGL with proprietary GL libraries.","solutions":["Install the GLES3 runtime: apt install libgles3-mesa libegl-mesa0 (or distro equivalent) inside the container/host.","Confirm ES3 support with eglinfo / es2_info: look for 'OpenGL ES 3.x' in the client APIs string.","Update the GPU driver to a version with working EGL + GLES3 (especially NVIDIA >= 470 and recent Mesa).","As a last resort on machines without GLES3, use non-GLSL image-manipulation nodes."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Before using GLSL nodes, confirm ES3 context creation is possible:\n# eglinfo -B should list \"OpenGL ES 3.x\" under client APIs / supported contexts.\nimport subprocess, sys\nr = subprocess.run([\"eglinfo\", \"-B\"], capture_output=True, text=True)\nif \"OpenGL ES 3\" not in (r.stdout + r.stderr):\n    print(\"Warning: GLES3 not available; GLSL nodes will fail at eglCreateContext\")","typeGuard":null,"tryCatchPattern":"try:\n    out = glsl_render_node(...)\nexcept RuntimeError as e:\n    if \"eglCreateContext\" in str(e):\n        # fall back to a torch-based equivalent effect node\n        out = torch_fallback_effect(...)\n    else:\n        raise","preventionTips":["Install libgles3 alongside libgles2 in deployment images.","Check eglinfo output for ES3 support during environment bring-up.","Pin recent GPU drivers known to expose ES3 via EGL."],"tags":["egl","opengl","gles3","driver","glsl"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}