{"record":{"id":"08bbe25ba7a72fa0","repo":"wasabeef/android-gpuimage","slug":"eglgetdisplay-failed","errorCode":null,"errorMessage":"eglGetDisplay failed","messagePattern":"eglGetDisplay failed","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"critical","filePath":"library/src/main/java/jp/co/cyberagent/android/gpuimage/GLTextureView.java","lineNumber":913,"sourceCode":"        /**\n         * Initialize EGL for a given configuration spec.\n         */\n        public void start() {\n            if (LOG_EGL) {\n                Log.w(\"EglHelper\", \"start() tid=\" + Thread.currentThread().getId());\n            }\n            /*\n             * 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","sourceCodeStart":895,"sourceCodeEnd":931,"githubUrl":"https://github.com/wasabeef/android-gpuimage/blob/ceea576ec931c2968431ad46f1fb2e6d68a542e2/library/src/main/java/jp/co/cyberagent/android/gpuimage/GLTextureView.java#L895-L931","documentation":"EglHelper.start() called eglGetDisplay(EGL_DEFAULT_DISPLAY) and got back EGL_NO_DISPLAY, so no EGL display connection could be established. This is thrown as RuntimeException because rendering cannot proceed at all without a display handle.","triggerScenarios":"egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY) returns EGL_NO_DISPLAY — typically on devices/emulators with no functioning EGL implementation, or EGL already torn down in the process.","commonSituations":"Emulators without GPU support and with broken software EGL, headless/odd devices, driver crashes after prior EGL failures in the same process.","solutions":["Enable hardware GPU acceleration on the emulator or run on a physical device","Restart the app/process if a previous EGL failure poisoned the display state","Log egl.eglGetError() right after eglGetDisplay for the concrete code","Confirm android:hardwareAccelerated and a real GPU render path are available"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"EGLDisplay d = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);\nif (d == EGL10.EGL_NO_DISPLAY) { Log.e(TAG, \"no EGL display, err=\" + egl.eglGetError()); }","typeGuard":null,"tryCatchPattern":"// catch (RuntimeException e) { show 'GPU unsupported' UI; disable GPU-accelerated path }","preventionTips":["Verify GPU acceleration before enabling GL rendering","Handle process-wide EGL poisoning by restarting the process","Test on emulators without host GPU"],"tags":["egl","android","opengl","display-init","emulator"],"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"}