gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.
https://wgpu.rs
Apache License 2.0
12.6k stars 921 forks source link

WGPU won't start on specific windows computer #5294

Closed isXander closed 7 months ago

isXander commented 8 months ago

Description Fails to create the surface on Windows 10 machine

thread 'main' panicked at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-core-0.19.0\src\instance.rs:521:39:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library\std\src\panicking.rs:645
   1: core::panicking::panic_fmt
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library\core\src\panicking.rs:72
   2: core::panicking::panic
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library\core\src\panicking.rs:127
   3: enum2$<core::option::Option<enum2$<core::result::Result<wgpu_core::any_surface::AnySurface,wgpu_hal::InstanceError> > > >::unwrap<enum2$<core::result::Result<wgpu_core::any_surface::AnySurface,wgpu_hal::InstanceError> > >
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\core\src\option.rs:931
   4: wgpu_core::global::Global<wgpu_core::identity::IdentityManagerFactory>::instance_create_surface<wgpu_core::identity::IdentityManagerFactory>
             at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-core-0.19.0\src\instance.rs:521
   5: wgpu::backend::wgpu_core::impl$7::instance_create_surface
             at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-0.19.1\src\backend\wgpu_core.rs:529
   6: wgpu::context::impl$5::instance_create_surface<wgpu::backend::wgpu_core::ContextWgpuCore>
             at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-0.19.1\src\context.rs:1995
   7: wgpu::Instance::create_surface_unsafe
             at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-0.19.1\src\lib.rs:2051
   8: wgpu::Instance::create_surface<alloc::sync::Arc<winit::window::Window,alloc::alloc::Global> >
             at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-0.19.1\src\lib.rs:1984
   9: wgpu_test::impl$4::new::async_fn$0
             at D:\a\RustGameEngine\RustGameEngine\src\lib.rs:167
  10: wgpu_test::run::async_fn$0
             at D:\a\RustGameEngine\RustGameEngine\src\lib.rs:496
  11: pollster::block_on<enum2$<wgpu_test::run::async_fn_env$0> >
             at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\pollster-0.3.0\src\lib.rs:128
  12: wgpu_test::main
             at D:\a\RustGameEngine\RustGameEngine\src\main.rs:4
  13: core::ops::function::FnOnce::call_once<void (*)(),tuple$<> >
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\core\src\ops\function.rs:250
  14: core::hint::black_box
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112\library\core\src\hint.rs:286
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Repro steps This is produced with the following source... https://github.com/isXander/VoxelEngine/commit/f63f93834dfce4f7d66e705d0ccc676cada7375a

At home on my own machine, it works, another similar machine works, my mac works. This computer does not. I have enabled all backends.

Expected vs observed behavior Crashes on unwrap, should run.

Extra materials

Platform

Wumpf commented 8 months ago

Almost certainly fixed in

Worth noting though that this would only happen if there's no backend available that can create a surface. Any chance you can check again wgpu trunk?

isXander commented 8 months ago

Almost certainly fixed in

Worth noting though that this would only happen if there's no backend available that can create a surface. Any chance you can check again wgpu trunk?

This is a school PC. But regardless, why would this Windows 10 PC not have DX, VK or GL??

Can test it again during the week.

cwfitzgerald commented 8 months ago

It should at least have WARP on DX12, as that's a system component

cwfitzgerald commented 7 months ago

Closing as fixed