gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.
https://wgpu.rs
Apache License 2.0
12.07k stars 874 forks source link

OpenGL fails to initialize on Nvidia Linux #4751

Open krakow10 opened 9 months ago

krakow10 commented 9 months ago

Description Run wgpu with OpenGL on linux, and the initialization fails with the error message 'Surface isn't supported by the adapter.' This happens on both Wayland and x11 (Tested in four configurations as listed in #4689), perhaps exclusively with the nvidia proprietary driver but I didn't test anything else.

Repro steps RUST_LOG=trace WGPU_BACKEND=gl cargo run --bin skybox

Expected vs observed behavior Expect example to launch.

Observed error log ``` [quat@quat-desktop wgpu]$ RUST_LOG=trace WGPU_BACKEND=gl cargo run --bin skybox Finished dev [unoptimized + debuginfo] target(s) in 0.26s Running `target/debug/skybox` [2023-11-22T11:33:02Z DEBUG sctk] Bound new global [50] wl_output v4 [2023-11-22T11:33:02Z DEBUG sctk] Bound new global [51] wl_output v4 [2023-11-22T11:33:02Z DEBUG sctk] Bound new global [52] wl_output v4 [2023-11-22T11:33:02Z DEBUG sctk] Bound new global [49] zxdg_output_manager_v1 v3 [2023-11-22T11:33:02Z DEBUG sctk] Bound new global [14] wl_seat v7 [2023-11-22T11:33:02Z DEBUG sctk] Bound new global [40] wp_cursor_shape_manager_v1 v1 [2023-11-22T11:33:02Z DEBUG sctk] supported wl_shm format Argb8888 [2023-11-22T11:33:02Z DEBUG sctk] supported wl_shm format Xrgb8888 [2023-11-22T11:33:02Z DEBUG sctk] supported wl_shm format Xbgr8888 [2023-11-22T11:33:02Z DEBUG sctk] supported wl_shm format Abgr8888 [2023-11-22T11:33:02Z DEBUG sctk] supported wl_shm format Bgr888 [2023-11-22T11:33:02Z DEBUG sctk] supported wl_shm format Rgbx4444 [2023-11-22T11:33:02Z DEBUG sctk] supported wl_shm format Rgba4444 [2023-11-22T11:33:02Z DEBUG sctk] supported wl_shm format Rgbx5551 [2023-11-22T11:33:02Z DEBUG sctk] supported wl_shm format Rgba5551 [2023-11-22T11:33:02Z DEBUG sctk] supported wl_shm format Rgb565 [2023-11-22T11:33:02Z DEBUG sctk] supported wl_shm format Xbgr16161616f [2023-11-22T11:33:02Z DEBUG sctk] supported wl_shm format Abgr16161616f [2023-11-22T11:33:02Z DEBUG sctk] supported wl_shm format Xbgr16161616 [2023-11-22T11:33:02Z DEBUG sctk] supported wl_shm format Abgr16161616 [2023-11-22T11:33:02Z TRACE calloop::loop_logic] [calloop] Inserting new source #0 [2023-11-22T11:33:02Z TRACE calloop::loop_logic] [calloop] Inserting new source #1 [2023-11-22T11:33:02Z TRACE calloop::loop_logic] [calloop] Inserting new source #2 [2023-11-22T11:33:02Z INFO wgpu_example::framework] Initializing wgpu... [2023-11-22T11:33:02Z INFO wgpu_example::framework] Using NVIDIA GeForce RTX 3080 Ti/PCIe/SSE2 (Gl) [2023-11-22T11:33:02Z INFO wgpu_example::framework] Entering event loop... [2023-11-22T11:33:02Z INFO wgpu_example::framework] Surface resume PhysicalSize { width: 800, height: 600 } thread 'main' panicked at 'Surface isn't supported by the adapter.', examples/common/src/framework.rs:188:14 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace [2023-11-22T11:33:02Z ERROR wgpu_hal::gles::egl] EGL 'eglMakeCurrent' code 0x3006: EGL_BAD_CONTEXT error: In eglMakeCurrent: Invalid EGLContext (0x55d606434b51) thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: BadContext', wgpu-hal/src/gles/egl.rs:305:14 stack backtrace: 0: 0x55d604a225ea - std::backtrace_rs::backtrace::libunwind::trace::h9a6b80bbf328ba5d at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5 1: 0x55d604a225ea - std::backtrace_rs::backtrace::trace_unsynchronized::hd162ec543a11886b at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 2: 0x55d604a225ea - std::sys_common::backtrace::_print_fmt::h78a5099be12f51a6 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:65:5 3: 0x55d604a225ea - ::fmt::ha1c5390454d74f71 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:44:22 4: 0x55d604a4819f - core::fmt::write::h9ffde816c577717b at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/fmt/mod.rs:1254:17 5: 0x55d604a1f095 - std::io::Write::write_fmt::h88186074961638e4 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/io/mod.rs:1698:15 6: 0x55d604a223b5 - std::sys_common::backtrace::_print::h184198273ed08d59 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:47:5 7: 0x55d604a223b5 - std::sys_common::backtrace::print::h1b4d8e7add699453 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:34:9 8: 0x55d604a2393e - std::panicking::default_hook::{{closure}}::h393bcea75423915a at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:269:22 9: 0x55d604a236e5 - std::panicking::default_hook::h48c64f31d8b3fd03 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:288:9 10: 0x55d604a23e9e - std::panicking::rust_panic_with_hook::hafdc493a79370062 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:691:13 11: 0x55d604a23d99 - std::panicking::begin_panic_handler::{{closure}}::h0a64bc82e36bedc7 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:582:13 12: 0x55d604a22a56 - std::sys_common::backtrace::__rust_end_short_backtrace::hc203444fb7416a16 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:150:18 13: 0x55d604a23af2 - rust_begin_unwind at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:578:5 14: 0x55d603734dd3 - core::panicking::panic_fmt::h0f6ef0178afce4f2 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/panicking.rs:67:14 15: 0x55d603735373 - core::result::unwrap_failed::h8090202169109f9c at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/result.rs:1687:5 16: 0x55d6044d9a57 - core::result::Result::unwrap::h32bb4b6caf08f940 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/result.rs:1089:23 17: 0x55d60452b6fd - wgpu_hal::gles::egl::EglContext::make_current::h854e685d7e243586 at /home/quat/git/learnings-rs/wgpu/wgpu-hal/src/gles/egl.rs:303:9 18: 0x55d604555262 - wgpu_hal::gles::egl::AdapterContext::lock::{{closure}}::h5875156fca0955d9 at /home/quat/git/learnings-rs/wgpu/wgpu-hal/src/gles/egl.rs:417:13 19: 0x55d6044cd91e - core::option::Option::map::hace2f44671507d89 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/option.rs:1099:29 20: 0x55d60452b956 - wgpu_hal::gles::egl::AdapterContext::lock::h43bc0774e5d3bf29 at /home/quat/git/learnings-rs/wgpu/wgpu-hal/src/gles/egl.rs:416:19 21: 0x55d60458030e - wgpu_hal::gles::device:: for wgpu_hal::gles::Device>::destroy_buffer::hd6bd6ef410255963 at /home/quat/git/learnings-rs/wgpu/wgpu-hal/src/gles/device.rs:618:23 22: 0x55d6041ab702 - as core::ops::drop::Drop>::drop::h74c1a56dc56a7c1f at /home/quat/git/learnings-rs/wgpu/wgpu-core/src/device/resource.rs:149:13 23: 0x55d604186657 - core::ptr::drop_in_place>::h41898970897c46e2 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/ptr/mod.rs:490:1 24: 0x55d603f8af80 - alloc::sync::Arc::drop_slow::hec7e1c7d01bb6a73 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/alloc/src/sync.rs:1259:18 25: 0x55d60418ce06 - as core::ops::drop::Drop>::drop::hd8d3578d892e7a76 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/alloc/src/sync.rs:1886:13 26: 0x55d60416d66b - core::ptr::drop_in_place>>::ha345171e7c133e67 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/ptr/mod.rs:490:1 27: 0x55d604170166 - core::ptr::drop_in_place>>::h400a019c7aefca1f at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/ptr/mod.rs:490:1 28: 0x55d6041727d0 - core::ptr::drop_in_place<[wgpu_core::storage::Element>]>::hb9931117ac98ac5b at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/ptr/mod.rs:490:1 29: 0x55d603fb1730 - alloc::vec::Vec::clear::he7506c0554143443 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/alloc/src/vec/mod.rs:2034:13 30: 0x55d6042a46b9 - wgpu_core::hub::Hub::clear::hdfcc9e6687b99099 at /home/quat/git/learnings-rs/wgpu/wgpu-core/src/hub.rs:267:9 31: 0x55d60419402d - as core::ops::drop::Drop>::drop::h0ffe789afe3323cd at /home/quat/git/learnings-rs/wgpu/wgpu-core/src/global.rs:175:13 32: 0x55d60418af57 - core::ptr::drop_in_place>::h7ed13e7c145f4866 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/ptr/mod.rs:490:1 33: 0x55d6041807a4 - core::ptr::drop_in_place::ha95db22cfcbc9cb3 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/ptr/mod.rs:490:1 34: 0x55d604180d20 - core::ptr::drop_in_place::hc2a0ecf8f30fb205 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/ptr/mod.rs:490:1 35: 0x55d603f8a47b - alloc::sync::Arc::drop_slow::h15494905ec9b972f at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/alloc/src/sync.rs:1259:18 36: 0x55d60418ba3d - as core::ops::drop::Drop>::drop::h098bc693f13e1725 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/alloc/src/sync.rs:1886:13 37: 0x55d60418467b - core::ptr::drop_in_place>::h7ae83e44e06f189f at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/ptr/mod.rs:490:1 38: 0x55d603cb8167 - core::ptr::drop_in_place::hc5694fe9e6a89861 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/ptr/mod.rs:490:1 39: 0x55d60375b9f7 - core::ptr::drop_in_place::h6fc20f7be7e9ac0d at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/ptr/mod.rs:490:1 40: 0x55d60375ac69 - core::ptr::drop_in_place::{{closure}}::{{closure}}>::h9ecfe17b09ce22a3 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/ptr/mod.rs:490:1 41: 0x55d60378c95d - winit::platform_impl::platform::wayland::event_loop::EventLoop::run_on_demand::h9d5fab1d8a478666 at /home/quat/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.3/src/platform_impl/linux/wayland/event_loop/mod.rs:221:5 42: 0x55d60375782d - winit::platform_impl::platform::EventLoop::run_on_demand::hfb3223e6458bc50d at /home/quat/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.3/src/platform_impl/linux/mod.rs:821:56 43: 0x55d603757876 - winit::platform_impl::platform::EventLoop::run::h45b9433fa78a9361 at /home/quat/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.3/src/platform_impl/linux/mod.rs:814:9 44: 0x55d603762507 - winit::event_loop::EventLoop::run::h2d9993d7aea40658 at /home/quat/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.3/src/event_loop.rs:249:9 45: 0x55d60377a9de - wgpu_example::framework::start::{{closure}}::h1c8e8b93e281681b at /home/quat/git/learnings-rs/wgpu/examples/common/src/framework.rs:380:13 46: 0x55d60377e279 - pollster::block_on::h9d027fd586984fa1 at /home/quat/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pollster-0.3.0/src/lib.rs:128:15 47: 0x55d60377a33d - wgpu_example::framework::run::h959700d62e3c2fef at /home/quat/git/learnings-rs/wgpu/examples/common/src/framework.rs:467:13 48: 0x55d603771de2 - skybox::main::h6f718839b0b6f983 at /home/quat/git/learnings-rs/wgpu/examples/skybox/src/main.rs:460:5 49: 0x55d60375a2eb - core::ops::function::FnOnce::call_once::h1ac7b537d490aea1 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/ops/function.rs:250:5 50: 0x55d6037508de - std::sys_common::backtrace::__rust_begin_short_backtrace::h4a9da20eb2ba9cc4 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:134:18 51: 0x55d603780c01 - std::rt::lang_start::{{closure}}::h08684f8b9acd001c at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/rt.rs:166:18 52: 0x55d604a1a3fe - core::ops::function::impls:: for &F>::call_once::hb1327dc2ef3fecdf at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/ops/function.rs:287:13 53: 0x55d604a1a3fe - std::panicking::try::do_call::h4044173225fe83dd at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:485:40 54: 0x55d604a1a3fe - std::panicking::try::hd8a722c09d156a53 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:449:19 55: 0x55d604a1a3fe - std::panic::catch_unwind::hd2ca07971cf0119b at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panic.rs:140:14 56: 0x55d604a1a3fe - std::rt::lang_start_internal::{{closure}}::h26d89d595cf47b70 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/rt.rs:148:48 57: 0x55d604a1a3fe - std::panicking::try::do_call::hf47aa1aa005e5f1a at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:485:40 58: 0x55d604a1a3fe - std::panicking::try::h73d246b2423eaf4e at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:449:19 59: 0x55d604a1a3fe - std::panic::catch_unwind::hbaaeae8f1b2f9915 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panic.rs:140:14 60: 0x55d604a1a3fe - std::rt::lang_start_internal::h76f3e81e6b8f13f9 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/rt.rs:148:20 61: 0x55d603780bda - std::rt::lang_start::hf0f78026e0df610d at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/rt.rs:165:17 62: 0x55d603771e0e - main 63: 0x7f2118758cd0 - 64: 0x7f2118758d8a - __libc_start_main 65: 0x55d603736005 - _start 66: 0x0 - thread panicked while panicking. aborting. Aborted (core dumped) ```

Extra materials None

Platform OS: Archlinux x86-64 Nvidia Driver: 545.29.02, 535.113.01 GPU: 3080 Ti DE: Hyprland, XFCE

pcapriotti commented 9 months ago

I'm seeing the same failure on a very similar setup (nvidia, archlinux, opengl backend). I've tracked it down to this line:

// Android emulator can't natively present either.
let tier_threshold = if cfg!(target_os = "android") || cfg!(windows) {
    1
} else {
    2
};
return Ok((config, tier_max >= tier_threshold));

which is completely preventing non-native rendering on linux. I'm not exactly sure what "native rendering" means, but would it make sense to allow tier 1 for other targets as well, or at least make this configurable?

See also: https://forums.developer.nvidia.com/t/egl-native-renderable-gives-zero-configs/47710.

John-Nagle commented 5 months ago

Tried to run a Rend3 application on Wayland. Ubuntu 22.04 LTS, NVidia driver 535, Wgpu 0.19, NVidia 3070.

Result:

04:44:50 [WARN] Unrecognized device error ERROR_INITIALIZATION_FAILED 04:44:50 [ERROR] ===> FATAL ERROR: Error in Surface::configure: Validation Error

Caused by: Parent device is lost at file /home/john/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.19.1/src/backend/wgpu_core.rs, line 724 in thread main. <=== 04:44:51 [ERROR] =========> Panic Error in Surface::configure: Validation Error

Caused by: Parent device is lost at file /home/john/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.19.1/src/backend/wgpu_core.rs, line 724 in thread main. Backtrace: libcommon::common::commonutils::catch_panic::{{closure}} at /home/john/projects/sl/SL-test-viewer/libcommon/src/common/commonutils.rs:215:25 wgpu::backend::wgpu_core::ContextWgpuCore::handle_error_fatal at /home/john/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.19.1/src/backend/wgpu_core.rs:283:9

::surface_configure at /home/john/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.19.1/src/backend/wgpu_core.rs:724:13 ::surface_configure at /home/john/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.19.1/src/context.rs:2124:9 wgpu::Surface::configure at /home/john/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.19.1/src/lib.rs:4817:9 rend3::surface::configure_surface at /home/john/.cargo/git/checkouts/rend3-issue570-7a55d7cece9b9b17/bafdc3b/rend3/src/surface.rs:15:5 rend3_framework::async_start::{{closure}}::{{closure}} at /home/john/.cargo/git/checkouts/rend3-issue570-7a55d7cece9b9b17/bafdc3b/rend3-framework/src/lib.rs:217:9 rend3_framework::async_start::{{closure}} at /home/john/.cargo/git/checkouts/rend3-issue570-7a55d7cece9b9b17/bafdc3b/rend3-framework/src/lib.rs:212:18 pollster::block_on at /home/john/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pollster-0.3.0/src/lib.rs:128:15 rend3_framework::start at /home/john/.cargo/git/checkouts/rend3-issue570-7a55d7cece9b9b17/bafdc3b/rend3-framework/src/lib.rs:472:9
Icemic commented 5 months ago

Same issue on Deepin 20.9 with Nvidia 510 driver and 1660Ti. But no "EGL_BAD_CONTEXT".

```bash icemic@Icemic-Deepin:~/workspace/wgpu$ RUST_BACKTRACE=1 DISPLAY=:0 RUST_LOG=trace WGPU_BACKEND=gl cargo run --bin wgpu-examples skybox Finished dev [unoptimized + debuginfo] target(s) in 0.17s Running `target/debug/wgpu-examples skybox` [2024-03-11T09:31:23Z TRACE calloop::loop_logic] [calloop] Inserting new source #0 [2024-03-11T09:31:23Z TRACE calloop::loop_logic] [calloop] Inserting new source #1 [2024-03-11T09:31:23Z INFO winit::platform_impl::platform::x11::window] Guessed window scale factor: 1 [2024-03-11T09:31:23Z DEBUG winit::platform_impl::platform::x11::window] Calculated physical dimensions: 800x600 [2024-03-11T09:31:23Z INFO wgpu_examples::framework] Initializing wgpu... [2024-03-11T09:31:23Z INFO wgpu_core::instance] Adapter Gl AdapterInfo { name: "NVIDIA GeForce GTX 1660 Ti/PCIe/SSE2", vendor: 4318, device: 0, device_type: Other, driver: "", driver_info: "", backend: Gl } [2024-03-11T09:31:23Z INFO wgpu_examples::framework] Using NVIDIA GeForce GTX 1660 Ti/PCIe/SSE2 (Gl) [2024-03-11T09:31:23Z INFO wgpu_examples::framework] Entering event loop... [2024-03-11T09:31:23Z INFO wgpu_examples::framework] Surface resume PhysicalSize { width: 800, height: 600 } thread 'main' panicked at examples/src/framework.rs:188:14: Surface isn't supported by the adapter. 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_display at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:196:5 3: core::panicking::panic_str at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:171:5 4: core::option::expect_failed at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/option.rs:1980:5 5: core::option::Option::expect at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/option.rs:894:21 6: wgpu_examples::framework::SurfaceWrapper::resume at ./examples/src/framework.rs:186:26 7: wgpu_examples::framework::start::{{closure}}::{{closure}} at ./examples/src/framework.rs:395:21 8: core::ops::function::impls:: for &mut F>::call_mut at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/ops/function.rs:294:13 9: winit::platform_impl::platform::x11::EventLoop::single_iteration at /home/icemic/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.11/src/platform_impl/linux/x11/mod.rs:545:9 10: winit::platform_impl::platform::x11::EventLoop::pump_events at /home/icemic/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.11/src/platform_impl/linux/x11/mod.rs:438:13 11: winit::platform_impl::platform::x11::EventLoop::run_on_demand at /home/icemic/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.11/src/platform_impl/linux/x11/mod.rs:405:19 12: winit::platform_impl::platform::EventLoop::run_on_demand at /home/icemic/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.11/src/platform_impl/linux/mod.rs:829:56 13: winit::platform_impl::platform::EventLoop::run at /home/icemic/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.11/src/platform_impl/linux/mod.rs:822:9 14: winit::event_loop::EventLoop::run at /home/icemic/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.11/src/event_loop.rs:249:9 15: wgpu_examples::framework::start::{{closure}} at ./examples/src/framework.rs:390:13 16: pollster::block_on at /home/icemic/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pollster-0.3.0/src/lib.rs:128:15 17: wgpu_examples::framework::run at ./examples/src/framework.rs:482:13 18: wgpu_examples::skybox::main at ./examples/src/skybox/mod.rs:467:5 19: wgpu_examples::main at ./examples/src/main.rs:229:5 20: 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. ```

vulkan works fine

ghashy commented 4 months ago

The same issue on Fedora 36, imac 2012, wayland, gnome: Vendor: NVIDIA Corporation Renderer: NVIDIA GeForce GTX 675MX/PCIe/SSE2 Version: OpenGL ES 3.2 NVIDIA 470.182.03 SL version: OpenGL ES GLSL ES 3.20

alokedesai commented 6 days ago

Any update on this? The fact that an NVIDIA adapter isn't supported when rendering via OpenGL seems like a bug in WGPU (especially when I can see that other applications can render using OpenGL on my NVIDIA discrete GPU just fine)

Posting output of glxinfo -B below:

glxinfo -B
name of display: :1
display: :1  screen: 0
direct rendering: Yes
Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 8188 MB
    Total available memory: 8188 MB
    Currently available dedicated video memory: 7085 MB
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce RTX 4060 Laptop GPU/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 545.29.06
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6.0 NVIDIA 545.29.06
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)

OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 545.29.06
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20