Iced: Trying to run examples, wgpu-native is panicking on an .unwrap()

Created on 8 Jun 2020  Â·  8Comments  Â·  Source: hecrj/iced

Hello,

Really keen to get started, and playing around with this library, but I have tried to run two examples: Counter, and Styling.

I copy the contents over from main.rs, I add iced = "0.1.1" to my dependencies in Cargo.toml

try to run (on Lubuntu 18.10) and get this error:

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /home/arif/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-native-0.4.3/src/instance.rs:474:5
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:78
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1069
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1537
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:198
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:218
  10: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:477
  11: rust_begin_unwind
             at src/libstd/panicking.rs:385
  12: core::panicking::panic_fmt
             at src/libcore/panicking.rs:89
  13: core::panicking::panic
             at src/libcore/panicking.rs:52
  14: core::option::Option<T>::unwrap
             at /home/arif/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/macros/mod.rs:10
  15: wgpu_request_adapter
             at /home/arif/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-native-0.4.3/src/instance.rs:474
  16: wgpu::Adapter::request
             at /home/arif/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.4.0/src/lib.rs:545
  17: <iced_wgpu::window::backend::Backend as iced_native::window::backend::Backend>::new
             at /home/arif/.cargo/registry/src/github.com-1ecc6299db9ec823/iced_wgpu-0.2.3/src/window/backend.rs:21
  18: iced_winit::application::Application::run
             at /home/arif/.cargo/registry/src/github.com-1ecc6299db9ec823/iced_winit-0.1.0/src/application.rs:180
  19: iced::application::Application::run
             at /home/arif/.cargo/registry/src/github.com-1ecc6299db9ec823/iced-0.1.1/src/application.rs:201
  20: iced::sandbox::Sandbox::run
             at /home/arif/.cargo/registry/src/github.com-1ecc6299db9ec823/iced-0.1.1/src/sandbox.rs:139
  21: arificed::main
             at src/main.rs:8
  22: std::rt::lang_start::{{closure}}
             at /home/arif/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/rt.rs:67
  23: std::rt::lang_start_internal::{{closure}}
             at src/libstd/rt.rs:52
  24: std::panicking::try::do_call
             at src/libstd/panicking.rs:297
  25: std::panicking::try
             at src/libstd/panicking.rs:274
  26: std::panic::catch_unwind
             at src/libstd/panic.rs:394
  27: std::rt::lang_start_internal
             at src/libstd/rt.rs:51
  28: std::rt::lang_start
             at /home/arif/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/rt.rs:67
  29: main
  30: __libc_start_main
  31: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Any idea what can be done?

question

All 8 comments

wgpu_request_adapter

Well, do you have a working Vulkan driver? Is libvulkan (vulkan-loader) installed?

I'm having the same issue, and vulkaninfo fails due to ERROR_INCOMPATIBLE_DRIVER (because my gpu is too old to have any support for vulkan). I removed the vulkan ICD loader from my system, but it didn't resolve the issue. I followed up by also removing the headers, cargo clean, cargo run (which builds), and it's still there. It's hard depending on vulkan for some reason. Not sure if it's your bug or wgpu's bug, I'm still digging

EDIT: From the wgpu page: wgpu supports most modern graphics backends: Vulkan, Metal, DX11, and DX12 (OpenGL and WebGL are still WIP). So seems like I'm unable to use this library for the forseeable future (I'll pop over to their issue tracker, since it's their bug :p)

@thePalindrome @Arifd You may be able to use the new OpenGL renderer in master by enabling the glow feature. More details in #354.

Ah, thank you. Yeah this is likely what it is. (My computer is old). I'm new to GUI programming (and Rust) Could you explain the steps to enable the glow feature? I've tried these commands unsuccessfully;

cargo run --features "glow'
cargo run --features "iced_glow"

Thank you.

@Arifd You will need to depend on the Git source in your Cargo.toml:

[dependencies.iced]
git = "https://github.com/hecrj/iced.git"
features = ["glow"]

That solved it, thank you!

Issue's closed, but figured I should also state it works for me (at least with my simple test).

Sorry, my fault! Forgot you were in this thread.

On Thu, 11 Jun 2020, 00:53 thePalindrome, notifications@github.com wrote:

Issue's closed, but figured I should also state it works for me (at least
with my simple test).

—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
https://github.com/hecrj/iced/issues/398#issuecomment-642308601, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AAR4WFUH3QTXFZMSRWRPYTDRWAFF7ANCNFSM4NYVG73A
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Gohla picture Gohla  Â·  4Comments

Shootertrex picture Shootertrex  Â·  3Comments

CallistoM picture CallistoM  Â·  3Comments

kszlim picture kszlim  Â·  4Comments

porglezomp picture porglezomp  Â·  3Comments