Skip to content

Vulkan surface creation fails on waylandΒ #6320

@JL2210

Description

@JL2210

Description
wgpu does not run when Wayland is detected (when WAYLAND_DISPLAY is not empty). Sometimes they work if using the gl backend; for example, ruffle is fine with this, but the examples are not.

Repro steps
using mipmap here instead of hello_triangle because hello_triangle seems to force Vulkan

succeeds:

WAYLAND_DISPLAY= cargo run --bin wgpu-examples mipmap

fails:

cargo run --bin wgpu-examples mipmap

Expected vs observed behavior
expected: opened window with triangle on screen
observed: crash before window opens, with various errors

mipmap vulkan:

thread 'main' panicked at examples/src/framework.rs:188:14:
Surface isn't supported by the adapter.

mipmap opengl:

[2024-09-25T01:13:14Z ERROR wgpu_hal::gles::egl] EGL 'eglMakeCurrent' code 0x3008: eglMakeCurrent
thread 'main' panicked at wgpu-hal/src/gles/egl.rs:298:14:
called `Result::unwrap()` on an `Err` value: BadDisplay
stack backtrace:
...

hello_triangle

[2024-09-25T01:03:53Z ERROR wgpu_hal::vulkan::adapter] get_physical_device_surface_present_modes: ERROR_SURFACE_LOST_KHR
[2024-09-25T01:03:53Z ERROR wgpu_hal::vulkan::adapter] get_physical_device_surface_formats: ERROR_SURFACE_LOST_KHR
thread 'main' panicked at wgpu/src/backend/wgpu_core.rs:722:18:
Error in Surface::configure: Validation Error

Caused by:
  Requested present mode Mailbox is not in the list of supported present modes: []

Extra materials
bunch of logs of various configurations (vulkan, opengl, x11, wayland, hello_triangle, mipmap)
made with:

[WAYLAND_DISPLAY=] [WGPU_BACKEND=gl] RUST_LOG=trace cargo run --profile dev --bin wgpu-examples (hello_triangle|mipmap) 2>&1 | cat >log-name.log

triangle-vulkan-x11.log
triangle-vulkan-wayland.log
mipmap-vulkan-x11.log
mipmap-vulkan-wayland.log
mipmap-opengl-x11.log
mipmap-opengl-wayland.log

Related issue: ruffle-rs/ruffle#17948

Platform
Dell G16 7620 laptop with i7 12700H and NVIDIA RTX 3060
Arch Linux (kernel 6.10.10-arch1-1)
wgpu 859dd88
"Intel(R) Graphics (ADL GT2)" and "NVIDIA GeForce RTX 3060 Laptop GPU" in Optimus configuration (using Prime render offload)
mesa version 24.2.3
KDE Plasma 6.1.5
egl-wayland 1.16
NVIDIA-SMI version : 560.35.03
NVML version : 560.35
DRIVER version : 560.35.03
CUDA Version : 12.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend: vulkanIssues with Vulkanhelp requiredWe need community help to make this happen.platform: linuxLinux Specific Issuesplatform: waylandIssues with integration with linux/waylandtype: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions