Open umut-sahin opened 1 month ago
Looks like winit is using the X11 backend. Maybe something with XWayland is broken on your machine. What happens when you enable bevy's wayland
feature?
I'll try it and get back to you in a week or so, I'm away from my desktop ATM.
But even if it solves the issue, that would mean I need to provide two binaries for Linux distribution which is not ideal.
That's not how that works. You can have both features enabled. Bevy will prefer Wayland but seamlessly fall back to X11 as needed.
Oh, okay I'll try and let you know then.
Btw, why isn't it enabled by default then?
Because there has historically always been some kind of problem on Wayland affecting a portion of users. Sometimes it's our fault (https://github.com/gfx-rs/wgpu/issues/5505), sometimes not (https://github.com/gfx-rs/wgpu/issues/4775). On the other hand though, there have also been issues that were solved by turning the Wayland feature on (maybe yours is one of those), so it's hard to say.
I will personally try to push for Wayland-By-Default once https://github.com/gfx-rs/wgpu/issues/5505 gets resolved. Hopefully nothing else "major" crops up until then.
Enabling wayland
feature just changed the error:
2024-08-08T08:55:42.974400Z ERROR wgpu_hal::vulkan::instance: GENERAL [Loader Message (0x0)]
setup_loader_term_phys_devs: Failed to detect any valid GPUs in the current config
2024-08-08T08:55:42.974410Z ERROR wgpu_hal::vulkan::instance: objects: (type: INSTANCE, hndl: 0x5aba20682820, name: ?)
2024-08-08T08:55:42.974414Z ERROR wgpu_hal::vulkan::instance: enumerate_adapters: Initialization of an object has failed
2024-08-08T08:55:42.975153Z INFO bevy_render::renderer: AdapterInfo { name: "NV172", vendor: 65541, device: 0, device_type: Other, driver: "OpenGL", driver_info: "4.3 (Compatibility Profile) Mesa 24.1.5-arch1.1", backend: Gl }
2024-08-08T08:55:43.025122Z WARN bevy_pbr::ssao: ScreenSpaceAmbientOcclusionPlugin not loaded. GPU lacks support: TextureFormat::R16Float does not support TextureUsages::STORAGE_BINDING.
2024-08-08T08:55:43.025265Z INFO bevy_winit::system: Creating new window "Mythmallow" (Entity { index: 0, generation: 1 })
2024-08-08T08:55:43.070426Z ERROR wgpu_hal::gles::egl: EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'Compute Task Pool (11)' panicked at /home/default/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.21.1/src/gles/egl.rs:296: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-08-08T08:55:43.070666Z ERROR wgpu_hal::gles::egl: EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'Compute Task Pool (11)' panicked at /home/default/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.21.1/src/gles/egl.rs:296: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-08-08T08:55:43.070723Z ERROR wgpu_hal::gles::egl: EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'Compute Task Pool (11)' panicked at /home/default/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.21.1/src/gles/egl.rs:296: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-08-08T08:55:43.070801Z ERROR wgpu_hal::gles::egl: EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'main' panicked at /home/default/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.21.1/src/gles/egl.rs:296: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-08-08T08:55:43.071019Z ERROR wgpu_hal::gles::egl: EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'Compute Task Pool (9)' panicked at /home/default/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.21.1/src/gles/egl.rs:296:14:
called `Result::unwrap()` on an `Err` value: BadDisplay
Encountered a panic in system `bevy_render::globals::prepare_globals_buffer`!
2024-08-08T08:55:43.071082Z ERROR wgpu_hal::gles::egl: EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'Compute Task Pool (10)' panicked at /home/default/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.21.1/src/gles/egl.rs:296:14:
called `Result::unwrap()` on an `Err` value: BadDisplay
Encountered a panic in system `bevy_pbr::render::skin::prepare_skins`!
2024-08-08T08:55:43.071225Z ERROR wgpu_hal::gles::egl: EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'Compute Task Pool (10)' panicked at /home/default/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.21.1/src/gles/egl.rs:296:14:
called `Result::unwrap()` on an `Err` value: BadDisplay
Encountered a panic in system `bevy_render::view::visibility::range::write_render_visibility_ranges`!
2024-08-08T08:55:43.071298Z ERROR wgpu_hal::gles::egl: EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'Compute Task Pool (7)' panicked at /home/default/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.21.1/src/gles/egl.rs:296:14:
called `Result::unwrap()` on an `Err` value: BadDisplay
Encountered a panic in system `bevy_sprite::render::prepare_sprite_image_bind_groups`!
2024-08-08T08:55:43.071459Z ERROR wgpu_hal::gles::egl: EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread '<unnamed>' panicked at /home/default/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.21.1/src/gles/egl.rs:296:14:
called `Result::unwrap()` on an `Err` value: BadDisplay
Encountered a panic in system `bevy_render::renderer::render_system`!
Ohh you don't have a Vulkan driver. Native Wayland is currently broken on OpenGL (as linked in my previous comment). You might want to install NVK given you're not using the proprietary drivers?
Installing the driver fixed the issue :partying_face:
Though if there is a way to improve the error messages, they should be improved IMO. Like detecting OpenGL is being tried to be used in Wayland and logging an error saying it's not supported.
Thanks!
Bevy version
v0.14.0
Relevant system information
What you did
What went wrong
Additional information
Let me know if anything else is needed!