wgpu
wgpu copied to clipboard
Minimal example does not work on NixOS
Description
I tried running a minimal WGPU example, as well as the hello_triangle example under NixOS. both fails. I have an Nvidia gtx 3050 (driver version 535.113.01) as well as an integrated intel GPU. I tried on my own NixOS setup, as well as on a NixOS fresh install using the gnome / wayland ISO.
Repro steps
- get the NixOS gnome graphical ISO image and boot
- clone the WGPU repo
- try to run the hello_triangle example
Expected vs observed behavior
Expected was the hello_triangle (or my minimal app setup), observed is the following error
Extra materials
The error is the following :
thread 'main' panicked at <my home folder>/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.18.1/src/gles/egl.rs:751:18:
called `Result::unwrap()` on an `Err` value: BadAlloc
stack backtrace:
0: rust_begin_unwind
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:597:5
1: core::panicking::panic_fmt
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/panicking.rs:72:14
2: core::result::unwrap_failed
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/result.rs:1652:5
3: core::result::Result<T,E>::unwrap
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/result.rs:1077:23
4: <wgpu_hal::gles::egl::Instance as wgpu_hal::Instance<wgpu_hal::gles::Api>>::init
at /home/eclipse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-hal-0.18.1/src/gles/egl.rs:744:31
5: wgpu_core::instance::Instance::new::init
at /home/eclipse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-0.18.1/src/instance.rs:83:32
6: wgpu_core::instance::Instance::new
at /home/eclipse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-0.18.1/src/instance.rs:114:17
7: wgpu_core::global::Global<G>::new
at /home/eclipse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-core-0.18.1/src/global.rs:36:23
8: <wgpu::backend::direct::Context as wgpu::context::Context>::init
at /home/eclipse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.18.0/src/backend/direct.rs:584:14
9: wgpu::Instance::new
at /home/eclipse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.18.0/src/lib.rs:1772:32
10: morpheus::main
at ./src/main.rs:12:20
11: core::ops::function::FnOnce::call_once
at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/ops/function.rs:250:5
Platform I'm running NixOS unstable, but the same have been experienced on NixOS 23.05 wayland / gnome ditribution. This was done with the latest version of wgpu.