I’m currently poking around making Vulkan surface inside program on Ubuntu with Python.
For some reason the code informs that the display in use does not support Wayland, though Ubuntu uses Wayland. Who should I contact with the code example to see what kind of problem is in question?
Here is one possible clue.
opened 01:20AM - 25 Sep 24 UTC
type: bug
help required
backend: vulkan
platform: wayland
platform: linux
<!-- Thank you for filing this! Please read the [debugging tips](https://github.… com/gfx-rs/wgpu/wiki/Debugging-wgpu-Applications).
That may let you investigate on your own, or provide additional information that helps us to assist.-->
**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:
```bash
WAYLAND_DISPLAY= cargo run --bin wgpu-examples mipmap
```
fails:
```bash
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](https://github.com/user-attachments/files/17122991/triangle-vulkan-x11.log)
[triangle-vulkan-wayland.log](https://github.com/user-attachments/files/17122993/triangle-vulkan-wayland.log)
[mipmap-vulkan-x11.log](https://github.com/user-attachments/files/17122994/mipmap-vulkan-x11.log)
[mipmap-vulkan-wayland.log](https://github.com/user-attachments/files/17122995/mipmap-vulkan-wayland.log)
[mipmap-opengl-x11.log](https://github.com/user-attachments/files/17122996/mipmap-opengl-x11.log)
[mipmap-opengl-wayland.log](https://github.com/user-attachments/files/17122997/mipmap-opengl-wayland.log)
Related issue: https://github.com/ruffle-rs/ruffle/issues/17948
**Platform**
Dell G16 7620 laptop with i7 12700H and NVIDIA RTX 3060
Arch Linux (kernel 6.10.10-arch1-1)
wgpu 859dd8817e7484b51823d443d7cac93c6e9a7ef2
"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