Open poweron0102 opened 9 months ago
What happens here is that wgpu tries to initialize the Vulkan backend but fails because we enable validation layers in dev/debug mode, which are not installed on your system. If you want to fix this, install the vulkan-validation-layers
package on Fedora.
With Vulkan broken, wgpu falls back to OpenGL. OpenGL works in the hello_triangle
example, but interestingly not in the cube
example. I can reproduce this error, but only on Wayland. Setting WAYLAND_DISPLAY=
makes winit fall back to X11 and the example runs.
# wayland, broken
env WGPU_BACKEND="gl" cargo run --bin wgpu-examples cube
# x11, works
env WAYLAND_DISPLAY= WGPU_BACKEND="gl" cargo run --bin wgpu-examples cube
If you only see problems in the cube
example, you could try renaming the cube
binary to wgpu_example
or something to check if it's special handling based on the binary name (at least one driver used to do this apparently)
Good thought, but all the examples got combined into one binary some time ago, and the specific example is now specified by a command line argument. Also happens with other examples, maybe there's a pattern.
Oh, the hello_triangle
example runs with Vulkan even though I specified WGPU_BACKEND="gl"
(verified through mangohud). So, it seems like OpenGL is just straight up broken on Wayland.
Bisected with env WGPU_BACKEND="gl" cargo run --bin (wgpu-examples) cube
. Broken since #4634.
Couple notes:
What happens here is that wgpu tries to initialize the Vulkan backend but fails because we enable validation layers in dev/debug mode, which are not installed on your system.
This is actually even deeper than that. We run without the validation layers fine, but this is the vulkan loader failing to initialize a layer that it thinks should be there and aborting instance creation.
Oh, the hello_triangle example runs with Vulkan even though I specified WGPU_BACKEND="gl" (verified through mangohud). So, it seems like OpenGL is just straight up broken on Wayland.
The hello-triangle example is special in that it doesn't use the standard init functions, so doesn't listen to the WGPU_BACKEND env. Maybe that should change
After i install vulkan-validation-layers
every thing works fine, should i close this issue?
Let's not because OpenGL is completely broken on OpenGL, and that seems glaring to me.
Description
Some example don't work on debug mode.
Repro steps and Expected vs observed behavior
hello_triangle
cargo run --bin wgpu-examples hello_triangle
cube
cargo run --bin wgpu-examples cube
Everything works fine in release mode
Platform
OS: Fedora 39 with Wayland GPU: Intel(R) HD Graphics 620 Rust: 1.75.0