Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic when get_error() returns None #25

Open
danyspin97 opened this issue Jun 22, 2023 · 3 comments
Open

Panic when get_error() returns None #25

danyspin97 opened this issue Jun 22, 2023 · 3 comments

Comments

@danyspin97
Copy link

The unwrap here cause panic. get_error() can return None in some specific edge cases.

@timothee-haudebourg
Copy link
Owner

Thanks. Do you know the specific edge cases? Could you make a PR to solve this?

@acarl005
Copy link

acarl005 commented Apr 10, 2024

I am able to trigger this case running the wgpu examples on the trunk branch and telling EGL to use my Nvidia card.

Crashing here

RUST_BACKTRACE=1 __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/10_nvidia.json cargo run --bin wgpu-examples -- mipmap
    Finished dev [unoptimized + debuginfo] target(s) in 0.10s
     Running `target/debug/wgpu-examples mipmap`
[2024-04-10T13:42:38Z WARN  sctk_adwaita::buttons] Ignoring unknown button type: icon
[2024-04-10T13:42:38Z INFO  wgpu_examples::framework] Initializing wgpu...
thread 'main' panicked at /home/andy/.cargo/registry/src/index.crates.io-6f17d22bba15001f/khronos-egl-6.0.0/src/lib.rs:1779:38:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: rust_begin_unwind
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
   2: core::panicking::panic
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:144:5
   3: core::option::Option<T>::unwrap
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/option.rs:931:21
   4: khronos_egl::egl1_5::<impl khronos_egl::Instance<T>>::get_platform_display
             at /home/andy/.cargo/registry/src/index.crates.io-6f17d22bba15001f/khronos-egl-6.0.0/src/lib.rs:1779:9
   5: <wgpu_hal::gles::egl::Instance as wgpu_hal::Instance>::init
             at ./wgpu-hal/src/gles/egl.rs:791:21
   6: wgpu_core::instance::Instance::new::init
             at ./wgpu-core/src/instance.rs:81:32
   7: wgpu_core::instance::Instance::new
             at ./wgpu-core/src/instance.rs:110:17
   8: wgpu_core::global::Global::new
             at ./wgpu-core/src/global.rs:56:23
   9: <wgpu::backend::wgpu_core::ContextWgpuCore as wgpu::context::Context>::init
             at ./wgpu/src/backend/wgpu_core.rs:544:14
  10: wgpu::Instance::new
             at ./wgpu/src/lib.rs:1808:36
  11: wgpu_examples::framework::ExampleContext::init_async::{{closure}}
             at ./examples/src/framework.rs:274:24
  12: wgpu_examples::framework::start::{{closure}}
             at ./examples/src/framework.rs:372:93
  13: pollster::block_on
             at /home/andy/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pollster-0.3.0/src/lib.rs:128:15
  14: wgpu_examples::framework::run
             at ./examples/src/framework.rs:482:13
  15: wgpu_examples::mipmap::main
             at ./examples/src/mipmap/mod.rs:504:5
  16: wgpu_examples::main
             at ./examples/src/main.rs:229:5
  17: core::ops::function::FnOnce::call_once
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
uname -a
Linux queenie 6.5.0-21-generic #21~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Feb  9 13:32:52 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
nvidia-smi
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.67                 Driver Version: 550.67         CUDA Version: 12.4     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 3050 ...    Off |   00000000:01:00.0 Off |                  N/A |
| N/A   39C    P8              5W /   25W |      74MiB /   4096MiB |     22%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A      2032      G   /usr/bin/gnome-shell                            1MiB |
|    0   N/A  N/A      6630    C+G   warp-terminal-dev                              64MiB |
+-----------------------------------------------------------------------------------------+

I'm using Wayland.

@danyspin97
Copy link
Author

Thanks. Do you know the specific edge cases? Could you make a PR to solve this?

Unfortunately, I don't remember what caused this issue, I am sure it was something wrong with my code because I was just learning openGL and integrating EGL in my wayland application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants