egui icon indicating copy to clipboard operation
egui copied to clipboard

egui_glow: `NoAvailablePixelFormat`

Open rnd-ash opened this issue 3 years ago • 8 comments

Describe the bug This occurs when running an egui application on a system without a openGL 3.1 capable GPU. However according to glow, it should be possible to stop this from happening by disabling MSAA, but I cannot find any way to do so.

I've tried this with both backends available for EGUI and both end up with the same error.

Interestingly, when setting LLVMpipe (Mesa-dist-win) in windows to get OpenGL software rendering even OpenGL 4 applications can open and run fine, but EGUI apps still crash!

here is an OpenGL 4.5 app running on my VM using LLVMPipe rendering: Screenshot_20211215_141414

To Reproduce Steps to reproduce the behavior:

  1. Optional - Install mesa-dist-win for software OpenGL rendering
  2. Launch any egui app in a headless system or virtual machine (Virtualbox or Qemu)
  3. Experience the crash

Desktop (please complete the following information):

  • OS: Windows 11 (Virtualized with Qemu + QXL Display)

Backtrace

Reason: panicked at 'called `Result::unwrap()` on an `Err` value: NoAvailablePixelFormat', \.cargo\registry\src\github.com-1ecc6299db9ec823\egui_glow-0.15.0\src\epi_backend.rs:48:14
Backtrace:
  0: <unknown>
  1: <unknown>
  2: <unknown>
  3: <unknown>
  4: <unknown>
  5: <unknown>
  6: <unknown>
  7: <unknown>
  8: <unknown>
  9: <unknown>
 10: <unknown>
 11: <unknown>
 12: <unknown>
 13: <unknown>
 14: BaseThreadInitThunk
 15: RtlGetFullPathName_UEx
 16: RtlGetFullPathName_UEx

rnd-ash avatar Dec 15 '21 14:12 rnd-ash

The error is from glutin. This is what they have to say about it: https://github.com/rust-windowing/glutin/blob/master/ISSUES.md

I don't know how useful this information is. Many of the glutin issues referencing the error come to the conclusion that the vendor/driver does not support the requested features. The panic is here at the unwrap: https://github.com/emilk/egui/blob/08cc07bb2d12f06d086b2baf3f1db424a933401f/egui_glow/src/epi_backend.rs#L42-L48

parasyte avatar Dec 15 '21 22:12 parasyte

I am getting the same issue. My egui application runs fine on Linux and on a Windows machine, but when running it on a Windows VM guest (Linux host) with either glium or glow backends it crashes. Here is the backtrace using the glow backend:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NoAvailablePixelFormat', /cargo/registry/src/github.com-1ecc6299db9ec823/egui_glow-0.15.0/src/epi_backend.rs:48:14
stack backtrace:
   0: rust_begin_unwind
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c\/library\std\src/panicking.rs:517:5
   1: core::panicking::panic_fmt
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c\/library\core\src/panicking.rs:100:14
   2: core::result::unwrap_failed
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c\/library\core\src/result.rs:1616:5
   3: core::result::Result<T,E>::unwrap
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c\library\core\src\result.rs:1298:23
   4: egui_glow::epi_backend::create_display
             at /cargo/registry/src/github.com-1ecc6299db9ec823/egui_glow-0.15.0/src/epi_backend.rs:42:9
   5: egui_glow::epi_backend::run
             at /cargo/registry/src/github.com-1ecc6299db9ec823/egui_glow-0.15.0/src/epi_backend.rs:89:27
   6: eframe::run_native
             at /cargo/registry/src/github.com-1ecc6299db9ec823/eframe-0.15.0/src/lib.rs:156:5
   7: siggen_toolkit::gui::run
             at /project/src/gui.rs:729:5
   8: siggen_toolkit::main
             at /project/src/main.rs:17:9
   9: core::ops::function::FnOnce::call_once
             at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c\library\core\src\ops\function.rs:227:5

bhutch29 avatar Dec 28 '21 20:12 bhutch29

Is there any workaround to this? Can't really figure out why it's not working inside my KVM.

not-matthias avatar Jun 15 '22 18:06 not-matthias

Run app on llvmpipe. Сhange to .with_srgb(false) https://github.com/emilk/egui/blob/898f4804b7b998ffeb1ff9f457b935e1364d6827/eframe/src/native/run.rs#L27-L38

Screenshot

изображение

kurbatxx avatar Jul 20 '22 06:07 kurbatxx

Thank you @kurbatxx! It worked very well for me. Hope the egui can have this configuration soon.

vaniusrb avatar Jul 21 '22 13:07 vaniusrb

hello guys,

i have a weird error when my egui application name is "Me": thread 'main' panicked at 'called Result::unwrap() on an Err value: NoAvailablePixelFormat' I have the same error if i just rename one of my egui application to "me.exe" Im working on windows. Do you have any suggestion? How the executable name can influence the runtime?

20iahazban avatar Jul 22 '22 07:07 20iahazban

@20iahazban probably due to saved state: https://docs.rs/eframe/latest/eframe/trait.App.html#method.save

Please check that the bad value is in the stored state (maybe a negative inner_size_points or position?), then maybe we can fix it!

emilk avatar Jul 22 '22 08:07 emilk

Hello @emilk,

thanks for the answer. (I love using egui by the way) Im not using this method at all. "Persistence" feature is not enabled.

20iahazban avatar Jul 26 '22 11:07 20iahazban