wasabeef/android-gpuimage · critical · RuntimeException
eglGetDisplay failed
Error message
eglGetDisplay failed
What it means
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.
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
Defensive patterns
Strategy: try-catch
Validate before calling
EGLDisplay d = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
if (d == EGL10.EGL_NO_DISPLAY) { Log.e(TAG, "no EGL display, err=" + egl.eglGetError()); } Try / catch
// catch (RuntimeException e) { show 'GPU unsupported' UI; disable GPU-accelerated path } Prevention
- Verify GPU acceleration before enabling GL rendering
- Handle process-wide EGL poisoning by restarting the process
- Test on emulators without host GPU
When it happens
Trigger: 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.
Common situations: Emulators without GPU support and with broken software EGL, headless/odd devices, driver crashes after prior EGL failures in the same process.
Related errors
- eglInitialize failed
- eglDisplay not initialized
- eglChooseConfig failed
- No configs match configSpec
- eglChooseConfig#2 failed
AI-assisted analysis of wasabeef/android-gpuimage@ceea576ec9 (2026-09-11).
Data as JSON: /api/errors/08bbe25ba7a72fa0.
Report an issue: GitHub.
Appendix: source
Thrown at library/src/main/java/jp/co/cyberagent/android/gpuimage/GLTextureView.java:913
/**
* Initialize EGL for a given configuration spec.
*/
public void start() {
if (LOG_EGL) {
Log.w("EglHelper", "start() tid=" + Thread.currentThread().getId());
}
/*
* Get an EGL instance
*/
egl = (EGL10) EGLContext.getEGL();
/*
* Get to the default display.
*/
eglDisplay = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
if (eglDisplay == EGL10.EGL_NO_DISPLAY) {
throw new RuntimeException("eglGetDisplay failed");
}
/*
* We can now initialize EGL for that display
*/
int[] version = new int[2];
if (!egl.eglInitialize(eglDisplay, version)) {
throw new RuntimeException("eglInitialize failed");
}
GLTextureView view = glTextureViewWeakRef.get();
if (view == null) {
eglConfig = null;
eglContext = null;
} else {
eglConfig = view.eglConfigChooser.chooseConfig(egl, eglDisplay);
/*
* Create an EGL context. We want to do this as rarely as we can, because anView on GitHub (pinned to ceea576ec9)