bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Segfault / status_access_violation when using Vulkan

Open GitGhillie opened this issue 1 year ago • 1 comments
trafficstars

Bevy version

Issue occurs since #13121.

Relevant system information

  • Rust stable
  • Windows 10, Ubuntu
`AdapterInfo { name: "AMD Radeon RX 7900 XT", vendor: 4098, device: 29772, device_type: DiscreteGpu, driver: "AMD proprietary driver", driver_info: "23.12.1 (LLPC)", backend: Vulkan }`

What you did

cargo run --example 2d_shapes

What went wrong

Instantly get STATUS_ACCESS_VIOLATION on Windows when WGPU_BACKEND=vulkan, dx12 works fine. Instantly get Segmentation fault on Ubuntu when WGPU_BACKEND=vulkan.

Additional information

Let me know if there is anything I can do to help investigate.

GitGhillie avatar May 16 '24 13:05 GitGhillie

Thought I had it fixed on Windows by updating my drivers but one restart later and it seems to be crashing again... This time it's showing a backtrace though:

Backtrace

2024-05-19T17:46:16.681339Z  INFO bevy_render::renderer: AdapterInfo { name: "AMD Radeon RX 7900 XT", vendor: 4098, device: 29772, device_type: DiscreteGpu, driver: "AMD proprietary driver", driver_info: "24.5.1 (LLPC)", backend: Vulkan }
thread 'main' panicked at C:\Users\jojo_\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-hal-0.19.4\src\vulkan\device.rs:336:25:
Unexpected Vulkan error: `An unknown error has occurred, due to an implementation or application bug`
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\std\src\panicking.rs:645
   1: core::panicking::panic_fmt
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library\core\src\panicking.rs:72
   2: wgpu_hal::vulkan::device::impl$1::allocate_memory
             at C:\Users\jojo_\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-hal-0.19.4\src\vulkan\device.rs:336
   3: gpu_alloc::buddy::BuddyAllocator<ash::vk::definitions::DeviceMemory>::alloc<ash::vk::definitions::DeviceMemory,wgpu_hal::vulkan::DeviceShared>
             at C:\Users\jojo_\.cargo\registry\src\index.crates.io-6f17d22bba15001f\gpu-alloc-0.6.0\src\buddy.rs:352
   4: gpu_alloc::allocator::GpuAllocator<ash::vk::definitions::DeviceMemory>::alloc_internal<ash::vk::definitions::DeviceMemory,wgpu_hal::vulkan::DeviceShared>
             at C:\Users\jojo_\.cargo\registry\src\index.crates.io-6f17d22bba15001f\gpu-alloc-0.6.0\src\allocator.rs:370
   5: wgpu_hal::vulkan::device::impl$4::create_buffer
             at C:\Users\jojo_\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-hal-0.19.4\src\vulkan\device.rs:879
   6: wgpu_core::device::resource::Device<wgpu_hal::vulkan::Api>::new<wgpu_hal::vulkan::Api>
             at C:\Users\jojo_\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-core-0.19.4\src\device\resource.rs:221
   7: wgpu_core::instance::Adapter<wgpu_hal::vulkan::Api>::create_device_and_queue<wgpu_hal::vulkan::Api>
             at C:\Users\jojo_\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-core-0.19.4\src\instance.rs:381
   8: wgpu_core::global::Global<wgpu_core::identity::IdentityManagerFactory>::adapter_request_device<wgpu_core::identity::IdentityManagerFactory,wgpu_hal::vulkan::Api>
             at C:\Users\jojo_\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-core-0.19.4\src\instance.rs:1084
   9: wgpu::backend::wgpu_core::impl$7::adapter_request_device
             at C:\Users\jojo_\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-0.19.4\src\backend\wgpu_core.rs:587
  10: wgpu::context::impl$5::adapter_request_device<wgpu::backend::wgpu_core::ContextWgpuCore>
             at C:\Users\jojo_\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-0.19.4\src\context.rs:2019
  11: wgpu::Adapter::request_device
             at C:\Users\jojo_\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-0.19.4\src\lib.rs:2119
  12: bevy_render::impl$3::build::async_block$0
             at C:\Users\jojo_\.cargo\git\checkouts\bevy-f7ffde730c324c74\961b24d\crates\bevy_render\src\lib.rs:302
  13: futures_lite::future::block_on::closure$0
             at C:\Users\jojo_\.cargo\registry\src\index.crates.io-6f17d22bba15001f\futures-lite-2.3.0\src\future.rs:99
  14: std::thread::local::LocalKey<core::cell::RefCell<tuple$<parking::Parker,core::task::wake::Waker> > >::try_with
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6\library\std\src\thread\local.rs:284
  15: std::thread::local::LocalKey<core::cell::RefCell<tuple$<parking::Parker,core::task::wake::Waker> > >::with
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6\library\std\src\thread\local.rs:260
  16: futures_lite::future::block_on<tuple$<>,enum2$<bevy_render::impl$3::build::async_block_env$0> >
             at C:\Users\jojo_\.cargo\registry\src\index.crates.io-6f17d22bba15001f\futures-lite-2.3.0\src\future.rs:78
  17: bevy_render::impl$3::build
             at C:\Users\jojo_\.cargo\git\checkouts\bevy-f7ffde730c324c74\961b24d\crates\bevy_render\src\lib.rs:322
  18: bevy_app::app::App::add_boxed_plugin
             at C:\Users\jojo_\.cargo\git\checkouts\bevy-f7ffde730c324c74\961b24d\crates\bevy_app\src\app.rs:509
  19: bevy_app::plugin_group::PluginGroupBuilder::finish
             at C:\Users\jojo_\.cargo\git\checkouts\bevy-f7ffde730c324c74\961b24d\crates\bevy_app\src\plugin_group.rs:214
  20: bevy_app::plugin::sealed::impl$1::add_to_app
             at C:\Users\jojo_\.cargo\git\checkouts\bevy-f7ffde730c324c74\961b24d\crates\bevy_app\src\plugin.rs:166
  21: bevy_app::app::App::add_plugins<bevy_app::plugin::sealed::PluginGroupMarker,bevy_internal::default_plugins::DefaultPlugins>
             at C:\Users\jojo_\.cargo\git\checkouts\bevy-f7ffde730c324c74\961b24d\crates\bevy_app\src\app.rs:602
  22: bevy_app::app::App::add_systems
             at C:\Users\jojo_\.cargo\git\checkouts\bevy-f7ffde730c324c74\961b24d\crates\bevy_app\src\app.rs:340
  23: unreal_bevy::main
             at .\src\main.rs:6
  24: core::ops::function::FnOnce::call_once
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6\library\core\src\ops\function.rs:250
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

GitGhillie avatar May 19 '24 17:05 GitGhillie

https://github.com/upscayl/upscayl/issues/702 seems to be similar, they suggest DDU and freshly installing the drivers

valaphee avatar May 21 '24 20:05 valaphee

I tried to reproduce the issue on Windows before trying those suggestions but couldn't... On Ubuntu I switched back to using the open source drivers and everything seems to work now.

Since using the open source drivers with linux seems to be generally recommended anyways I'll close the issue for now.

GitGhillie avatar May 22 '24 10:05 GitGhillie