`integration_wgpu` example does not run on Wayland (runs on X)
Is there an existing issue for this?
- [X] I have searched the existing issues.
Is this issue related to iced?
- [X] My hardware is compatible and my graphics drivers are up-to-date.
What happened?
I cannot run the integration_wgpu example on Wayland, however it runs just fine when I switch to X. get_supported_formats() is empty.
What is the expected behavior?
To be able to run the aforementioned example on both X and Wayland
Version
master
Operative System
Linux
Do you have any log output?
[2022-08-19T01:16:50Z ERROR wgpu_hal::vulkan::adapter] get_physical_device_surface_present_modes: An unknown error has occurred, due to an implementation or application bug
[2022-08-19T01:16:50Z ERROR wgpu_hal::vulkan::adapter] get_physical_device_surface_formats: An unknown error has occurred, due to an implementation or application bug
[2022-08-19T01:16:50Z ERROR wgpu_hal::vulkan::adapter] get_physical_device_surface_present_modes: An unknown error has occurred, due to an implementation or application bug
[2022-08-19T01:16:50Z ERROR wgpu_hal::vulkan::adapter] get_physical_device_surface_formats: An unknown error has occurred, due to an implementation or application bug
thread 'main' panicked at 'Get preferred format', examples/integration_wgpu/src/main.rs:99:18
stack backtrace:
0: rust_begin_unwind
at /rustc/9c20b2a8cc7588decb6de25ac6a7912dcef24d65/library/std/src/panicking.rs:584:5
1: core::panicking::panic_fmt
at /rustc/9c20b2a8cc7588decb6de25ac6a7912dcef24d65/library/core/src/panicking.rs:142:14
2: core::panicking::panic_display
at /rustc/9c20b2a8cc7588decb6de25ac6a7912dcef24d65/library/core/src/panicking.rs:72:5
3: core::panicking::panic_str
at /rustc/9c20b2a8cc7588decb6de25ac6a7912dcef24d65/library/core/src/panicking.rs:56:5
4: core::option::expect_failed
at /rustc/9c20b2a8cc7588decb6de25ac6a7912dcef24d65/library/core/src/option.rs:1874:5
5: core::option::Option<T>::expect
at /rustc/9c20b2a8cc7588decb6de25ac6a7912dcef24d65/library/core/src/option.rs:738:21
6: integration_wgpu::main::{{closure}}
at ./examples/integration_wgpu/src/main.rs:95:13
7: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
at /rustc/9c20b2a8cc7588decb6de25ac6a7912dcef24d65/library/core/src/future/mod.rs:91:19
8: futures_executor::local_pool::block_on::{{closure}}
at /home/rtkay/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-executor-0.3.23/src/local_pool.rs:317:23
9: futures_executor::local_pool::run_executor::{{closure}}
at /home/rtkay/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-executor-0.3.23/src/local_pool.rs:90:37
10: std::thread::local::LocalKey<T>::try_with
at /rustc/9c20b2a8cc7588decb6de25ac6a7912dcef24d65/library/std/src/thread/local.rs:445:16
11: std::thread::local::LocalKey<T>::with
at /rustc/9c20b2a8cc7588decb6de25ac6a7912dcef24d65/library/std/src/thread/local.rs:421:9
12: futures_executor::local_pool::run_executor
at /home/rtkay/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-executor-0.3.23/src/local_pool.rs:86:5
13: futures_executor::local_pool::block_on
at /home/rtkay/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-executor-0.3.23/src/local_pool.rs:317:5
14: integration_wgpu::main
at ./examples/integration_wgpu/src/main.rs:76:37
15: core::ops::function::FnOnce::call_once
at /rustc/9c20b2a8cc7588decb6de25ac6a7912dcef24d65/library/core/src/ops/function.rs:248:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Are you sure the wgpu examples run on your environment on Wayland?
I only checked with boids and it ran. I can shoot through the rest later today if it can help?
@hecrj
System76-power was the issue - at least on Arch. My intention was to use my integrated card exclusively. It turns out, on Arch, there can be some instances where switching to integrated will still load NVIDIA modules. I just queried System76-power and I noticed the NVIDIA card was being used even after I switch to integrated which led me to that issue and this comment there. And sure enough, after confirming that I'm fully on integrated mode, the example runs now.
I'm still not sure why the examples run on X regardless, and why the wgpu examples ran on Wayland but iced's examples failed to.
Could you retest, please? There have been many wgpu and winit updates since this issue was reported.