Skip to content

Cannot find vulkan adapter on Mesa 25 + RADV #7336

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
matteodev8 opened this issue Mar 14, 2025 · 8 comments
Closed

Cannot find vulkan adapter on Mesa 25 + RADV #7336

matteodev8 opened this issue Mar 14, 2025 · 8 comments
Labels
backend: vulkan Issues with Vulkan external: driver-bug A driver is causing the bug, though we may still want to work around it platform: linux Linux Specific Issues

Comments

@matteodev8
Copy link

Description
After upgrading to Mesa 25 from Mesa 24 today, I am experiences issues with my bevy app. It errors on launch with wgpu complaining about surface configuration failed: incompatible window kind and Device::create_render_pipeline error: Internal error in ShaderStages(VERTEX | FRAGMENT) shader:

Repro steps

  1. use Mesa 25.0.1
  2. run project

Expected vs observed behavior
Should open the window

Crashes

Extra materials

2025-03-14T15:15:11.165679Z  INFO bevy_render::renderer: AdapterInfo { name: "AMD Radeon RX 7800 XT (radeonsi, navi32, LLVM 19.1.7, DRM 3.61, 6.13.6-arch1-1)", vendor: 4098, device: 0, device_type: Other, driver: "", driver_info: "4.6 (Core Profile) Mesa 25.0.1-arch1.2", backend: Gl }
2025-03-14T15:15:11.224144Z  WARN bevy_pbr::ssao: ScreenSpaceAmbientOcclusionPlugin not loaded. GPU lacks support: TextureFormat::R16Float does not support TextureUsages::STORAGE_BINDING.
2025-03-14T15:15:11.224481Z  INFO bevy_winit::system: Creating new window "App" (0v1#4294967296)
2025-03-14T15:15:11.224506Z  INFO winit::platform_impl::linux::x11::window: Guessed window scale factor: 1
2025-03-14T15:15:11.236518Z ERROR wgpu_core::device::global: surface configuration failed: incompatible window kind

thread 'main' panicked at /home/matteo/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wgpu-23.0.1/src/backend/wgpu_core.rs:719: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`!
2025-03-14T15:15:11.250487Z ERROR wgpu_core::device::global: Device::create_render_pipeline error: Internal error in ShaderStages(VERTEX | FRAGMENT) shader:
2025-03-14T15:15:11.250502Z ERROR wgpu::backend::wgpu_core: Shader translation error for stage ShaderStages(VERTEX | FRAGMENT):
2025-03-14T15:15:11.250505Z ERROR wgpu::backend::wgpu_core: Please report it to https://github.com/gfx-rs/wgpu
2025-03-14T15:15:11.250510Z ERROR wgpu::backend::wgpu_core: Handling wgpu errors as fatal by default

thread 'Async Compute Task Pool (0)' panicked at /home/matteo/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wgpu-23.0.1/src/backend/wgpu_core.rs:1102:18:
wgpu error: Validation Error

Caused by:
  In Device::create_render_pipeline, label = 'sprite_pipeline'
    Internal error in ShaderStages(VERTEX | FRAGMENT) shader:

Platform
OS: Arch Linux (KDE Plasma 6)
Rust: 1.85.0
Mesa: 1:25.0.1-2 (Pacman)
Vulkan Driver: RADV
GPU: Radeon RX 7800 XT
Wgpu: 23.0.1

@matteodev8
Copy link
Author

Okay apperently, it crashes with different errors each time! I ran cargo run 3 times

lsim on  dev [?] is 📦 v0.1.0 via 🦀 v1.85.0
❯ cargo run
    Finished `dev` profile [optimized + debuginfo] target(s) in 0.11s
     Running `target/debug/lsim`
2025-03-14T15:26:12.335533Z  INFO bevy_render::renderer: AdapterInfo { name: "AMD Radeon RX 7800 XT (radeonsi, navi32, LLVM 19.1.7, DRM 3.61, 6.13.6-arch1-1)", vendor: 4098, device: 0, device_type: Other, driver: "", driver_info: "4.6 (Core Profile) Mesa 25.0.1-arch1.2", backend:
 Gl }
2025-03-14T15:26:12.394467Z  WARN bevy_pbr::ssao: ScreenSpaceAmbientOcclusionPlugin not loaded. GPU lacks support: TextureFormat::R16Float does not support TextureUsages::STORAGE_BINDING.
2025-03-14T15:26:12.394838Z  INFO bevy_winit::system: Creating new window "App" (0v1#4294967296)
2025-03-14T15:26:12.394863Z  INFO winit::platform_impl::linux::x11::window: Guessed window scale factor: 1
2025-03-14T15:26:12.409044Z ERROR wgpu_core::device::global: surface configuration failed: incompatible window kind

thread 'main' panicked at /home/matteo/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wgpu-23.0.1/src/backend/wgpu_core.rs:719: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`!
2025-03-14T15:26:12.421399Z ERROR wgpu::backend::wgpu_core: Shader translation error for stage ShaderStages(COMPUTE):
2025-03-14T15:26:12.421413Z ERROR wgpu::backend::wgpu_core: Please report it to https://github.com/gfx-rs/wgpu
2025-03-14T15:26:12.421418Z ERROR wgpu::backend::wgpu_core: Handling wgpu errors as fatal by default

thread 'Async Compute Task Pool (2)' panicked at /home/matteo/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wgpu-23.0.1/src/backend/wgpu_core.rs:1147:18:
wgpu error: Validation Error

Caused by:
  In Device::create_compute_pipeline, label = 'mesh preprocessing (GPU culling)'
    Internal error:
lsim on  dev [?] is 📦 v0.1.0 via 🦀 v1.85.0
❯ cargo run
    Finished `dev` profile [optimized + debuginfo] target(s) in 0.11s
     Running `target/debug/lsim`
2025-03-14T15:26:13.272375Z  INFO bevy_render::renderer: AdapterInfo { name: "AMD Radeon RX 7800 XT (radeonsi, navi32, LLVM 19.1.7, DRM 3.61, 6.13.6-arch1-1)", vendor: 4098, device: 0, device_type: Other, driver: "", driver_info: "4.6 (Core Profile) Mesa 25.0.1-arch1.2", backend:
 Gl }
2025-03-14T15:26:13.332049Z  WARN bevy_pbr::ssao: ScreenSpaceAmbientOcclusionPlugin not loaded. GPU lacks support: TextureFormat::R16Float does not support TextureUsages::STORAGE_BINDING.
2025-03-14T15:26:13.332403Z  INFO bevy_winit::system: Creating new window "App" (0v1#4294967296)
2025-03-14T15:26:13.332430Z  INFO winit::platform_impl::linux::x11::window: Guessed window scale factor: 1
2025-03-14T15:26:13.344258Z ERROR wgpu_core::device::global: surface configuration failed: incompatible window kind

thread 'main' panicked at /home/matteo/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wgpu-23.0.1/src/backend/wgpu_core.rs:719: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`!
lsim on  dev [?] is 📦 v0.1.0 via 🦀 v1.85.0
❯ cargo run
    Finished `dev` profile [optimized + debuginfo] target(s) in 0.11s
     Running `target/debug/lsim`
2025-03-14T15:26:14.539428Z  INFO bevy_render::renderer: AdapterInfo { name: "AMD Radeon RX 7800 XT (radeonsi, navi32, LLVM 19.1.7, DRM 3.61, 6.13.6-arch1-1)", vendor: 4098, device: 0, device_type: Other, driver: "", driver_info: "4.6 (Core Profile) Mesa 25.0.1-arch1.2", backend: Gl }
2025-03-14T15:26:14.598237Z  WARN bevy_pbr::ssao: ScreenSpaceAmbientOcclusionPlugin not loaded. GPU lacks support: TextureFormat::R16Float does not support TextureUsages::STORAGE_BINDING.
2025-03-14T15:26:14.598636Z  INFO bevy_winit::system: Creating new window "App" (0v1#4294967296)
2025-03-14T15:26:14.598662Z  INFO winit::platform_impl::linux::x11::window: Guessed window scale factor: 1
2025-03-14T15:26:14.612069Z ERROR wgpu_core::device::global: surface configuration failed: incompatible window kind

thread 'main' panicked at /home/matteo/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wgpu-23.0.1/src/backend/wgpu_core.rs:719: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`!
2025-03-14T15:26:14.622852Z ERROR wgpu::backend::wgpu_core: Shader translation error for stage ShaderStages(COMPUTE):
2025-03-14T15:26:14.622861Z ERROR wgpu::backend::wgpu_core: Please report it to https://github.com/gfx-rs/wgpu
2025-03-14T15:26:14.622867Z ERROR wgpu::backend::wgpu_core: Handling wgpu errors as fatal by default

thread 'Async Compute Task Pool (1)' panicked at /home/matteo/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wgpu-23.0.1/src/backend/wgpu_core.rs:1147:18:
wgpu error: Validation Error

Caused by:
  In Device::create_compute_pipeline, label = 'mesh preprocessing (direct)'
    Internal error:

@Rudxain

This comment has been minimized.

@papow65
Copy link

papow65 commented Mar 14, 2025

I had the same problem using mesa 25. Downgrading mesa and vulkan-radeon to version 24 served as an effective workaround.

@arcaspo
Copy link

arcaspo commented Mar 15, 2025

I am having the same problem. I think it might be because wgpu can't find the vulkan drivers and defaults to gl renderer which causes lots of errors?
When I try force the project to run with vulkan with WGPU_BACKEND=vulkan it runs but at a very low framerate because it uses llvmpipe instead of proper drivers

AdapterInfo { name: "llvmpipe (LLVM 19.1.7, 256 bits)", vendor: 65541, device: 0, device_type: Cpu, driver: "llvmpipe", driver_info: "Mesa 25.0.1 (LLVM 19.1.7)", backend: Vulkan }

wgpu-info returns this:

Adapter 0:
                 Backend: Vulkan
                    Name: llvmpipe (LLVM 19.1.7, 256 bits)
                VendorID: 0x10005
                DeviceID: 0x0
                    Type: Cpu
                  Driver: llvmpipe
              DriverInfo: Mesa 25.0.1 (LLVM 19.1.7)
        WebGPU Compliant: true
Adapter 1:
                 Backend: Gl
                    Name: AMD Radeon RX 6600 XT (radeonsi, navi23, LLVM 19.1.7, DRM 3.61, 6.13.6-200.fc41.x86_64)
                VendorID: 0x1002
                DeviceID: 0x0
                    Type: Other
                  Driver: <empty>
              DriverInfo: 4.6 (Core Profile) Mesa 25.0.1
        WebGPU Compliant: false

but vulkaninfo | grep "GPU id" returns this:

GPU id = 0 (AMD Radeon RX 6600 XT (RADV NAVI23))
GPU id = 1 (llvmpipe (LLVM 19.1.7, 256 bits))

So I think wgpu must not be able to find or use the radv driver for some reason.

@cwfitzgerald
Copy link
Member

If you set up env_logger::init(), and then do RUST_LOG=warn in your environment, does wgpu warn of anything. Can you post your full vulkan info?

@arcaspo
Copy link

arcaspo commented Mar 16, 2025

When I set up env_logger wgpu warns

[WARN  wgpu_hal::vulkan::adapter] Adapter is not Vulkan compliant, hiding adapter: AMD Radeon RX 6600 XT (RADV NAVI23)
[WARN  wgpu_hal::gles::egl] Re-initializing Gles context due to Wayland window

This is the full vulkaninfo
vulkaninfo.txt

@cwfitzgerald cwfitzgerald added external: driver-bug A driver is causing the bug, though we may still want to work around it backend: vulkan Issues with Vulkan platform: linux Linux Specific Issues labels Mar 16, 2025
@cwfitzgerald
Copy link
Member

cwfitzgerald commented Mar 16, 2025

This is most likely https://gitlab.freedesktop.org/mesa/mesa/-/issues/12799 which has already been fixed. In the mean time you can set WGPU_ALLOW_UNDERLYING_NONCOMPLIANT_ADAPTER=1 in your environment or enable the InstanceFlag until this bug is fixed.

@cwfitzgerald
Copy link
Member

Closing this as not-our-issue, but if any additional things come up, please let me know and we can re-open.

@cwfitzgerald cwfitzgerald closed this as not planned Won't fix, can't repro, duplicate, stale Mar 16, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in WebGPU for Firefox Mar 16, 2025
@cwfitzgerald cwfitzgerald changed the title Errors after upgrading to Mesa 25 Cannot find vulkan adapter on Mesa 25 + RADV Mar 27, 2025
@cwfitzgerald cwfitzgerald pinned this issue Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend: vulkan Issues with Vulkan external: driver-bug A driver is causing the bug, though we may still want to work around it platform: linux Linux Specific Issues
Projects
Status: Done
Development

No branches or pull requests

5 participants