egui: Can't run any of the examples in Windows, error "swap contol extrensions are not supported"

I tried to build few examples on Windows and was getting the error:

error: `-Csplit-debuginfo=unpacked` is unstable on this platform

Once I commented the line split-debuginfo = "unpacked" in root’s Cargo.toml, now I’m getting:

C:\git\egui\examples\hello_world>cargo run
warning: C:\git\egui\crates\eframe\Cargo.toml: unused manifest key: target.cfg(not(target_arch = "wasm32")).dependencies.glutin.es
   Compiling hello_world v0.1.0 (C:\git\egui\examples\hello_world)
    Finished dev [unoptimized + debuginfo] target(s) in 1.84s
     Running `C:\git\egui\target\debug\hello_world.exe`
Error: Glutin(Error { raw_code: None, raw_os_message: None, kind: NotSupported("swap contol extrensions are not supported") })
error: process didn't exit successfully: `C:\git\egui\target\debug\hello_world.exe` (exit code: 1)

If I run release version the .exe file just exits

C:\git\egui\examples\hello_world>cargo run --release
warning: C:\git\egui\crates\eframe\Cargo.toml: unused manifest key: target.cfg(not(target_arch = "wasm32")).dependencies.glutin.es
    Finished release [optimized] target(s) in 0.40s
     Running `C:\git\egui\target\release\hello_world.exe`
error: process didn't exit successfully: `C:\git\egui\target\release\hello_world.exe` (exit code: 1)

rustc version is fixed in rust-toolchain to 1.65.0-x86_64-pc-windows-msvc, however I tried to remove it and use 1.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<std::sys::windows::stdio::Stderr>
                               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<std::panicking::begin_panic_handler::closure_env$0,never$>
                               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$<core::result::Result<tuple$<>,glutin::error::Error> >::expect<tuple$<>,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<eframe::native::run::glow_integration::GlowWinitApp>
                               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<enum2$<eframe::native::run::UserEvent>,eframe::native::run::run_and_return::closure_env$0<eframe::native::run::glow_integration::GlowWinitApp> >
                               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<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::
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1\library\alloc\src\boxed.rs:1995
  24:     0x7ff691974493 - winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure$0<enum2$<eframe::native::run::UserEvent> >
                               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<tuple$<>,winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure_env$0<enum2$<eframe::native::run::UserEvent> > >
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1\library\core\src\panic\unwind_safe.rs:271
  26:     0x7ff69197d598 - 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$<> >
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1\library\std\src\panicking.rs:483
  27:     0x7ff69197da43 - std::panicking::try::do_catch<core::panic::unwind_safe::AssertUnwindSafe<std::thread::impl$0::spawn_unchecked_::closure$1::closure_env$0<winit::platform_impl::platform::event_loop::impl$3::new::closure_env$0<enum2$<eframe::native::run::UserEvent> >,tuple$
  28:     0x7ff69197cd50 - 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> > > >
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1\library\std\src\panicking.rs:447
  29:     0x7ff69195a9f2 - 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$<> >
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1\library\std\src\panic.rs:140
  30:     0x7ff69197219a - 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::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<enum2$<eframe::native::run::UserEvent> >::call_event_handler<enum2$<eframe::native::run::UserEvent> >
                               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<enum2$<eframe::native::run::UserEvent> >::call_new_events<enum2$<eframe::native::run::UserEvent> >
                               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<enum2$<eframe::native::run::UserEvent> >::move_state_to<enum2$<eframe::native::run::UserEvent> >
                               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<enum2$<eframe::native::run::UserEvent> >::poll<enum2$<eframe::native::run::UserEvent> >
                               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<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> >
                               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<enum2$<eframe::native::run::UserEvent>,eframe::native::run::run_and_return::closure_env$0<eframe::native::run::glow_integration::GlowWinitApp> >
                               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<eframe::native::run::glow_integration::GlowWinitApp>
                               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<eframe::native::run::glow_integration::run_glow::closure_env$0>
                               at C:\git\egui\crates\eframe\src\native\run.rs:96
  40:     0x7ff69195f5f0 - 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
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1\library\std\src\thread\local.rs:446
  41:     0x7ff69195f253 - 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::na
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1\library\std\src\thread\local.rs:422
  42:     0x7ff69196256c - eframe::native::run::with_event_loop<eframe::native::run::glow_integration::run_glow::closure_env$0>
                               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<void (*)(),tuple$<> >
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1\library\core\src\ops\function.rs:250
  47:     0x7ff691911bde - std::sys_common::backtrace::__rust_begin_short_backtrace<void (*)(),tuple$<> >
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1\library\std\src\sys_common\backtrace.rs:121
  48:     0x7ff691911bde - std::sys_common::backtrace::__rust_begin_short_backtrace<void (*)(),tuple$<> >
                               at /rustc/659e169d37990b9c730a59a96081f2ef7afbe8f1\library\std\src\sys_common\backtrace.rs:121
  49:     0x7ff691911b11 - std::rt::lang_start::closure$0<tuple$<> >
                               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<tuple$<> >
                               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

C:\git\egui\examples\hello_world>rustc --version --verbose
rustc 1.65.0 (897e37553 2022-11-02)
binary: rustc
commit-hash: 897e37553bba8b42751c67658967889d11ecd120
commit-date: 2022-11-02
host: x86_64-pc-windows-msvc
release: 1.65.0
LLVM version: 15.0.0

C:\git\egui\examples\hello_world>rustc --version --verbose
rustc 1.66.0 (69f9c33d7 2022-12-12)
binary: rustc
commit-hash: 69f9c33d71c871fc16ac445211281c6e7a340943
commit-date: 2022-12-12
host: x86_64-pc-windows-msvc
release: 1.66.0
LLVM version: 15.0.2

C:\git\egui\examples\hello_world>rustc +nightly --version --verbose
rustc 1.68.0-nightly (659e169d3 2023-01-04)
binary: rustc
commit-hash: 659e169d37990b9c730a59a96081f2ef7afbe8f1
commit-date: 2023-01-04
host: x86_64-pc-windows-msvc
release: 1.68.0-nightly
LLVM version: 15.0.6

I aslo tried it on windows 10 10.0.19045.2364 and windows 11 10.0.22621.963 all having the same error.

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 28 (9 by maintainers)

Most upvoted comments

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.

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.