I first found the bug when trying the 0.14 release candidates. I ran a git bisect and tracked down the problem to the commit which updated bevy to use winit 0.30. So all Bevy versions that are based on winit 0.30 are affected.
Bevy 0.13.x (and commits before the winit 0.30 update) are not affected.
Asahi does not have a GPU Vulkan driver yet (though probably will soon…) and this bug makes Bevy unusable.
What you did
Run any bevy app or example.
You need --features wayland and WGPU_BACKEND=gl to run Bevy on Asahi. Bevy chooses CPU Vulkan over OpenGL by default for some reason, and X11 with Gl backend does not work.
WGPU_BACKEND=gl cargo run --features wayland --example 3d_scene
What went wrong
Bevy immediately crashes with various systems in the Render schedule panicking. The panic comes from wgpu unwrapping a BadDisplay error related to calling eglMakeCurrent. Something must be going wrong with how winit and wgpu interact in Bevy.
2024-06-19T11:15:27.791229Z ERROR wgpu_hal::gles::egl: EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'Compute Task Pool (1)' panicked at /home/iyes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.19.4/src/gles/egl.rs:295:14:
called `Result::unwrap()` on an `Err` value: BadDisplay
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic in system `bevy_render::view::window::create_surfaces`!
2024-06-19T11:15:27.794062Z ERROR wgpu_hal::gles::egl: EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'main' panicked at /home/iyes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.19.4/src/gles/egl.rs:295:14:
called `Result::unwrap()` on an `Err` value: BadDisplay
Encountered a panic in system `bevy_render::render_asset::prepare_assets<bevy_render::texture::image::GpuImage>`!
2024-06-19T11:15:27.794372Z ERROR wgpu_hal::gles::egl: EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'Compute Task Pool (0)' panicked at /home/iyes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.19.4/src/gles/egl.rs:295:14:
called `Result::unwrap()` on an `Err` value: BadDisplay
Encountered a panic in system `bevy_pbr::render::light::prepare_lights`!
2024-06-19T11:15:27.794516Z ERROR wgpu_hal::gles::egl: EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'Compute Task Pool (1)' panicked at /home/iyes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.19.4/src/gles/egl.rs:295:14:
called `Result::unwrap()` on an `Err` value: BadDisplay
Encountered a panic in system `bevy_render::render_asset::prepare_assets<bevy_sprite::mesh2d::material::PreparedMaterial2d<bevy_sprite::mesh2d::color_material::ColorMaterial>>`!
2024-06-19T11:15:27.794976Z ERROR wgpu_hal::gles::egl: EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'Compute Task Pool (2)' panicked at /home/iyes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.19.4/src/gles/egl.rs:295:14:
called `Result::unwrap()` on an `Err` value: BadDisplay
Encountered a panic in system `bevy_render::render_asset::prepare_assets<bevy_pbr::material::PreparedMaterial<bevy_pbr::pbr_material::StandardMaterial>>`!
2024-06-19T11:15:27.795235Z ERROR wgpu_hal::gles::egl: EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'Compute Task Pool (1)' panicked at /home/iyes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.19.4/src/gles/egl.rs:295:14:
called `Result::unwrap()` on an `Err` value: BadDisplay
Encountered a panic in system `bevy_render::render_asset::prepare_assets<bevy_render::mesh::mesh::GpuMesh>`!
2024-06-19T11:15:27.795881Z ERROR wgpu_hal::gles::egl: EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'main' panicked at /home/iyes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.19.4/src/gles/egl.rs:295:14:
called `Result::unwrap()` on an `Err` value: BadDisplay
Encountered a panic in system `bevy_render::view::prepare_view_uniforms`!
2024-06-19T11:15:27.795956Z ERROR wgpu_hal::gles::egl: EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'Compute Task Pool (0)' panicked at /home/iyes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.19.4/src/gles/egl.rs:295:14:
called `Result::unwrap()` on an `Err` value: BadDisplay
Encountered a panic in system `bevy_render::globals::prepare_globals_buffer`!
2024-06-19T11:15:27.796070Z ERROR wgpu_hal::gles::egl: EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'main' panicked at /home/iyes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.19.4/src/gles/egl.rs:295:14:
called `Result::unwrap()` on an `Err` value: BadDisplay
Encountered a panic in system `bevy_pbr::render::skin::prepare_skins`!
2024-06-19T11:15:27.796160Z ERROR wgpu_hal::gles::egl: EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'Compute Task Pool (1)' panicked at /home/iyes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.19.4/src/gles/egl.rs:295:14:
called `Result::unwrap()` on an `Err` value: BadDisplay
2024-06-19T11:15:27.796272Z ERROR wgpu_hal::gles::egl: EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'main' panicked at /home/iyes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.19.4/src/gles/egl.rs:295:14:
called `Result::unwrap()` on an `Err` value: BadDisplay
Encountered a panic in system `bevy_pbr::render::fog::prepare_fog`!
Encountered a panic in system `bevy_pbr::ssr::prepare_ssr_settings`!
2024-06-19T11:15:27.796741Z ERROR wgpu_hal::gles::egl: EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'main' panicked at /home/iyes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.19.4/src/gles/egl.rs:295:14:
called `Result::unwrap()` on an `Err` value: BadDisplay
Encountered a panic in system `bevy_pbr::cluster::prepare_clusters`!
2024-06-19T11:15:27.796812Z ERROR wgpu_hal::gles::egl: EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'Compute Task Pool (0)' panicked at /home/iyes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.19.4/src/gles/egl.rs:295:14:
called `Result::unwrap()` on an `Err` value: BadDisplay
2024-06-19T11:15:27.798305Z ERROR wgpu_hal::gles::egl: EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'Compute Task Pool (1)' panicked at /home/iyes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.19.4/src/gles/egl.rs:295:14:
called `Result::unwrap()` on an `Err` value: BadDisplay
Encountered a panic in system `bevy_core_pipeline::core_3d::prepare_core_3d_depth_textures`!
2024-06-19T11:15:27.799596Z ERROR wgpu_hal::gles::egl: EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'Compute Task Pool (3)' panicked at /home/iyes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.19.4/src/gles/egl.rs:295:14:
Encountered a panic in system `bevy_pbr::light_probe::upload_light_probes`!
called `Result::unwrap()` on an `Err` value: BadDisplay
2024-06-19T11:15:27.800186Z ERROR wgpu_hal::gles::egl: EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'Compute Task Pool (2)' panicked at /home/iyes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.19.4/src/gles/egl.rs:295:14:
called `Result::unwrap()` on an `Err` value: BadDisplay
Encountered a panic in system `bevy_render::view::visibility::range::write_render_visibility_ranges`!
Encountered a panic in system `bevy_render::batching::gpu_preprocessing::write_batched_instance_buffers<bevy_pbr::render::mesh::MeshPipeline>`!
2024-06-19T11:15:27.800911Z ERROR wgpu_hal::gles::egl: EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'Compute Task Pool (3)' panicked at /home/iyes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.19.4/src/gles/egl.rs:295:14:
called `Result::unwrap()` on an `Err` value: BadDisplay
Encountered a panic in system `bevy_sprite::render::prepare_sprite_image_bind_groups`!
2024-06-19T11:15:27.802199Z ERROR wgpu_hal::gles::egl: EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread '<unnamed>' panicked at /home/iyes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.19.4/src/gles/egl.rs:295:14:
called `Result::unwrap()` on an `Err` value: BadDisplay
Encountered a panic in system `bevy_render::renderer::render_system`!
Additional Information
winit 0.30.2 is broken on aarch64 and does not compile. winit 0.30.0, 0.30.1, and git main, compile successfully. You have to force cargo to use one of those versions, in order to compile bevy successfully and to reproduce this bug.
Bevy version
I first found the bug when trying the 0.14 release candidates. I ran a git bisect and tracked down the problem to the commit which updated bevy to use winit 0.30. So all Bevy versions that are based on winit 0.30 are affected.
Bevy 0.13.x (and commits before the winit 0.30 update) are not affected.
Relevant system information
Asahi does not have a GPU Vulkan driver yet (though probably will soon…) and this bug makes Bevy unusable.
What you did
Run any bevy app or example.
You need
--features wayland
andWGPU_BACKEND=gl
to run Bevy on Asahi. Bevy chooses CPU Vulkan over OpenGL by default for some reason, and X11 with Gl backend does not work.What went wrong
Bevy immediately crashes with various systems in the Render schedule panicking. The panic comes from
wgpu
unwrapping aBadDisplay
error related to callingeglMakeCurrent
. Something must be going wrong with how winit and wgpu interact in Bevy.Additional Information
winit 0.30.2 is broken on aarch64 and does not compile. winit 0.30.0, 0.30.1, and git main, compile successfully. You have to force cargo to use one of those versions, in order to compile bevy successfully and to reproduce this bug.