Iced: Examples fail on Macs without Metal support

Created on 8 Feb 2020  路  5Comments  路  Source: hecrj/iced

Neat project! I just tried taking things for a spin, but it's failed:

$ RUST_BACKTRACE=full cargo run --package progress_bar
    Finished dev [unoptimized + debuginfo] target(s) in 0.22s
     Running `target/debug/progress_bar`
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:378:21
stack backtrace:
   0:        0x104ecd735 - backtrace::backtrace::libunwind::trace::hb16ec6045891ce5a
                               at /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88
   1:        0x104ecd735 - backtrace::backtrace::trace_unsynchronized::hcacbd0efdffd74c6
                               at /Users/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66
   2:        0x104ecd735 - std::sys_common::backtrace::_print_fmt::h39e22de9d6757d12
                               at src/libstd/sys_common/backtrace.rs:77
   3:        0x104ecd735 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h415ddd0ba88caaaf
                               at src/libstd/sys_common/backtrace.rs:61
   4:        0x104eebf20 - core::fmt::write::h3335552e2df81c1d
                               at src/libcore/fmt/mod.rs:1028
   5:        0x104ecbb4b - std::io::Write::write_fmt::he6837371b9a45188
                               at src/libstd/io/mod.rs:1412
   6:        0x104ecf4c3 - std::sys_common::backtrace::_print::h89459d14ba97f5fa
                               at src/libstd/sys_common/backtrace.rs:65
   7:        0x104ecf4c3 - std::sys_common::backtrace::print::ha4c6688e811b8829
                               at src/libstd/sys_common/backtrace.rs:50
   8:        0x104ecf4c3 - std::panicking::default_hook::{{closure}}::h708e66cfeb0483ba
                               at src/libstd/panicking.rs:188
   9:        0x104ecf1ca - std::panicking::default_hook::h39ea8ddf674c04ec
                               at src/libstd/panicking.rs:205
  10:        0x104ecfc0b - std::panicking::rust_panic_with_hook::h9db77b22c2255a16
                               at src/libstd/panicking.rs:464
  11:        0x104ecf769 - std::panicking::continue_panic_fmt::h2dfa3a5b90265361
                               at src/libstd/panicking.rs:373
  12:        0x104ecf669 - rust_begin_unwind
                               at src/libstd/panicking.rs:302
  13:        0x104ee811c - core::panicking::panic_fmt::hec1ee47b7e17dca5
                               at src/libcore/panicking.rs:139
  14:        0x104ee8074 - core::panicking::panic::h30fe7b508c26b15d
                               at src/libcore/panicking.rs:70
  15:        0x1047dc1e0 - core::option::Option<T>::unwrap::hbec2fdf7224360a8
                               at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14/src/libcore/macros.rs:41
  16:        0x10492a144 - wgpu_request_adapter
                               at /Users/me/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-native-0.4.3/src/instance.rs:474
  17:        0x1046b563d - wgpu::Adapter::request::ha66b32bd73380b41
                               at /Users/me/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.4.0/src/lib.rs:545
  18:        0x1045f5910 - iced_wgpu::renderer::Renderer::new::h0682673c8b9bd9dc
                               at wgpu/src/renderer.rs:57
  19:        0x1045f73f4 - <iced_wgpu::renderer::Renderer as iced_native::window::renderer::Renderer>::new::h83bcc0cb7e69d4e0
                               at wgpu/src/renderer.rs:463
  20:        0x1044cd175 - iced_winit::application::Application::run::h9acff3abb7370115
                               at /Users/me/Documents/Code/rust/other/iced/winit/src/application.rs:169
  21:        0x1044a570f - iced::application::Application::run::h5d35e322149e3428
                               at /Users/me/Documents/Code/rust/other/iced/src/application.rs:177
  22:        0x1044a58c0 - iced::sandbox::Sandbox::run::h86da6c61095980ec
                               at /Users/me/Documents/Code/rust/other/iced/src/sandbox.rs:128
  23:        0x1044cddaa - progress_bar::main::hb68c8566db5e82d4
                               at examples/progress_bar/src/main.rs:4
  24:        0x1044a8672 - std::rt::lang_start::{{closure}}::h7a47d33c58d14eee
                               at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14/src/libstd/rt.rs:61
  25:        0x104ecf5e8 - std::rt::lang_start_internal::{{closure}}::hccd7db6d8a0ebab5
                               at src/libstd/rt.rs:48
  26:        0x104ecf5e8 - std::panicking::try::do_call::hd5a3af8d00c06681
                               at src/libstd/panicking.rs:287
  27:        0x104ed1bdf - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:78
  28:        0x104ed005e - std::panicking::try::h7a0bd4c078131d2f
                               at src/libstd/panicking.rs:265
  29:        0x104ed005e - std::panic::catch_unwind::h75c3fbe62776ab10
                               at src/libstd/panic.rs:396
  30:        0x104ed005e - std::rt::lang_start_internal::haa52aabac43378ff
                               at src/libstd/rt.rs:47
  31:        0x1044a8652 - std::rt::lang_start::h20470961c581b479
                               at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14/src/libstd/rt.rs:61
  32:        0x1044ce072 - progress_bar::Message::SliderChanged::hefc33626c8183d38

I can try on macOS 10.14 if you need output from a Metal target as well.

bug

Most helpful comment

So it seems to work if I install OpenGL & Vulkan

sudo apt install libglu1-mesa-dev freeglut3-dev mesa-common-dev libvulkan1 mesa-vulkan-drivers vulkan-utils

Please mention that these system dependencies are needed in the installation guide

All 5 comments

$ git log
commit 4e9e051caaf76e2c76aaa79c2463409a8280265f (grafted, HEAD -> master, origin/master, origin/HEAD)
Author: H茅ctor Ram贸n Jim茅nez <[email protected]>
Date:   Fri Feb 7 20:45:09 2020 +0100

    Fix crates.io link in `README`

Related to #48.

On macOS, you will need a Metal-capable graphics processor to run the examples for the time being.

Yup! Seems to work fine on the other Mac. Considering Apple's dropped support for OpenGL, I think it's best to focus on making sure Metal targets work as good as they can instead of supporting my ancient machine.

I have observed the same issue on Ubuntu 18.04 with integrated Intel CPU chipset

So it seems to work if I install OpenGL & Vulkan

sudo apt install libglu1-mesa-dev freeglut3-dev mesa-common-dev libvulkan1 mesa-vulkan-drivers vulkan-utils

Please mention that these system dependencies are needed in the installation guide

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Newbytee picture Newbytee  路  4Comments

casperstorm picture casperstorm  路  3Comments

porglezomp picture porglezomp  路  3Comments

Charles-Schleich picture Charles-Schleich  路  3Comments

aentity picture aentity  路  4Comments