wgpu: [GL] Unable to create GLES 3.x context on Android
Description Unable to create GLES 3.x context on Android device.
2021-06-30 22:17:11.584 16981-16981/rust.example.cube V/ndk_glue: WindowCreated
2021-06-30 22:17:11.584 16981-17057/rust.example.cube I/cube::framework: NativeScreen Found:Some(NativeWindow { ptr: 0x76f6467010 })
2021-06-30 22:17:11.584 16981-17057/rust.example.cube I/cube::framework: Initializing the surface...
2021-06-30 22:17:11.586 16981-16981/rust.example.cube V/ndk_glue: WindowResized
2021-06-30 22:17:11.594 16981-17057/rust.example.cube D/wgpu_hal::gles::egl: Client extensions: []
2021-06-30 22:17:11.594 16981-17057/rust.example.cube I/wgpu_hal::gles::egl: Using default platform
2021-06-30 22:17:11.596 16981-16981/rust.example.cube V/ndk_glue: ContentRectChanged
2021-06-30 22:17:11.615 16981-17057/rust.example.cube I/wgpu_hal::gles::egl: Display vendor "Android", version (1, 4)
2021-06-30 22:17:11.615 16981-17057/rust.example.cube D/wgpu_hal::gles::egl: Display extensions: [
"EGL_KHR_get_all_proc_addresses",
"EGL_ANDROID_presentation_time",
"EGL_KHR_swap_buffers_with_damage",
"EGL_ANDROID_get_native_client_buffer",
"EGL_ANDROID_front_buffer_auto_refresh",
"EGL_ANDROID_get_frame_timestamps",
"EGL_KHR_image",
"EGL_KHR_image_base",
"EGL_KHR_gl_colorspace",
"EGL_KHR_gl_texture_2D_image",
"EGL_KHR_gl_texture_cubemap_image",
"EGL_KHR_gl_renderbuffer_image",
"EGL_KHR_fence_sync",
"EGL_KHR_create_context",
"EGL_KHR_config_attribs",
"EGL_KHR_surfaceless_context",
"EGL_EXT_create_context_robustness",
"EGL_ANDROID_image_native_buffer",
"EGL_KHR_wait_sync",
"EGL_ANDROID_recordable",
"EGL_KHR_partial_update",
"EGL_KHR_mutable_render_buffer",
"EGL_EXT_protected_content",
"EGL_IMG_context_priority",
]
2021-06-30 22:17:11.616 16981-17057/rust.example.cube V/wgpu_hal::gles::egl: Configurations:
2021-06-30 22:17:11.616 16981-17057/rust.example.cube V/wgpu_hal::gles::egl: CONFORMANT=0x45, RENDERABLE=0x45, NATIVE_RENDERABLE=0x0, SURFACE_TYPE=0x1405
2021-06-30 22:17:11.616 16981-17057/rust.example.cube I/chatty: uid=10225(u0_a225) rust.example.cube identical 1 line
2021-06-30 22:17:11.616 16981-17057/rust.example.cube V/wgpu_hal::gles::egl: CONFORMANT=0x45, RENDERABLE=0x45, NATIVE_RENDERABLE=0x0, SURFACE_TYPE=0x1405
2021-06-30 22:17:11.616 16981-17057/rust.example.cube V/wgpu_hal::gles::egl: CONFORMANT=0x45, RENDERABLE=0x45, NATIVE_RENDERABLE=0x0, SURFACE_TYPE=0x405
2021-06-30 22:17:11.616 16981-17057/rust.example.cube V/wgpu_hal::gles::egl: CONFORMANT=0x45, RENDERABLE=0x45, NATIVE_RENDERABLE=0x0, SURFACE_TYPE=0x1405
2021-06-30 22:17:11.616 16981-17057/rust.example.cube I/chatty: uid=10225(u0_a225) rust.example.cube identical 1 line
2021-06-30 22:17:11.616 16981-17057/rust.example.cube V/wgpu_hal::gles::egl: CONFORMANT=0x45, RENDERABLE=0x45, NATIVE_RENDERABLE=0x0, SURFACE_TYPE=0x1405
2021-06-30 22:17:11.616 16981-17057/rust.example.cube V/wgpu_hal::gles::egl: CONFORMANT=0x45, RENDERABLE=0x45, NATIVE_RENDERABLE=0x0, SURFACE_TYPE=0x405
2021-06-30 22:17:11.616 16981-17057/rust.example.cube V/wgpu_hal::gles::egl: CONFORMANT=0x45, RENDERABLE=0x45, NATIVE_RENDERABLE=0x0, SURFACE_TYPE=0x1405
2021-06-30 22:17:11.616 16981-17057/rust.example.cube V/wgpu_hal::gles::egl: CONFORMANT=0x45, RENDERABLE=0x45, NATIVE_RENDERABLE=0x0, SURFACE_TYPE=0x1405
2021-06-30 22:17:11.616 16981-17057/rust.example.cube V/wgpu_hal::gles::egl: CONFORMANT=0x45, RENDERABLE=0x45, NATIVE_RENDERABLE=0x0, SURFACE_TYPE=0x405
2021-06-30 22:17:11.616 16981-17057/rust.example.cube V/wgpu_hal::gles::egl: CONFORMANT=0x45, RENDERABLE=0x45, NATIVE_RENDERABLE=0x0, SURFACE_TYPE=0x1
2021-06-30 22:17:11.616 16981-17057/rust.example.cube I/chatty: uid=10225(u0_a225) rust.example.cube identical 2 lines
2021-06-30 22:17:11.616 16981-17057/rust.example.cube V/wgpu_hal::gles::egl: CONFORMANT=0x45, RENDERABLE=0x45, NATIVE_RENDERABLE=0x0, SURFACE_TYPE=0x1
2021-06-30 22:17:11.616 16981-17057/rust.example.cube I/wgpu_hal::gles::egl: Trying presentation
2021-06-30 22:17:11.617 16981-17057/rust.example.cube I/wgpu_hal::gles::egl: EGL context: +robust access
2021-06-30 22:17:11.617 16981-17057/rust.example.cube W/wgpu_hal::gles::egl: unable to create GLES 3.x context: BadAttribute
2021-06-30 22:17:11.619 16981-17056/rust.example.cube I/RustStdoutStderr: thread '<unnamed>' panicked at 'No suitable GPU adapters found on the system!', wgpu/examples/cube/../framework.rs:138:10
Platform Android 8.0.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 21 (15 by maintainers)
Commits related to this issue
- Merge #1584 1584: Update testing limits for rpi4 r=kvark a=cwfitzgerald **Connections** Related to #1574. Exposed #1583. **Description** Changes the reftesting limits to be tolerant of how ... — committed to gfx-rs/wgpu by bors[bot] 3 years ago
- Merge #1584 1584: Update testing limits for rpi4 r=kvark a=cwfitzgerald **Connections** Related to #1574. Exposed #1583. **Description** Changes the reftesting limits to be tolerant of how ... — committed to gfx-rs/wgpu by bors[bot] 3 years ago
- Merge #1584 1584: Update testing limits for rpi4 r=kvark a=cwfitzgerald **Connections** Related to #1574. Exposed #1583. **Description** Changes the reftesting limits to be tolerant of how ... — committed to gfx-rs/wgpu by bors[bot] 3 years ago
- Merge #1585 1585: hal/egl fix support for context extensions r=cwfitzgerald a=kvark **Connections** Follow-up to #1584 Closes #1577 **Description** TIL that EGL extensions work differently fr... — committed to gfx-rs/wgpu by bors[bot] 3 years ago
- Merge #1633 1633: Always use EXT Robustness with EGL r=kvark a=cwfitzgerald **Connections** Closes #1631. Closes #1577. **Description** KHR robustness doesn't seem to work on any real plat... — committed to gfx-rs/wgpu by bors[bot] 3 years ago
The debug half is fixed by #1584
I’m not sure it’s the same error, but could be. One thing that looks highly suspicious is that in my case, the function
choose_config()
from the khronos-egl crate does not seem to handle the case correctly whencount
is zero, i.e. no matching config is found. Why it isn’t found is unclear to me at the moment. I’ll look at it more closely and will probably report it as an issue in khronos-egl. (that was a misunderstanding on my part)I don’t know the underlying cause, but this is what
RUST_LOG=info cargo run --example hello_triangle
says:Looks like ignoring
supports_khr_context
and using theEGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT
attribute instead works in my case.Related error on Linux, NVIDIA GT 610. Removing the
EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR
seems to let it continue beyond theeglCreateContext
but then it fails later ineglCreatePlatformWindowSurface
.