Open krakow10 opened 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.
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
Same issue on Deepin 20.9 with Nvidia 510 driver and 1660Ti. But no "EGL_BAD_CONTEXT".
vulkan works fine
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
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
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 -Extra materials None
Platform OS: Archlinux x86-64 Nvidia Driver: 545.29.02, 535.113.01 GPU: 3080 Ti DE: Hyprland, XFCE