-
Notifications
You must be signed in to change notification settings - Fork 962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using two encoders in hello-triangle example causes hang #1877
Comments
Using
test.sh#!/bin/bash
cat >test.patch << EOF
diff --git a/wgpu/examples/hello-triangle/main.rs b/wgpu/examples/hello-triangle/main.rs
index 4d27af83..25cfef21 100644
--- a/wgpu/examples/hello-triangle/main.rs
+++ b/wgpu/examples/hello-triangle/main.rs
@@ -95,6 +95,11 @@ async fn run(event_loop: EventLoop<()>, window: Window) {
.get_current_frame()
.expect("Failed to acquire next swap chain texture")
.output;
+
+ *control_flow = ControlFlow::Exit;
+ let e2 = device.create_command_encoder(&wgpu::CommandEncoderDescriptor { label: None });
+ queue.submit(Some(e2.finish()));
+
let mut encoder =
device.create_command_encoder(&wgpu::CommandEncoderDescriptor { label: None });
{
EOF
cd wgpu/examples
if git apply test.patch && cargo build --example hello-triangle
then
# run project specific test and report its status
timeout 15 cargo run --example hello-triangle
status=$?
else
# tell the caller this is untestable
status=125
fi
cd ../..
# undo the tweak to allow clean flipping to the next commit
git reset --hard
# return control
exit $status |
Thank you for investigating! |
I just tried running with the validation layers included with SDK version 1.2.182.0, but they produced no output. Here is a copy of the API dump. The hang seems to be happening during the call to |
Not seeing any issue with this on Linux/NV |
Ubuntu 20.04.2, HD Graphics 630 (KBL GT2) I've just tried to reproduce this and I have black window not reacting on events for ~8 seconds, then triangle is displayed (and window can be closed). But it seems it is not related to 'using two encoders', I have the same behavior also on current wgpu master. When I force GL backend instead of VULCAN it works fine (triangle is displayed immediately) |
I'm using an Intel® HD Graphics 520 iGPU with mesa 21.2.1-1. There's no other GPU so the linked PR doesn't seem applicable. However reading #1672, I think this might be a duplicate of that given that the hang in |
This is to work around a problem in wgpu on intel gpus which causes hanging while dropping resources. More info: - gfx-rs/wgpu#1877 - gfx-rs/wgpu#1672
Description
Wgpu hangs when rendering a frame that involved multiple consecutive command encoders. This patch to the hello-triangle example is enough to trigger the bug.
Repro steps
Expected vs observed behavior
Expected hello-triangle example to run normally. Instead it displays all black and the window cannot be closed.
Platform
The text was updated successfully, but these errors were encountered: