bevy
bevy copied to clipboard
Bevy 0.9.0 Panics on MacOS
Bevy version
0.9.0
Relevant system information
Macbook Pro 2018 2.9 GHz 6-Core Intel Core i9 Intel UHD Graphics 630 1536 MB AMD Radeon Pro 560X
MacOS Ventura 13.0 cargo 1.65.0 (4bc8f24d3 2022-10-20)
What you did
use bevy::prelude::*;
fn main(){
App::new()
.add_plugins(DefaultPlugins)
//.add_system(hello_world) // Also broken
.run();
}
// fn hello_world() {
// println!("hello world!");
// }
What went wrong
- what were you expecting?
Successful basic hello world, or to just output nothing
- what actually happened?
It appears to be some sort of metal incompatibility with wgpu
> RUST_BACKTRACE=1 cargo run
Compiling bevy_test v0.1.0 (/Users/nateb/Developer/rust/bevy_test)
Finished dev [optimized + debuginfo] target(s) in 2.07s
Running `target/debug/bevy_test`
thread 'main' panicked at '', /Users/nateb/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-hal-0.14.1/src/metal/adapter.rs:485:13
stack backtrace:
0: rust_begin_unwind
at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:584:5
1: core::panicking::panic_fmt
at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/panicking.rs:142:14
2: core::panicking::panic_display
at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/panicking.rs:72:5
3: wgpu_hal::metal::adapter::<impl wgpu_hal::metal::PrivateCapabilities>::new
at /Users/nateb/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-hal-0.14.1/src/metal/adapter.rs:485:13
4: wgpu_hal::metal::AdapterShared::new
at /Users/nateb/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-hal-0.14.1/src/metal/mod.rs:263:28
5: <wgpu_hal::metal::Instance as wgpu_hal::Instance<wgpu_hal::metal::Api>>::enumerate_adapters::{{closure}}
at /Users/nateb/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-hal-0.14.1/src/metal/mod.rs:112:30
6: core::iter::adapters::map::map_fold::{{closure}}
at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/iter/adapters/map.rs:84:28
7: core::iter::traits::iterator::Iterator::fold
at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/iter/traits/iterator.rs:2414:21
8: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/iter/adapters/map.rs:124:9
9: core::iter::traits::iterator::Iterator::for_each
at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/iter/traits/iterator.rs:831:9
10: <alloc::vec::Vec<T,A> as alloc::vec::spec_extend::SpecExtend<T,I>>::spec_extend
at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/alloc/src/vec/spec_extend.rs:40:17
11: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter_nested::SpecFromIterNested<T,I>>::from_iter
at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/alloc/src/vec/spec_from_iter_nested.rs:62:9
12: alloc::vec::in_place_collect::<impl alloc::vec::spec_from_iter::SpecFromIter<T,I> for alloc::vec::Vec<T>>::from_iter
at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/alloc/src/vec/in_place_collect.rs:164:20
13: <alloc::vec::Vec<T> as core::iter::traits::collect::FromIterator<T>>::from_iter
at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/alloc/src/vec/mod.rs:2649:9
14: core::iter::traits::iterator::Iterator::collect
at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/iter/traits/iterator.rs:1836:9
15: <wgpu_hal::metal::Instance as wgpu_hal::Instance<wgpu_hal::metal::Api>>::enumerate_adapters
at /Users/nateb/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-hal-0.14.1/src/metal/mod.rs:108:61
16: wgpu_core::instance::<impl wgpu_core::hub::Global<G>>::request_adapter::gather
at /Users/nateb/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-core-0.14.0/src/instance.rs:727:49
17: wgpu_core::instance::<impl wgpu_core::hub::Global<G>>::request_adapter
at /Users/nateb/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-core-0.14.0/src/instance.rs:771:42
18: <wgpu::backend::direct::Context as wgpu::Context>::instance_request_adapter
at /Users/nateb/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.14.0/src/backend/direct.rs:861:18
19: wgpu::Instance::request_adapter
at /Users/nateb/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.14.0/src/lib.rs:1795:23
20: bevy_render::renderer::initialize_renderer::{{closure}}
at /Users/nateb/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_render-0.9.0/src/renderer/mod.rs:118:19
21: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/future/mod.rs:91:19
22: futures_lite::future::block_on::{{closure}}
at /Users/nateb/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-lite-1.12.0/src/future.rs:89:27
23: std::thread::local::LocalKey<T>::try_with
at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/thread/local.rs:445:16
24: std::thread::local::LocalKey<T>::with
at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/thread/local.rs:421:9
25: futures_lite::future::block_on
at /Users/nateb/.cargo/registry/src/github.com-1ecc6299db9ec823/futures-lite-1.12.0/src/future.rs:79:5
26: <bevy_render::RenderPlugin as bevy_app::plugin::Plugin>::build
at /Users/nateb/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_render-0.9.0/src/lib.rs:161:65
27: bevy_app::app::App::add_boxed_plugin
at /Users/nateb/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_app-0.9.0/src/app.rs:859:9
28: bevy_app::plugin_group::PluginGroupBuilder::finish
at /Users/nateb/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_app-0.9.0/src/plugin_group.rs:181:25
29: bevy_app::app::App::add_plugins
at /Users/nateb/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_app-0.9.0/src/app.rs:930:9
30: bevy_test::main
at ./src/main.rs:4:3
31: core::ops::function::FnOnce::call_once
at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/ops/function.rs:248:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Additional information
- It runs on Bevy 0.8.1, so the issue is very likely a change between those versions.
- This issue is similar but likely unrelated
Interesting. @cwfitzgerald - the backtrace of this segfault is in wgpu. Any ideas?
Hey 10Nates -- any chance you could give this a try with Bevy 0.11?
I'm unable to reproduce even with Bevy 0.9.0, but only have access to an M1 mac.
Just checked, appears to be working now. Must have been resolved somewhere at some point.