iced-rs / iced

A cross-platform GUI library for Rust, inspired by Elm
https://iced.rs
MIT License
24.43k stars 1.14k forks source link

panics when running Hello World under WSL Debian with VcXsrv #606

Closed amberisvibin closed 3 years ago

amberisvibin commented 3 years ago

I have WSL Debian running with an x server. Most x applications work fine. When I try to run the hello world, with backtrace on, I get an error that seems to be related to webgpu. The webgpu should not be used in this context. Is there a way to tell iced not use the wepgpu? I looked around but could not find it. Thank you.

cargo run
warning: Error finalizing incremental compilation session directory `/home/amber/projects/openscan/target/debug/incremental/openscan-2zoz56y28rfvu/s-fswkhvt0e8-g6htin-working`: Permission denied (os error 13)

warning: 1 warning emitted

    Finished dev [unoptimized + debuginfo] target(s) in 0.64s
     Running `target/debug/openscan`
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/amber/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-native-0.4.3/src/instance.rs:474:72
stack backtrace:
   0: rust_begin_unwind
             at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/std/src/panicking.rs:475
   1: core::panicking::panic_fmt
             at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/core/src/panicking.rs:85
   2: core::panicking::panic
             at /rustc/18bf6b4f01a6feaf7259ba7cdae58031af1b7b39/library/core/src/panicking.rs:50
   3: core::option::Option<T>::unwrap
             at /home/amber/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:370
   4: wgpu_request_adapter
             at /home/amber/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-native-0.4.3/src/instance.rs:474
   5: wgpu::Adapter::request
             at /home/amber/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.4.0/src/lib.rs:545
   6: <iced_wgpu::window::backend::Backend as iced_native::window::backend::Backend>::new
             at /home/amber/.cargo/registry/src/github.com-1ecc6299db9ec823/iced_wgpu-0.2.3/src/window/backend.rs:21
   7: iced_winit::application::Application::run
             at /home/amber/.cargo/registry/src/github.com-1ecc6299db9ec823/iced_winit-0.1.0/src/application.rs:180
   8: iced::application::Application::run
             at /home/amber/.cargo/registry/src/github.com-1ecc6299db9ec823/iced-0.1.1/src/application.rs:201
   9: openscan::main
             at ./src/main.rs:4
  10: core::ops::function::FnOnce::call_once
             at /home/amber/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:227
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
FabianLars commented 3 years ago

Afaik vulkan doesn't work on wsl and therefore wgpu doesn't work either (wgpu is still missing opengl support). I switched to the glow (opengl) backend/feature to work around that and so far it's running nicely in wsl.

amberisvibin commented 3 years ago

That just gives me this error, but I could be doing this wrong. the package `openscan` depends on `iced`, with features: `glow` but `iced` does not have these features.

FabianLars commented 3 years ago

Oh, I think the current crates.io version is too old for that, not sure tho because I'm using the git version. Is using the git version an option for the moment?

amberisvibin commented 3 years ago

No, let me try that.

amberisvibin commented 3 years ago

That fixed it, thank you! TLDR: glow (opengl backend) is required for WSL, because vulkan is unsupported.