{"record":{"id":"c160f8b39b8fa421","repo":"wasabeef/android-gpuimage","slug":"eglinitialize-failed","errorCode":null,"errorMessage":"eglInitialize failed","messagePattern":"eglInitialize failed","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"critical","filePath":"library/src/main/java/jp/co/cyberagent/android/gpuimage/GLTextureView.java","lineNumber":921,"sourceCode":"             * Get an EGL instance\n             */\n            egl = (EGL10) EGLContext.getEGL();\n\n            /*\n             * Get to the default display.\n             */\n            eglDisplay = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);\n\n            if (eglDisplay == EGL10.EGL_NO_DISPLAY) {\n                throw new RuntimeException(\"eglGetDisplay failed\");\n            }\n\n            /*\n             * We can now initialize EGL for that display\n             */\n            int[] version = new int[2];\n            if (!egl.eglInitialize(eglDisplay, version)) {\n                throw new RuntimeException(\"eglInitialize failed\");\n            }\n            GLTextureView view = glTextureViewWeakRef.get();\n            if (view == null) {\n                eglConfig = null;\n                eglContext = null;\n            } else {\n                eglConfig = view.eglConfigChooser.chooseConfig(egl, eglDisplay);\n\n                /*\n                 * Create an EGL context. We want to do this as rarely as we can, because an\n                 * EGL context is a somewhat heavy object.\n                 */\n                eglContext = view.eglContextFactory.createContext(egl, eglDisplay, eglConfig);\n            }\n            if (eglContext == null || eglContext == EGL10.EGL_NO_CONTEXT) {\n                eglContext = null;\n                throwEglException(\"createContext\");\n            }","sourceCodeStart":903,"sourceCodeEnd":939,"githubUrl":"https://github.com/wasabeef/android-gpuimage/blob/ceea576ec931c2968431ad46f1fb2e6d68a542e2/library/src/main/java/jp/co/cyberagent/android/gpuimage/GLTextureView.java#L903-L939","documentation":"eglInitialize(eglDisplay, version) returned EGL_FALSE, meaning the display handle exists but EGL could not be initialized for it. EglHelper throws RuntimeException since no context/surface creation can follow.","triggerScenarios":"eglInitialize fails with the default display handle — usually an uninitialized/invalid driver, incompatible EGL version, or display state corrupted after earlier failures in the same process.","commonSituations":"Broken graphics drivers on some Android devices, emulators with mismatched host-GPU drivers, calling start() on a thread after the process EGL state was torn down.","solutions":["Check egl.eglGetError() (e.g. EGL_BAD_DISPLAY, EGL_NOT_INITIALIZED) for the root cause","Retry after full EGL teardown (eglTerminate in a fresh process restart)","Update GPUImage / switch rendering to GLSurfaceView which handles EGL differently","Test on a physical device or a properly GPU-accelerated emulator"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// catch (RuntimeException e) { read eglGetError(); restart render thread; degrade to non-GL rendering }","preventionTips":["Initialize EGL once per process where possible","Update drivers via OS updates; avoid broken emulator images","Isolate EGL init failures so they don't poison later attempts"],"tags":["egl","android","opengl","display-init","driver"],"backgroundTag":"module-init-failed","analyzedSha":"ceea576ec931c2968431ad46f1fb2e6d68a542e2","analyzedAt":"2026-09-11T16:56:13.742Z","contentChangedAt":"2026-09-11T16:56:13.742Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}