Wgpu error doesn't let my bevy 0.13.0 project that I updated to bevy 0.14.0 work
Bevy version
0.14.0
[Optional] Relevant system information
cargo 1.79.0 (ffa9cf99a 2024-06-03)
Arch linux latest stable and wayland (hyprland)
AdapterInfo { name: "Mesa Intel(R) HD Graphics 4000 (IVB GT2)", vendor: 32902, device: 0, device_type: IntegratedGpu, driver: "OpenGL", driver_info: "4.2 (Compatibility Profile) Mesa 24.1.3-arch1.1", backend: Gl }
Using lavapipe because gpu doesn't support vulkan
What you did
I updated my bevy 13.0 project into a bevy 14.0 project. I fixed the code so that the version works, but now it won't run because of wgpu. It worked before updating
Additional information
Here are the errors
2024-07-08T01:00:58.508971Z ERROR wgpu_core::device::global: surface configuration failed: incompatible window kind
thread 'Compute Task Pool (0)' panicked at /home/bintouali/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.20.1/src/backend/wgpu_core.rs:751:18:
Error in Surface::configure: Validation Error
Caused by:
Invalid surface
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic in system `bevy_render::view::window::create_surfaces`!
2024-07-08T01:00:58.536984Z ERROR wgpu_hal::gles: wgpu-hal heuristics assumed that the view dimension will be equal to `Cube` rather than `CubeArray`.
`D2` textures with `depth_or_array_layers == 1` are assumed to have view dimension `D2`
`D2` textures with `depth_or_array_layers > 1` are assumed to have view dimension `D2Array`
`D2` textures with `depth_or_array_layers == 6` are assumed to have view dimension `Cube`
`D2` textures with `depth_or_array_layers > 6 && depth_or_array_layers % 6 == 0` are assumed to have view dimension `CubeArray`
2024-07-08T01:00:58.537009Z ERROR wgpu_hal::gles: wgpu-hal heuristics assumed that the view dimension will be equal to `D2` rather than `D2Array`.
`D2` textures with `depth_or_array_layers == 1` are assumed to have view dimension `D2`
`D2` textures with `depth_or_array_layers > 1` are assumed to have view dimension `D2Array`
`D2` textures with `depth_or_array_layers == 6` are assumed to have view dimension `Cube`
`D2` textures with `depth_or_array_layers > 6 && depth_or_array_layers % 6 == 0` are assumed to have view dimension `CubeArray`
2024-07-08T01:00:58.552787Z ERROR wgpu::backend::wgpu_core: Shader translation error for stage ShaderStages(COMPUTE): The selected version doesn't support Features(DYNAMIC_ARRAY_SIZE)
2024-07-08T01:00:58.552835Z ERROR wgpu::backend::wgpu_core: Please report it to https://github.com/gfx-rs/wgpu
2024-07-08T01:00:58.552861Z ERROR wgpu::backend::wgpu_core: Handling wgpu errors as fatal by default
thread 'Async Compute Task Pool (0)' panicked at /home/bintouali/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.20.1/src/backend/wgpu_core.rs:2996:5:
wgpu error: Validation Error
Caused by:
In Device::create_compute_pipeline
note: label = `mesh preprocessing (GPU culling)`
Internal error: The selected version doesn't support Features(DYNAMIC_ARRAY_SIZE)
2024-07-08T01:00:58.558921Z ERROR wgpu::backend::wgpu_core: Shader translation error for stage ShaderStages(COMPUTE): The selected version doesn't support Features(DYNAMIC_ARRAY_SIZE)
2024-07-08T01:00:58.558967Z ERROR wgpu::backend::wgpu_core: Please report it to https://github.com/gfx-rs/wgpu
2024-07-08T01:00:58.558997Z ERROR wgpu::backend::wgpu_core: Handling wgpu errors as fatal by default
thread 'Async Compute Task Pool (0)' panicked at /home/bintouali/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.20.1/src/backend/wgpu_core.rs:2996:5:
wgpu error: Validation Error
Caused by:
In Device::create_compute_pipeline
note: label = `mesh preprocessing (direct)`
Internal error: The selected version doesn't support Features(DYNAMIC_ARRAY_SIZE)
Got similar error on Fedora 40 + KDE Plasma Wayland with bevy 0.14.
MESA-INTEL: warning: Ivy Bridge Vulkan support is incomplete
2024-07-10T03:57:39.157136Z INFO bevy_render::renderer: AdapterInfo { name: "Mesa Intel(R) HD Graphics 2500 (IVB GT1)", vendor: 32902, device: 0, device_type: IntegratedGpu, driver: "OpenGL", driver_info: "4.2 (Compatibility Profile) Mesa 24.1.2", backend: Gl }
2024-07-10T03:57:39.310162Z WARN bevy_pbr::ssao: ScreenSpaceAmbientOcclusionPlugin not loaded. GPU lacks support: TextureFormat::R16Float does not support TextureUsages::STORAGE_BINDING.
2024-07-10T03:57:39.310655Z INFO bevy_winit::system: Creating new window "FINB" (Entity { index: 0, generation: 1 })
2024-07-10T03:57:39.311295Z INFO winit::platform_impl::platform::x11::window: Guessed window scale factor: 1
2024-07-10T03:57:39.353125Z ERROR wgpu_core::device::global: surface configuration failed: incompatible window kind
thread 'Compute Task Pool (1)' panicked at /home/trungdt/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.20.1/src/backend/wgpu_core.rs:751:18:
Error in Surface::configure: Validation Error
Caused by:
Invalid surface
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic in system `bevy_render::view::window::create_surfaces`!
2024-07-10T03:57:39.409557Z ERROR wgpu::backend::wgpu_core: Shader translation error for stage ShaderStages(COMPUTE): The selected version doesn't support Features(DYNAMIC_ARRAY_SIZE)
2024-07-10T03:57:39.409588Z ERROR wgpu::backend::wgpu_core: Please report it to https://github.com/gfx-rs/wgpu
2024-07-10T03:57:39.409602Z ERROR wgpu::backend::wgpu_core: Handling wgpu errors as fatal by default
thread 'Async Compute Task Pool (0)' panicked at /home/trungdt/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.20.1/src/backend/wgpu_core.rs:2996:5:
wgpu error: Validation Error
Caused by:
In Device::create_compute_pipeline
note: label = `mesh preprocessing (GPU culling)`
Internal error: The selected version doesn't support Features(DYNAMIC_ARRAY_SIZE)
2024-07-10T03:57:39.454569Z ERROR wgpu::backend::wgpu_core: Shader translation error for stage ShaderStages(COMPUTE): The selected version doesn't support Features(DYNAMIC_ARRAY_SIZE)
2024-07-10T03:57:39.455163Z ERROR wgpu::backend::wgpu_core: Please report it to https://github.com/gfx-rs/wgpu
2024-07-10T03:57:39.455186Z ERROR wgpu::backend::wgpu_core: Handling wgpu errors as fatal by default
thread 'Async Compute Task Pool (0)' panicked at /home/trungdt/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.20.1/src/backend/wgpu_core.rs:2996:5:
wgpu error: Validation Error
Caused by:
In Device::create_compute_pipeline
note: label = `mesh preprocessing (direct)`
Internal error: The selected version doesn't support Features(DYNAMIC_ARRAY_SIZE)
To game window can be displayed, I need to manually export WGPU_BACKEND=vulkan, which is not required in bevy 0.13.
I have the same error trying to update my FOSS game Unhaunter from 0.13 to 0.14 - I am trying to run it from a Chromebook on the Linux VM. The Vulkan drivers are bad here, and in 0.13 was slow. But it was working, even with wgsl shaders.
I tried the example from Bevy GitHub, and it also fails here:
deavidsedice@penguin:~/rust/bevy/examples$ cargo run --features x11 --example 2d_shapes
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.23s
Running `/home/deavidsedice/rust/bevy/target/debug/examples/2d_shapes`
2024-07-14T15:54:33.128211Z INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Linux 12 Debian GNU/Linux", kernel: "6.6.30-02725-g3e8c91b46252", cpu: "12th Gen Intel(R) Core(TM) i7-1265U", core_count: "12", memory: "29.5 GiB" }
2024-07-14T15:54:33.138664Z WARN winit::platform_impl::platform::x11::xdisplay: error setting XSETTINGS; Xft options won't reload automatically
2024-07-14T15:54:33.224264Z INFO bevy_render::renderer: AdapterInfo { name: "virgl (Mesa Intel(R) Graphics (ADL GT2))", vendor: 65541, device: 0, device_type: IntegratedGpu, driver: "OpenGL", driver_info: "4.3 (Compatibility Profile) Mesa 22.3.6", backend: Gl }
2024-07-14T15:54:33.594229Z WARN bevy_pbr::ssao: ScreenSpaceAmbientOcclusionPlugin not loaded. GPU lacks support: TextureFormat::R16Float does not support TextureUsages::STORAGE_BINDING.
2024-07-14T15:54:33.595347Z INFO bevy_winit::system: Creating new window "App" (Entity { index: 0, generation: 1 })
2024-07-14T15:54:33.595669Z INFO winit::platform_impl::platform::x11::window: Guessed window scale factor: 1.59375
2024-07-14T15:54:33.703834Z ERROR wgpu_core::device::global: surface configuration failed: incompatible window kind
thread 'Compute Task Pool (1)' panicked at /home/deavidsedice/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.20.1/src/backend/wgpu_core.rs:751:18:
Error in Surface::configure: Validation Error
Caused by:
Invalid surface
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic in system `bevy_render::view::window::create_surfaces`!
2024-07-14T15:54:33.726578Z ERROR wgpu_hal::gles: wgpu-hal heuristics assumed that the view dimension will be equal to `Cube` rather than `CubeArray`.
`D2` textures with `depth_or_array_layers == 1` are assumed to have view dimension `D2`
`D2` textures with `depth_or_array_layers > 1` are assumed to have view dimension `D2Array`
`D2` textures with `depth_or_array_layers == 6` are assumed to have view dimension `Cube`
`D2` textures with `depth_or_array_layers > 6 && depth_or_array_layers % 6 == 0` are assumed to have view dimension `CubeArray`
2024-07-14T15:54:33.726634Z ERROR wgpu_hal::gles: wgpu-hal heuristics assumed that the view dimension will be equal to `D2` rather than `D2Array`.
`D2` textures with `depth_or_array_layers == 1` are assumed to have view dimension `D2`
`D2` textures with `depth_or_array_layers > 1` are assumed to have view dimension `D2Array`
`D2` textures with `depth_or_array_layers == 6` are assumed to have view dimension `Cube`
`D2` textures with `depth_or_array_layers > 6 && depth_or_array_layers % 6 == 0` are assumed to have view dimension `CubeArray`
This is just a clone of Bevy repo, checkout branch 0.14, and run the command.
All the logs mention picking up the OpenGL backend. Was it working on the 0.13 with Vulkan? Does it work with the 0.14 if you force it to pick Vulkan?
True, if I do:
export WGPU_BACKEND=vulkan
and then re-run the same command line, it works.
Is there any possibility to at least make the error contain any text that indicates how to potentially workaround this? I spent several hours on this and I feel it is very hard to understand even how to google this.
One question though, why doesn't work with GL? like, at all... I get it that not all features are available, but in a Chromebook, running in GL would actually make sense I think. If it worked.
Vulkan here is so slow that I need to build a WASM version and run it on the browser.
True, if I do:
export WGPU_BACKEND=vulkanand then re-run the same command line, it works.
Works for me too, fedora 40
Same issue after upgrading from Ubuntu 24.10 to Ubuntu 25.04 Beta.
SystemInfo { os: "Linux 25.04 Ubuntu", kernel: "6.14.0-11-generic", cpu: "13th Gen Intel(R) Core(TM) i7-13700", core_count: "16", memory: "30.6 GiB" }
AdapterInfo { name: "AMD Radeon RX 7600 (radeonsi, navi33, LLVM 19.1.7, DRM 3.61, 6.14.0-11-generic)", vendor: 4098, device: 0, device_type: Other, driver: "", driver_info: "4.6 (Core Profile) Mesa 25.0.1-2ubuntu2", backend: Gl }
Would be nice if bevy_winit could clearly log if X11 or Wayland is in use and why GL is chosen over Vulkan
I have been experimenting with both WAYLAND_DISPLAY and DISPLAY env vars an had all kinds of issues:
2025-03-28T12:42:34.508129Z ERROR wgpu_core::device::global: surface configuration failed: incompatible window kind
thread 'Compute Task Pool (15)' panicked at /home/me/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wgpu-23.0.1/src/backend/wgpu_core.rs:719:18:
Error in Surface::configure: Validation Error
2025-03-28T12:20:14.761708Z ERROR wgpu_hal::gles: wgpu-hal heuristics assumed that the view dimension will be equal to `Cube` rather than `CubeArray`.
2025-03-28T12:32:37.422628Z ERROR wgpu_hal::gles::egl: EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'main' panicked at /home/me/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wgpu-hal-23.0.1/src/gles/egl.rs:298:14:
called `Result::unwrap()` on an `Err` value: BadDisplay
2025-03-28T17:03:45.504341Z INFO bevy_render::renderer: AdapterInfo { name: "llvmpipe (LLVM 19.1.7, 256 bits)", vendor: 65541, device: 0, device_type: Cpu, driver: "llvmpipe", driver_info: "Mesa 25.0.1-2ubuntu2 (LLVM 19.1.7)", backend: Vulkan }
2025-03-28T17:03:45.504357Z WARN bevy_render::renderer: The selected adapter is using a driver that only supports software rendering. This is likely to be very slow. See https://bevyengine.org/learn/errors/b0006/
To conclude currently the only option that works without issues is setting WGPU_BACKEND=vulkan.
A while ago I switched from a Nvidia to AMD graphics card. I had quite some old nvidia packages installed. Cleaning those up fixed all issues for me. 🎉
apt list --installed | grep nvidia
A while ago I switched from a Nvidia to AMD graphics card. I had quite some old nvidia packages installed. Cleaning those up fixed all issues for me. 🎉
apt list --installed | grep nvidia
I have a system with AMD GPU, never had any NVIDIA modules installed, experience the same issue when updating from Bevy-0.13 to 0.16. The suggested correction with WGPU_BACKEND=vulkan works for me as well.
Would sure love a proper correction, as I have multiple projects that I'd like to upgrade to latest Bevy.
Running Ubuntu 22.04-LTS