Skip to content

When running the examples on Vulkan on an AMD 6900 XT, surface.get_current_texture() times out the first time each frame  #2941

Open
@expenses

Description

@expenses

Description

I'm running a setup where I have a laptop with an integrated GPU a (Intel(R) Xe Graphics (TGL GT2), connected to a AMD Radeon RX 6900 XT in turn connected to an external display.

I'm running this on (Arch) Linux with Wayland, but this happens with X11 too.

I don't have any problems running the examples normally, as this defaults to the integrated GPU. When I run the examples with WGPU_ADAPTER_NAME=AMD though, I get a timeout every frame:

[2022-08-04T20:44:51Z INFO  wgpu_core::device] configuring surface with SurfaceConfiguration { usage: RENDER_ATTACHMENT, format: Bgra8UnormSrgb, width: 956, height: 500, present_mode: Fifo }
[2022-08-04T20:44:52Z ERROR cube::framework] A timeout was encountered while trying to acquire the next frame
[2022-08-04T20:44:52Z INFO  wgpu_core::device] configuring surface with SurfaceConfiguration { usage: RENDER_ATTACHMENT, format: Bgra8UnormSrgb, width: 956, height: 500, present_mode: Fifo }
[2022-08-04T20:44:52Z ERROR cube::framework] A timeout was encountered while trying to acquire the next frame
[2022-08-04T20:44:52Z INFO  wgpu_core::device] configuring surface with SurfaceConfiguration { usage: RENDER_ATTACHMENT, format: Bgra8UnormSrgb, width: 956, height: 500, present_mode: Fifo }
[2022-08-04T20:44:52Z ERROR cube::framework] A timeout was encountered while trying to acquire the next frame
[2022-08-04T20:44:52Z INFO  wgpu_core::device] configuring surface with SurfaceConfiguration { usage: RENDER_ATTACHMENT, format: Bgra8UnormSrgb, width: 956, height: 500, present_mode: Fifo }
[2022-08-04T20:44:52Z ERROR cube::framework] A timeout was encountered while trying to acquire the next frame
[2022-08-04T20:44:52Z INFO  wgpu_core::device] configuring surface with SurfaceConfiguration { usage: RENDER_ATTACHMENT, format: Bgra8UnormSrgb, width: 956, height: 500, present_mode: Fifo }
[2022-08-04T20:44:52Z ERROR cube::framework] A timeout was encountered while trying to acquire the next frame
[2022-08-04T20:44:52Z INFO  wgpu_core::device] configuring surface with SurfaceConfiguration { usage: RENDER_ATTACHMENT, format: Bgra8UnormSrgb, width: 956, height: 500, present_mode: Fifo }
[2022-08-04T20:44:52Z ERROR cube::framework] A timeout was encountered while trying to acquire the next frame
[2022-08-04T20:44:52Z INFO  wgpu_core::device] configuring surface with SurfaceConfiguration { usage: RENDER_ATTACHMENT, format: Bgra8UnormSrgb, width: 956, height: 500, present_mode: Fifo }
[2022-08-04T20:44:52Z ERROR cube::framework] A timeout was encountered while trying to acquire the next frame
[2022-08-04T20:44:52Z INFO  wgpu_core::device] configuring surface with SurfaceConfiguration { usage: RENDER_ATTACHMENT, format: Bgra8UnormSrgb, width: 956, height: 500, present_mode: Fifo }
[2022-08-04T20:44:52Z ERROR cube::framework] A timeout was encountered while trying to acquire the next frame

The only change I've made to the source code is logging the error:

diff --git a/wgpu/examples/framework.rs b/wgpu/examples/framework.rs
index 0d8ed6df..7df445d5 100644
--- a/wgpu/examples/framework.rs
+++ b/wgpu/examples/framework.rs
@@ -361,7 +361,8 @@ fn start<E: Example>(
 
                 let frame = match surface.get_current_texture() {
                     Ok(frame) => frame,
-                    Err(_) => {
+                    Err(error) => {
+                        log::error!("{}", error);
                         surface.configure(&device, &config);
                         surface
                             .get_current_texture()

This happens on both the amdvlk and amdvlk-pro drivers.

It seems like this isn't meant to happen, but it doesn't seem to make the performance worse than expected.

Extra materials
Zip-compressed API traces and GPU captures can also land here.

Here's a log with RUST_LOG=trace:

log.zip

Platform

OS: Arch Linux x86_64 5.18.15-arch1-2
Window Manager: sway version 1.7
CPU: 11th Gen Intel i7-1165G7 (8) @ 4.700GHz
See the links above for vulkan.gpuinfo.org device reports.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: wsiIssues with swapchain management or windowingbackend: vulkanIssues with Vulkanhelp requiredWe need community help to make this happen.type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions