Open expend20 opened 1 year ago
can you try https://github.com/coderedart/egui fork with glutin_winit branch and see if the issue is fixed.
Sure, tried next:
You need to do cargo clean after that split debug info change.
And are you getting the same glutin error ?
I did, it was a git clone&checkout to new directory. It's just boring to watch 5 minute gif, so I built it before the record. Here is the log with cargo clean
before the build if you need it
I'd be happy to provide any additional info to help to resolve the issue.
try setting log level to debug and backtrace to full. on linux, it would be RUST_BACKTRACE=full RUST_LOG=debug cargo run
.
it will provide us with more info.
hey @coderedart, sorry for being dormant a bit. There is actually a call stack in the first post, is it helpful? Here is your branch:
I made setting vsync/swap_interval optional so that it won't panic.
can you pull the latest git commits from glutin_winit
branch of my fork and try again?
Thanks, I updated it to 0e186efb7eff4f4bfcf8001117cadb6a57743221
0e186efb7eff4f4bfcf8001117cadb6a57743221 (HEAD -> glutin_winit, origin/glutin_winit) cranky lint
d5bda4c4af9d8f6f3909f18c81b8d887efdbf0e7 add more logging. ignore vsync option if not supported
c8a130e50dad1bb712faff6cc1fb324cace36402 update pure glow example to use glutin_winit
Now the process is crashing with null passed to strlen it seems. Here is the console log:
C:\git\egui_red\examples\hello_world>cargo run
Compiling eframe v0.20.1 (C:\git\egui_red\crates\eframe)
Compiling hello_world v0.1.0 (C:\git\egui_red\examples\hello_world)
Finished dev [unoptimized + debuginfo] target(s) in 9.13s
Running `C:\git\egui_red\target\debug\hello_world.exe`
2023-01-13T10:04:11.188040Z DEBUG eframe: Using the glow renderer
2023-01-13T10:04:11.205119Z DEBUG eframe::native::run: Entering the winit event loop (run_return)…
2023-01-13T10:04:11.206341Z DEBUG eframe::native::run::glow_integration: trying to create glutin Display with config: ConfigTemplateBuilder { template: ConfigTemplate { color_buffer_type: Rgb { r_size: 8, g_size: 8, b_size: 8 }, alpha_size: 8, depth_size: 0, stencil_size: 0, num_samples: None, min_swap_interval: None, max_swap_interval: None, config_surface_types: WINDOW, api: None, transparency: false, single_buffering: false, stereoscopy: None, float_pixels: false, max_pbuffer_width: None, hardware_accelerated: None, max_pbuffer_height: None, native_window: None } }
2023-01-13T10:04:11.233189Z DEBUG eframe::native::run::glow_integration: using the first config from config picker closure. config: Wgl(Config { inner: Config { hdc: -1996422804, pixel_format_index: 8 } })
2023-01-13T10:04:11.233481Z DEBUG eframe::native::run::glow_integration: successfully created GL Display with version: WGL and supported features: (empty)
2023-01-13T10:04:11.233665Z DEBUG eframe::native::run::glow_integration: creating gl context using raw window handle: Some(Win32(Win32WindowHandle { hwnd: 0x80ab6, hinstance: 0x7ff7b3b80000 }))
2023-01-13T10:04:11.234235Z DEBUG eframe::native::run::glow_integration: running on_resume fn.
2023-01-13T10:04:11.234449Z DEBUG eframe::native::run::glow_integration: creating surface with attributes: SurfaceAttributes { srgb: None, single_buffer: false, width: Some(320), height: Some(240), largest_pbuffer: false, raw_window_handle: Some(Win32(Win32WindowHandle { hwnd: 0x80ab6, hinstance: 0x7ff7b3b80000 })), native_pixmap: None, _ty: PhantomData }
2023-01-13T10:04:11.234795Z DEBUG eframe::native::run::glow_integration: surface created successfully: Wgl(Surface { config: 8, hwnd: 527030, hdc: 1577126838 }).making context current
2023-01-13T10:04:11.235079Z DEBUG eframe::native::run::glow_integration: made context current. setting swap interval for surface
2023-01-13T10:04:11.235229Z ERROR eframe::native::run::glow_integration: failed to set swap interval due to error: Error { raw_code: None, raw_os_message: None, kind: NotSupported("swap contol extrensions are not supported") }
and here is the crash log
(3710.1afc): Access violation - code c0000005 (!!! second chance !!!)
*** WARNING: Unable to verify checksum for C:\git\egui_red\target\debug\hello_world.exe
ucrtbase!strlen+0x31:
00007fff`7249ca21 488b10 mov rdx,qword ptr [rax] ds:00000000`00000000=????????????????
0:000> k
# Child-SP RetAddr Call Site
00 00000042`5a93d988 00007ff7`b3cb3dde ucrtbase!strlen+0x31
01 (Inline Function) --------`-------- hello_world!core::ffi::c_str::CStr::from_ptr+0x8 [/rustc/897e37553bba8b42751c67658967889d11ecd120\library\core\src\ffi\c_str.rs @ 259]
02 00000042`5a93d990 00007ff7`b3ca0a18 hello_world!glow::native::impl$2::get_parameter_string+0x2e [C:\Users\Name\.cargo\registry\src\github.com-1ecc6299db9ec823\glow-0.11.2\src\native.rs @ 1082]
03 00000042`5a93da10 00007ff7`b3c9e4e2 hello_world!egui_glow::shader_version::ShaderVersion::get+0x38 [C:\git\egui_red\crates\egui_glow\src\shader_version.rs @ 25]
04 00000042`5a93dd70 00007ff7`b3ca040a hello_world!egui_glow::painter::impl$2::new::closure$0+0x22 [C:\git\egui_red\crates\egui_glow\src\painter.rs @ 110]
05 00000042`5a93ddb0 00007ff7`b3c9478f hello_world!enum2$<core::option::Option<egui_glow::shader_version::ShaderVersion> >::unwrap_or_else<egui_glow::shader_version::ShaderVersion,egui_glow::painter::impl$2::new::closure_env$0>+0x3a [/rustc/897e37553bba8b42751c67658967889d11ecd120\library\core\src\option.rs @ 825]
06 00000042`5a93de00 00007ff7`b3bb192e hello_world!egui_glow::painter::Painter::new+0x11f [C:\git\egui_red\crates\egui_glow\src\painter.rs @ 110]
07 00000042`5a93efb0 00007ff7`b3bb31cf hello_world!eframe::native::run::glow_integration::GlowWinitApp::init_run_state+0x3be [C:\git\egui_red\crates\eframe\src\native\run.rs @ 681]
08 00000042`5a949060 00007ff7`b3be8c86 hello_world!eframe::native::run::glow_integration::impl$2::on_event+0x1ef [C:\git\egui_red\crates\eframe\src\native\run.rs @ 889]
09 00000042`5a949c60 00007ff7`b3bc3a97 hello_world!eframe::native::run::run_and_return::closure$0<eframe::native::run::glow_integration::GlowWinitApp>+0xe6 [C:\git\egui_red\crates\eframe\src\native\run.rs @ 152]
0a 00000042`5a94ae00 00007ff7`b3bb5954 hello_world!winit::platform_impl::platform::event_loop::impl$3::run_return::closure$0<enum2$<eframe::native::run::UserEvent>,eframe::native::run::run_and_return::closure_env$0<eframe::native::run::glow_integration::GlowWinitApp> >+0xa7 [C:\Users\Name\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.27.5\src\platform_impl\windows\event_loop.rs @ 255]
0b 00000042`5a94af30 00007ff7`b3bfdb8b hello_world!alloc::boxed::impl$45::call_mut<tuple$<enum2$<winit::event::Event<enum2$<eframe::native::run::UserEvent> > >,ref_mut$<enum2$<winit::event_loop::ControlFlow> > >,dyn$<core::ops::function::FnMut<tuple$<enum2$<winit::event::Event<enum2$<eframe::native::run::UserEvent> > >,ref_mut$<enum2$<winit::event_loop::ControlFlow> > >,assoc$<Output,tuple$<> > > >,alloc::alloc::Global>+0x84 [/rustc/897e37553bba8b42751c67658967889d11ecd120\library\alloc\src\boxed.rs @ 1948]
0c 00000042`5a94b050 00007ff7`b3c0abb4 hello_world!winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure$0<enum2$<eframe::native::run::UserEvent> >+0x26b [C:\Users\Name\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.27.5\src\platform_impl\windows\event_loop\runner.rs @ 250]
0d 00000042`5a94b370 00007ff7`b3c059a8 hello_world!core::panic::unwind_safe::impl$23::call_once<tuple$<>,winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<eframe::native::run::UserEvent> > >+0x24 [/rustc/897e37553bba8b42751c67658967889d11ecd120\library\core\src\panic\unwind_safe.rs @ 272]
0e 00000042`5a94b410 00007ff7`b3c05d43 hello_world!std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<eframe::native::run::UserEvent> > >,tuple$<> >+0xc8 [/rustc/897e37553bba8b42751c67658967889d11ecd120\library\std\src\panicking.rs @ 494]
0f 00000042`5a94b680 00007ff7`b3c050d0 hello_world!std::panicking::try::do_catch<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::public_window_callback_inner::closure_env$0<enum2$<eframe::native::run::UserEvent> > >,isize>+0xb3
10 00000042`5a94b6d0 00007ff7`b3bddb84 hello_world!std::panicking::try<tuple$<>,core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<eframe::native::run::UserEvent> > > >+0x90 [/rustc/897e37553bba8b42751c67658967889d11ecd120\library\std\src\panicking.rs @ 456]
11 00000042`5a94b8e0 00007ff7`b3bfbc0d hello_world!std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<eframe::native::run::UserEvent> > >,tuple$<> >+0x24 [/rustc/897e37553bba8b42751c67658967889d11ecd120\library\std\src\panic.rs @ 137]
12 00000042`5a94b980 00007ff7`b3bfd90c hello_world!winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::run::UserEvent> >::catch_unwind<enum2$<eframe::native::run::UserEvent>,tuple$<>,winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<eframe::native::run::UserEvent> > >+0x19d [C:\Users\Name\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.27.5\src\platform_impl\windows\event_loop\runner.rs @ 157]
13 00000042`5a94bc30 00007ff7`b3bfd193 hello_world!winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::run::UserEvent> >::call_event_handler<enum2$<eframe::native::run::UserEvent> >+0x3c [C:\Users\Name\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.27.5\src\platform_impl\windows\event_loop\runner.rs @ 256]
14 00000042`5a94bcd0 00007ff7`b3bfc861 hello_world!winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::run::UserEvent> >::call_new_events<enum2$<eframe::native::run::UserEvent> >+0x373 [C:\Users\Name\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.27.5\src\platform_impl\windows\event_loop\runner.rs @ 401]
15 00000042`5a94bf70 00007ff7`b3bfe467 hello_world!winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::run::UserEvent> >::move_state_to<enum2$<eframe::native::run::UserEvent> >+0x701 [C:\Users\Name\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.27.5\src\platform_impl\windows\event_loop\runner.rs @ 312]
16 00000042`5a94c5f0 00007ff7`b3bc31eb hello_world!winit::platform_impl::platform::event_loop::runner::EventLoopRunner<enum2$<eframe::native::run::UserEvent> >::poll<enum2$<eframe::native::run::UserEvent> >+0x17 [C:\Users\Name\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.27.5\src\platform_impl\windows\event_loop\runner.rs @ 207]
17 00000042`5a94c630 00007ff7`b3bee49d hello_world!winit::platform_impl::platform::event_loop::EventLoop<enum2$<eframe::native::run::UserEvent> >::run_return<enum2$<eframe::native::run::UserEvent>,eframe::native::run::run_and_return::closure_env$0<eframe::native::run::glow_integration::GlowWinitApp> >+0x13b [C:\Users\Name\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.27.5\src\platform_impl\windows\event_loop.rs @ 263]
18 00000042`5a94c910 00007ff7`b3be8644 hello_world!winit::platform::run_return::impl$0::run_return<enum2$<eframe::native::run::UserEvent>,eframe::native::run::run_and_return::closure_env$0<eframe::native::run::glow_integration::GlowWinitApp> >+0x2d [C:\Users\Name\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.27.5\src\platform\run_return.rs @ 62]
19 00000042`5a94c960 00007ff7`b3bbe2b6 hello_world!eframe::native::run::run_and_return<eframe::native::run::glow_integration::GlowWinitApp>+0x4d4 [C:\git\egui_red\crates\eframe\src\native\run.rs @ 115]
1a 00000042`5a94d4b0 00007ff7`b3be804d hello_world!eframe::native::run::glow_integration::run_glow::closure$0+0x186 [C:\git\egui_red\crates\eframe\src\native\run.rs @ 1005]
1b 00000042`5a94e130 00007ff7`b3be5dc8 hello_world!eframe::native::run::with_event_loop::closure$0<enum2$<core::result::Result<tuple$<>,enum2$<eframe::Error> > >,eframe::native::run::glow_integration::run_glow::closure_env$0>+0x1ad [C:\git\egui_red\crates\eframe\src\native\run.rs @ 99]
1c 00000042`5a94e300 00007ff7`b3be59b5 hello_world!std::thread::local::LocalKey<core::cell::RefCell<enum2$<core::option::Option<winit::event_loop::EventLoop<enum2$<eframe::native::run::UserEvent> > > > > >::try_with<core::cell::RefCell<enum2$<core::option::Option<winit::event_loop::EventLoop<enum2$<eframe::native::run::UserEvent> > > > >,eframe::native::run::with_event_loop::closure_env$0<enum2$<core::result::Result<tuple$<>,enum2$<eframe::Error> > >,eframe::native::run::glow_integration::run_glow::closure_env$0>,enum2$<core::result::Result<tuple$<>,enum2$<eframe::Error> > > >+0x118 [/rustc/897e37553bba8b42751c67658967889d11ecd120\library\std\src\thread\local.rs @ 445]
1d 00000042`5a94e4c0 00007ff7`b3be7e90 hello_world!std::thread::local::LocalKey<core::cell::RefCell<enum2$<core::option::Option<winit::event_loop::EventLoop<enum2$<eframe::native::run::UserEvent> > > > > >::with<core::cell::RefCell<enum2$<core::option::Option<winit::event_loop::EventLoop<enum2$<eframe::native::run::UserEvent> > > > >,eframe::native::run::with_event_loop::closure_env$0<enum2$<core::result::Result<tuple$<>,enum2$<eframe::Error> > >,eframe::native::run::glow_integration::run_glow::closure_env$0>,enum2$<core::result::Result<tuple$<>,enum2$<eframe::Error> > > >+0x55 [/rustc/897e37553bba8b42751c67658967889d11ecd120\library\std\src\thread\local.rs @ 421]
1e 00000042`5a94e620 00007ff7`b3bb43ad hello_world!eframe::native::run::with_event_loop<enum2$<core::result::Result<tuple$<>,enum2$<eframe::Error> > >,eframe::native::run::glow_integration::run_glow::closure_env$0>+0x70 [C:\git\egui_red\crates\eframe\src\native\run.rs @ 101]
1f 00000042`5a94e700 00007ff7`b3b9c6d6 hello_world!eframe::native::run::glow_integration::run_glow+0x12d [C:\git\egui_red\crates\eframe\src\native\run.rs @ 998]
20 00000042`5a94f4b0 00007ff7`b3b81404 hello_world!eframe::run_native+0x3d6 [C:\git\egui_red\crates\eframe\src\lib.rs @ 199]
21 00000042`5a94f850 00007ff7`b3b81713 hello_world!hello_world::main+0x254 [C:\git\egui_red\examples\hello_world\src\main.rs @ 13]
22 00000042`5a94fa50 00007ff7`b3b83746 hello_world!core::ops::function::FnOnce::call_once<enum2$<core::result::Result<tuple$<>,enum2$<eframe::Error> > > (*)(),tuple$<> >+0x13 [/rustc/897e37553bba8b42751c67658967889d11ecd120\library\core\src\ops\function.rs @ 248]
23 00000042`5a94fa90 00007ff7`b3b81b8c hello_world!std::sys_common::backtrace::__rust_begin_short_backtrace<enum2$<core::result::Result<tuple$<>,enum2$<eframe::Error> > > (*)(),enum2$<core::result::Result<tuple$<>,enum2$<eframe::Error> > > >+0x16 [/rustc/897e37553bba8b42751c67658967889d11ecd120\library\std\src\sys_common\backtrace.rs @ 122]
24 00000042`5a94fad0 00007ff7`b3e8273e hello_world!std::rt::lang_start::closure$0<enum2$<core::result::Result<tuple$<>,enum2$<eframe::Error> > > >+0x1c [/rustc/897e37553bba8b42751c67658967889d11ecd120\library\std\src\rt.rs @ 166]
25 (Inline Function) --------`-------- hello_world!core::ops::function::impls::impl$2::call_once+0xb [/rustc/897e37553bba8b42751c67658967889d11ecd120/library\core\src\ops\function.rs @ 283]
26 (Inline Function) --------`-------- hello_world!std::panicking::try::do_call+0xb [/rustc/897e37553bba8b42751c67658967889d11ecd120/library\std\src\panicking.rs @ 492]
27 (Inline Function) --------`-------- hello_world!std::panicking::try+0xb [/rustc/897e37553bba8b42751c67658967889d11ecd120/library\std\src\panicking.rs @ 456]
28 (Inline Function) --------`-------- hello_world!std::panic::catch_unwind+0xb [/rustc/897e37553bba8b42751c67658967889d11ecd120/library\std\src\panic.rs @ 137]
29 (Inline Function) --------`-------- hello_world!std::rt::lang_start_internal::closure$2+0xb [/rustc/897e37553bba8b42751c67658967889d11ecd120/library\std\src\rt.rs @ 148]
2a (Inline Function) --------`-------- hello_world!std::panicking::try::do_call+0xb [/rustc/897e37553bba8b42751c67658967889d11ecd120/library\std\src\panicking.rs @ 492]
2b (Inline Function) --------`-------- hello_world!std::panicking::try+0xb [/rustc/897e37553bba8b42751c67658967889d11ecd120/library\std\src\panicking.rs @ 456]
2c (Inline Function) --------`-------- hello_world!std::panic::catch_unwind+0xb [/rustc/897e37553bba8b42751c67658967889d11ecd120/library\std\src\panic.rs @ 137]
2d 00000042`5a94fb80 00007ff7`b3b81b5a hello_world!std::rt::lang_start_internal+0xbe [/rustc/897e37553bba8b42751c67658967889d11ecd120/library\std\src\rt.rs @ 148]
2e 00000042`5a94fcd0 00007ff7`b3b815bc hello_world!std::rt::lang_start<enum2$<core::result::Result<tuple$<>,enum2$<eframe::Error> > > >+0x3a [/rustc/897e37553bba8b42751c67658967889d11ecd120\library\std\src\rt.rs @ 165]
2f 00000042`5a94fd40 00007ff7`b3ea8dc8 hello_world!main+0x1c
30 (Inline Function) --------`-------- hello_world!invoke_main+0x22 [D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl @ 78]
31 00000042`5a94fd70 00007fff`73a126bd hello_world!__scrt_common_main_seh+0x10c [D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl @ 288]
32 00000042`5a94fdb0 00007fff`750adfb8 KERNEL32!BaseThreadInitThunk+0x1d
33 00000042`5a94fde0 00000000`00000000 ntdll!RtlUserThreadStart+0x28
Now the process is crashing with null passed to strlen it seems.
happening inside glow's get_parameter_string
when trying to get opengl shader version string.
To avoid hitting that codepath, we can provide a fixed shader version using native options.
in hello_world/src/main.rs
, change native options to
let options = eframe::NativeOptions {
initial_window_size: Some(egui::vec2(320.0, 240.0)),
shader_version: Some(eframe::egui_glow::ShaderVersion::Es300), // explicit shader version so that egui won't query opengl for supported version.
..Default::default()
};
If we get another error soon, we need to debug opengl.
can you provide your platform details using https://github.com/gkv311/wglinfo/releases or a screenshot of www.realtech-vr.com/home/glview or something equivalent.
just to make sure that this error is due to glutin/glow and not driver issues, you can try running the basic example in https://github.com/ArjunNair/egui_sdl2_gl which uses sdl2 and raw opengl bindings.
If sdl2/gl works, then we narrow the problem to glutin. you can try running an older version of eframe like 0.19
which uses older glutin versions.
if older version of eframe works, then it could be recent glutin changes causing problems.
in line https://github.com/coderedart/egui/blob/glutin_winit/crates/eframe/src/native/run.rs#L432 change ApiPrefence::FallbackEgl
to ApiPrefence::PreferEgl
and try again.
If Egl
doesn't work, time to ask ping glutin devs for help.
I'm also hitting this issue and have followed the same troubleshooting steps up until this point. Here's my wglinfo, I will try to try the rest of these steps to help narrow it down.
2023-01-13T21:54:38.775358Z DEBUG eframe::native::run: Entering the winit event loop (run_return)…
2023-01-13T21:54:38.779719Z DEBUG eframe::native::run::glow_integration: trying to create glutin Display with config: ConfigTemplateBuilder { template: ConfigTemplate { color_buffer_type: Rgb { r_size: 8, g_size: 8, b_size: 8 }, alpha_size: 8, depth_size: 0, stencil_size: 0, num_samples: None, min_swap_interval: None, max_swap_interval: None, config_surface_types: WINDOW, api: None, transparency: false, single_buffering: false, stereoscopy: None, float_pixels: false, max_pbuffer_width: None, hardware_accelerated: None, max_pbuffer_height: None, native_window: None } }
2023-01-13T21:54:39.140412Z DEBUG eframe::native::run::glow_integration: using the first config from config picker closure. config: Wgl(Config { inner: Config { hdc: 1543573365, pixel_format_index: 8 } })
2023-01-13T21:54:39.141068Z DEBUG eframe::native::run::glow_integration: successfully created GL Display with version: WGL and supported features: (empty)
2023-01-13T21:54:39.141550Z DEBUG eframe::native::run::glow_integration: creating gl context using raw window handle: Some(Win32(Win32WindowHandle { hwnd: 0x1609aa, hinstance: 0x7ff6ea8b0000 }))
2023-01-13T21:54:39.142816Z DEBUG eframe::native::run::glow_integration: running on_resume fn.
2023-01-13T21:54:39.143252Z DEBUG eframe::native::run::glow_integration: creating surface with attributes: SurfaceAttributes { srgb: None, single_buffer: false, width: Some(640), height: Some(480), largest_pbuffer: false, raw_window_handle: Some(Win32(Win32WindowHandle { hwnd: 0x1609aa, hinstance: 0x7ff6ea8b0000 })), native_pixmap: None, _ty: PhantomData<glutin::surface::WindowSurface> }
2023-01-13T21:54:39.143896Z DEBUG eframe::native::run::glow_integration: surface created successfully: Wgl(Surface { config: 8, hwnd: 1444266, hdc: 1073815148 }).making context current
2023-01-13T21:54:39.144371Z DEBUG eframe::native::run::glow_integration: made context current. setting swap interval for surface
2023-01-13T21:54:39.144620Z ERROR eframe::native::run::glow_integration: failed to set swap interval due to error: Error { raw_code: None, raw_os_message: None, kind: NotSupported("swap contol extrensions are not supported") }
your problem could be a driver issue @whee
in your wglinfo, there's no opengl hardware device at all. with EGL, only software angle renderer with google vendor (what is happening? :D is this subsystem for linux? or running in a virtual machine?). maybe using PreferEgl
fix might work for you.
on my windows, this is the wglinfo output
[WGL] WGL extensions:
WGL_ARB_create_context_no_error, WGL_ARB_create_context_profile,
WGL_ARB_extensions_string, WGL_EXT_swap_control, // lots of them
[WGL] OpenGL vendor string: NVIDIA Corporation
[WGL] OpenGL renderer string: NVIDIA GeForce GTX 1070 Ti/PCIe/SSE2
[WGL] OpenGL version string: 4.6.0 NVIDIA 511.79
[WGL] OpenGL shading language version string: 4.60 NVIDIA
[WGL] OpenGL GPU memory: 8192 MiB
[WGL] OpenGL extensions:
GL_AMD_multi_draw_indirect, GL_AMD_seamless_cubemap_per_texture, // lots of them
WGL_EXT_swap_control.
[WGL] OpenGL (core profile) vendor string: NVIDIA Corporation
[WGL] OpenGL (core profile) renderer string: NVIDIA GeForce GTX 1070 Ti/PCIe/SSE2
[WGL] OpenGL (core profile) version string: 4.6.0 NVIDIA 511.79
[WGL] OpenGL (core profile) shading language version string: 4.60 NVIDIA
[WGL] OpenGL (core profile) extensions:
GL_AMD_multi_draw_indirect, GL_AMD_seamless_cubemap_per_texture, // lots of them
WGL_EXT_swap_control.
[WGL] OpenGL (software) vendor string: Microsoft Corporation
[WGL] OpenGL (software) renderer string: GDI Generic
[WGL] OpenGL (software) version string: 1.1.0
[WGL] OpenGL (software) extensions:
GL_WIN_swap_hint, GL_EXT_bgra, GL_EXT_paletted_texture. // nothing more though. because software.
using glview
@kchibisov is it possible to factor in both Egl and Wgl features during display creation? as you can see in the above comment's wglinfo.txt, there's Egl with opengl es 3.0 (using angle) with all sorts of extensions, but glutin-winit will still choose Wgl which doesn't have any display features/extensions at all (swap control or robustness etc..).
If it is possible to query the DisplayFeatures
or extensions, i think providing them to the config picker closure in https://docs.rs/glutin-winit/0.2.1/glutin_winit/struct.DisplayBuilder.html#method.build might be a nice way to allow users to choose. preferably without having to match the platform gated variants of the config.
according to https://github.com/emilk/egui/pull/2541#issuecomment-1370767582 , glutin doesn't provide code to destroy the created display connections of egl/wgl/glx... so, we can't create two displays and choose the better one, and it may lead to weird to catch bugs.
your problem could be a driver issue @whee in your wglinfo, there's no opengl hardware device at all. with EGL, only software angle renderer with google vendor (what is happening? :D is this subsystem for linux? or running in a virtual machine?). maybe using
PreferEgl
fix might work for you.
Yes, it's some kind of VMWare virtual machine I use for work. I tried making the PreferEgl fix (by editing the source in ~/.cargo and doing a clean build), but it still was trying Wgl. Perhaps that isn't the right way to make that change.
(by editing the source in ~/.cargo and doing a clean build)
- clone
coderedart/egui
repo- checkout
glutin_winit
branch.- edit the
preferEgl
fix.- add the local eframe as dependency as below (assuming both egui repo and your project are in same folder).
[dependencies] eframe = {path = "../egui"}
Thank you. That makes more sense. I get the same output using my own modified copy.
This line in the logs seems interesting, since it mentions Wgl
when I assume it should be Egl
with PreferEgl
specified:
2023-01-14T03:20:55.713805Z DEBUG eframe::native::run::glow_integration: using the first config from config picker closure. config: Wgl(Config { inner: Config { hd c: 335616728, pixel_format_index: 8 } })
There are no other entries in config_iterator
.
there's Egl with opengl es 3.0 (using angle)
ANGLE isn't supported by glutin and never was, patches are welcome though(https://github.com/rust-windowing/glutin/issues/1508).
@kchibisov is it possible to factor in both Egl and Wgl features during display creation? as you can see in the above comment's wglinfo.txt, there's Egl with opengl es 3.0 (using angle) with all sorts of extensions, but glutin-winit will still choose Wgl which doesn't have any display features/extensions at all (swap control or robustness etc..).
You'd need to create both displays and ask for features each of it. I think you can do such a thing and then drop the displays, but you'd need to add library unloading into glutin to conserve resources.
thanks @coderedart,
I first tried this:
To avoid hitting that codepath, we can provide a fixed shader version using native options. in hello_world/src/main.rs, change native options to...
It led to another crash:
can you provide your platform details using https://github.com/gkv311/wglinfo/releases or a screenshot of www.realtech-vr.com/home/glview or something equivalent.
sure:
It looks like I have the same issue @whee has? No OpenGL devices? I'm using Hyper-V machine for all the logs in this issue. However I have another PC without Hyper-V which has same issue (that machine doesn't have dedicated GPU card, maybe the problem is that I'm connecting to it via RDP?), here is the info from it:
It looks like this RDP machine is showing no OpenGL devices as well. So, what would you recommed, how one can develop with egui in such conditions? Rust run the browser to access the GUI?
I'm using Hyper-V machine
always mention that. would have saved a lot of time :). perhaps, the issue template should probably be updated to prompt that info along with OS.
anyway, its the same issue. we need to wait until glutin gets angle support (as kchibisov said), then use software glow rendering.
same problem for the RDP. it can't find a driver/device with opengl support.
always mention that.
sorry, didn't figure out it could be relevant, thanks for all the help!
I got the same error (swap contol extrensions are not supported
) while trying to run my app inside VirtualBox (Windows 10). I've switched the renderer to wgpu
and it works without problems.
I got the same error (swap contol extrensions are not supported) while trying to run my app inside VirtualBox (Windows 10). I've switched the renderer to wgpu and it works without problems.
Seems like you've either used very old glutin or something forced vsync, but modern glutin doesn't require vsync or any extension in any form.
I've tried eframe 0.22.0
which depends on glutin 0.30.8
.
use eframe::egui;
fn main() -> Result<(), eframe::Error> {
env_logger::init();
eframe::run_simple_native("Hello world", Default::default(), move |ctx, _frame| {
egui::CentralPanel::default().show(ctx, |ui| {
ui.heading("Hello world");
});
})
}
wgpu
works because it uses DX12
.
// eframe = { version = "0.22.0", features = ["wgpu"] }
use eframe::egui;
fn main() -> Result<(), eframe::Error> {
env_logger::init();
let native_options = eframe::NativeOptions {
renderer: eframe::Renderer::Wgpu,
..Default::default()
};
eframe::run_simple_native("Hello world", native_options, move |ctx, _frame| {
egui::CentralPanel::default().show(ctx, |ui| {
ui.heading("Hello world");
});
})
}
I've tried with vsync: false
and HardwareAcceleration::Off
but it makes no difference.
Is example from https://github.com/rust-windowing/glutin/ works? cargo run --example window
.
No, it does not.
Picked a config with 0 samples
Running on GDI Generic
OpenGL Version 1.1.0
thread 'main' panicked at 'gles2 function was not loaded', C:\Users\User\Downloads\glutin-master\glutin-master\target\debug\build\glutin_examples-4b2ca402a8c68ecf\out/gl_bindings.rs:779:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `target\debug\examples\window.exe` (exit code: 101)
Sounds like you generally lack OpenGL on your system, because you face GDI Generic
even though, the loading should force the icd-loader, OpenGL on anything outside of Linux is a mess, so not that big of surprise.
This is not a glutin error. virtual box windows only provides opengl 1.1 and that is not enough for egui renderer. So, the crash is explicitly caused by egui_glow.
[2023-06-06T20:20:11Z DEBUG egui_glow::painter] opengl version: 1.1.0 opengl renderer: GDI Generic opengl vendor: Microsoft Corporation thread 'main' panicked at 'some OpenGL error occurred egui_glow requires opengl 2.0+.
Your best option is to go with software rendering https://github.com/emilk/egui/issues/1129
or wgpu if that works.
Personally, i made some experiments on this, and i used https://github.com/rustytsuki/egui which is a fork of egui, with skia backend, using skia feature instead of glow, seems to work well on windows compilation and using. i had a couple of gui, compiled on github plateform : https://github.com/barrelorgandiscovery/virtualbookplayer and https://github.com/frett27/encrypter
This does not resolve the issue, but probably help users using egui on windows plateform for a first step hope this help,
I tried to build few examples on Windows and was getting the error:
Once I commented the line
split-debuginfo = "unpacked"
in root's Cargo.toml, now I'm getting:If I run release version the .exe file just exits
rustc version is fixed in
rust-toolchain
to1.65.0-x86_64-pc-windows-msvc
, however I tried to remove it and use1.66.0
as well as nightly with the same result, I also tried on current master branch as well as 0.20.1 without luck. On 0.20.1 however I was able to capture call stack:Backtrace
``` thread 'main' panicked at 'failed to set vsync swap interval: Error { raw_code: None, raw_os_message: None, kind: NotSupported("swap contol extrensions are not supported") }', crates\eframe\src\native\run.rs:415:18 stack backtrace: 0: 0x7ff691bea6b2 - std::backtrace_rs::backtrace::dbghelp::trace at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library\std\src\..\..\backtrace\src\backtrace\dbghelp.rs:98 1: 0x7ff691bea6b2 - std::backtrace_rs::backtrace::trace_unsynchronized at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66 2: 0x7ff691bea6b2 - std::sys_common::backtrace::_print_fmt at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library\std\src\sys_common\backtrace.rs:65 3: 0x7ff691bea6b2 - std::sys_common::backtrace::_print::impl$0::fmt at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library\std\src\sys_common\backtrace.rs:44 4: 0x7ff691c021fb - core::fmt::write at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library\core\src\fmt\mod.rs:1208 5: 0x7ff691be75ca - std::io::Write::write_fmt
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library\std\src\io\mod.rs:1682
6: 0x7ff691bea3fb - std::sys_common::backtrace::_print
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library\std\src\sys_common\backtrace.rs:47
7: 0x7ff691bea3fb - std::sys_common::backtrace::print
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library\std\src\sys_common\backtrace.rs:34
8: 0x7ff691becd29 - std::panicking::default_hook::closure$1
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library\std\src\panicking.rs:267
9: 0x7ff691bec9ab - std::panicking::default_hook
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library\std\src\panicking.rs:286
10: 0x7ff691bed5c0 - std::panicking::rust_panic_with_hook
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library\std\src\panicking.rs:688
11: 0x7ff691bed34e - std::panicking::begin_panic_handler::closure$0
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library\std\src\panicking.rs:579
12: 0x7ff691beb0cf - std::sys_common::backtrace::__rust_end_short_backtrace
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library\std\src\sys_common\backtrace.rs:137
13: 0x7ff691bed000 - std::panicking::begin_panic_handler
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library\std\src\panicking.rs:575
14: 0x7ff691c145d5 - core::panicking::panic_fmt
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library\core\src\panicking.rs:64
15: 0x7ff691c14a86 - core::result::unwrap_failed
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library\core\src\result.rs:1790
16: 0x7ff69196a96c - enum2$,glutin::error::Error> >::expect,glutin::error::Error>
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1\library\core\src\result.rs:1069
17: 0x7ff6919393c8 - eframe::native::run::glow_integration::GlutinWindowContext::new
at C:\git\egui\crates\eframe\src\native\run.rs:413
18: 0x7ff691939ad1 - eframe::native::run::glow_integration::GlowWinitApp::create_glutin_windowed_context
at C:\git\egui\crates\eframe\src\native\run.rs:505
19: 0x7ff691939c96 - eframe::native::run::glow_integration::GlowWinitApp::init_run_state
at C:\git\egui\crates\eframe\src\native\run.rs:521
20: 0x7ff69193b5da - eframe::native::run::glow_integration::impl$2::on_event
at C:\git\egui\crates\eframe\src\native\run.rs:733
21: 0x7ff6919632ba - eframe::native::run::run_and_return::closure$0
at C:\git\egui\crates\eframe\src\native\run.rs:140
22: 0x7ff691948b27 - winit::platform_impl::platform::event_loop::impl$3::run_return::closure$0,eframe::native::run::run_and_return::closure_env$0 >
at C:\Users\john\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.27.5\src\platform_impl\windows\event_loop.rs:254
23: 0x7ff6919614d4 - alloc::boxed::impl$46::call_mut > >,ref_mut$ > >,dyn$ >
at C:\Users\john\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.27.5\src\platform_impl\windows\event_loop\runner.rs:250
25: 0x7ff691987f34 - core::panic::unwind_safe::impl$23::call_once,winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0 > >
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1\library\core\src\panic\unwind_safe.rs:271
26: 0x7ff69197d598 - std::panicking::try::do_call > >,tuple$<> >
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1\library\std\src\panicking.rs:483
27: 0x7ff69197da43 - std::panicking::try::do_catch >,tuple$
28: 0x7ff69197cd50 - std::panicking::try,core::panic::unwind_safe::AssertUnwindSafe > > >
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1\library\std\src\panicking.rs:447
29: 0x7ff69195a9f2 - std::panic::catch_unwind > >,tuple$<> >
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1\library\std\src\panic.rs:140
30: 0x7ff69197219a - winit::platform_impl::platform::event_loop::runner::EventLoopRunner >::catch_unwind,tuple$<>,winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::clos
at C:\Users\john\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.27.5\src\platform_impl\windows\event_loop\runner.rs:157
31: 0x7ff69197420b - winit::platform_impl::platform::event_loop::runner::EventLoopRunner >::call_event_handler >
at C:\Users\john\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.27.5\src\platform_impl\windows\event_loop\runner.rs:242
32: 0x7ff691973af3 - winit::platform_impl::platform::event_loop::runner::EventLoopRunner >::call_new_events >
at C:\Users\john\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.27.5\src\platform_impl\windows\event_loop\runner.rs:402
33: 0x7ff6919731ec - winit::platform_impl::platform::event_loop::runner::EventLoopRunner >::move_state_to >
at C:\Users\john\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.27.5\src\platform_impl\windows\event_loop\runner.rs:312
34: 0x7ff691974cc7 - winit::platform_impl::platform::event_loop::runner::EventLoopRunner >::poll >
at C:\Users\john\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.27.5\src\platform_impl\windows\event_loop\runner.rs:206
35: 0x7ff691947e22 - winit::platform_impl::platform::event_loop::EventLoop >::run_return,eframe::native::run::run_and_return::closure_env$0 >
at C:\Users\john\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.27.5\src\platform_impl\windows\event_loop.rs:263
36: 0x7ff691967738 - winit::platform::run_return::impl$0::run_return,eframe::native::run::run_and_return::closure_env$0 >
at C:\Users\john\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.27.5\src\platform\run_return.rs:62
37: 0x7ff691962cee - eframe::native::run::run_and_return
at C:\git\egui\crates\eframe\src\native\run.rs:107
38: 0x7ff6919473ea - eframe::native::run::glow_integration::run_glow::closure$0
at C:\git\egui\crates\eframe\src\native\run.rs:852
39: 0x7ff691962726 - eframe::native::run::with_event_loop::closure$0
at C:\git\egui\crates\eframe\src\native\run.rs:96
40: 0x7ff69195f5f0 - std::thread::local::LocalKey > > > > >::try_with > > > > >::with
at C:\git\egui\crates\eframe\src\native\run.rs:89
43: 0x7ff69193ba3f - eframe::native::run::glow_integration::run_glow
at C:\git\egui\crates\eframe\src\native\run.rs:845
44: 0x7ff69192dc21 - eframe::run_native
at C:\git\egui\crates\eframe\src\lib.rs:192
45: 0x7ff69191317a - hello_world::main
at C:\git\egui\examples\hello_world\src\main.rs:13
46: 0x7ff69191348b - core::ops::function::FnOnce::call_once >
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1\library\core\src\ops\function.rs:250
47: 0x7ff691911bde - std::sys_common::backtrace::__rust_begin_short_backtrace >
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1\library\std\src\sys_common\backtrace.rs:121
48: 0x7ff691911bde - std::sys_common::backtrace::__rust_begin_short_backtrace >
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1\library\std\src\sys_common\backtrace.rs:121
49: 0x7ff691911b11 - std::rt::lang_start::closure$0 >
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1\library\std\src\rt.rs:166
50: 0x7ff691be358e - core::ops::function::impls::impl$2::call_once
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library\core\src\ops\function.rs:287
51: 0x7ff691be358e - std::panicking::try::do_call
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library\std\src\panicking.rs:483
52: 0x7ff691be358e - std::panicking::try
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library\std\src\panicking.rs:447
53: 0x7ff691be358e - std::panic::catch_unwind
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library\std\src\panic.rs:140
54: 0x7ff691be358e - std::rt::lang_start_internal::closure$2
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library\std\src\rt.rs:148
55: 0x7ff691be358e - std::panicking::try::do_call
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library\std\src\panicking.rs:483
56: 0x7ff691be358e - std::panicking::try
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library\std\src\panicking.rs:447
57: 0x7ff691be358e - std::panic::catch_unwind
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library\std\src\panic.rs:140
58: 0x7ff691be358e - std::rt::lang_start_internal
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1/library\std\src\rt.rs:148
59: 0x7ff691911aea - std::rt::lang_start >
at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1\library\std\src\rt.rs:165
60: 0x7ff691913329 - main
61: 0x7ff691c0a25c - invoke_main
at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
62: 0x7ff691c0a25c - __scrt_common_main_seh
at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
63: 0x7ff8de1f7614 - BaseThreadInitThunk
64: 0x7ff8df9826a1 - RtlUserThreadStart
error: process didn't exit successfully: `C:\git\egui\target\debug\hello_world.exe` (exit code: 101)
```
Meta
I aslo tried it on windows 10
10.0.19045.2364
and windows 1110.0.22621.963
all having the same error.