gfx-rs / wgpu

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

Black Window with Wayland + Integrated Graphics #5449

Open wyatt-herkamp opened 5 months ago

wyatt-herkamp commented 5 months ago

Description Black Window when running WGPU through the integrated graphics.

So if WGPU runs through the dedicated graphics card. Everything renders fine. But if it runs through the integrated graphics(AMD) it fails.

To specify the integrated cards. I set the environment variable WGPU_POWER_PREF to low

[2024-03-28T18:00:18Z INFO  wgpu_examples::framework] Initializing wgpu...
[2024-03-28T18:00:18Z INFO  wgpu_core::instance] Adapter Vulkan AdapterInfo { name: "AMD Radeon Graphics (RADV RAPHAEL_MENDOCINO)", vendor: 4098, device: 5710, device_type: IntegratedGpu, driver: "radv", driver_info: "Mesa 24.0.3", backend: Vulkan }
Mar 28 13:53:28 kingtux-local kwin_wayland[2443]: kwin_scene_opengl: 0x502: GL_INVALID_OPERATION error generated. <image> and <target> are incompatible

That message is repeated a few hundred times. I have a feeling this is either related to the Mesa drivers. However, I don't know how to test that. So I was going to bring it to WGPU to see if is related to WGPU or something else.

I did check journalctl for any logs that could be related.

Also I did test it with X11 and it just crashed with

[2024-03-28T17:44:48Z ERROR winit::platform_impl::platform] X11 error: XError {
        description: "BadMatch (invalid parameter attributes)",
        error_code: 8,
        request_code: 149,
        minor_code: 4,
    }
[2024-03-28T17:44:48Z ERROR winit::platform_impl::platform] X11 error: XError {
        description: "BadMatch (invalid parameter attributes)",
        error_code: 8,
        request_code: 149,
        minor_code: 4,
    }
[2024-03-28T17:44:48Z ERROR winit::platform_impl::platform] X11 error: XError {
        description: "BadMatch (invalid parameter attributes)",
        error_code: 8,
        request_code: 149,
        minor_code: 4,
    }
    Failed to focus input context: XError { description: "BadMatch (invalid parameter attributes)", error_code: 8, request_code: 149, minor_code: 4 }

However, that might be unrelated. Repro steps cargo run cube Also tested with a few of Iced examples Expected vs observed behavior Clearly describe what you get, and how it goes across your expectations.

Extra materials Screenshot_20240328_134852

Platform Linux 6.8.1 OpenSuse Tumbleweed CPU: AMD Ryzen 9 7950X 16-Core Processor GPU: NVIDIA GeForce RTX 3070 Ti/PCIe/SSE2(Proprietary drivers) KDE 6 with Wayland

wyatt-herkamp commented 5 months ago

Also I did test it with X11 and it just crashed with

So the error I got in X11 was reported. https://github.com/rust-windowing/winit/issues/3616