-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
[wgpu branch] Vulkan Validation errors across all examples when run with --release
#458
Comments
Thanks for the time put into this!!! On
Running the other examples in release mode does not raise any validation layer errors though. If you need more tests, please let me know! |
Validation errors related to the semaphores are a sign that something is wrong with the swapchain. We've seen this done before: someone would get the next texture from the swapchain, but then drop it before submitting any work. The trick is that dropping a swapchain texture is a command to present it... but in this (early dropping) case no work has been done on it, and after presentation any submitted work shouldn't be using this any more. So it confuses We've actually patched this with an explicit error in gfx-rs/wgpu#497, but it didn't make it into 0.4 release, which by now is quite far behind. If you ask, we'll be happy to back-port the check. Fixing this is also trivial - just make sure the swapchain texture is alive by the time the relevant work is I made a fix in mitchmindtree#1 . Two things are important there:
Please let me know if you have any further issues :) |
Ahhh this seems obvious in retrospect! I think I still had the old vulkano model in mind where all images were reference counted and so I assumed they would live as long as they need to - this fix makes sense though. Thanks a lot kvark, I can confirm this clears those validation errors locally too :) @MacTuitui thanks for doing those tests! I'll tentatively close this for now and consider it solved - feel free to re-open if you're still running into that panic! Closed by mitchmindtree#1 |
This issue is related to the the wgpu branch at #452.
I've been attempting to do some investigating into a bug that @MacTuitui reported when attempting to run any of the examples on the #452 wgpu branch. See their error log and vulkaninfo output here.
Before the
panic!
occurs, we can see that the validation layers emit 5 separate errors:Curiously, if I enable
VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_standard_validation
I'm able to recreate this, however:--release
panic!
whether or not the errors appear - my system seems to be able to keep running. That said, I have an integrated intel GPU (here is my vulkaninfo output) whereas @MacTuitui has a dedicated nvidia GPU, so their panic could very well still be related to these validation layer errors.@MacTuitui also mentioned that they were able to successfully run the
hello-triangle.rs
example on the wgpu-rs master branch which implies the bug has something to do with the way nannou is using wgpu. I can also confirm that 4 out of 5 of the validation layer errors above do not show up when running the hello-triangle.rs example locally (with or without--release
).The nannou example that behaves most closely to the wgpu hello-triangle.rs example is the
wgpu_triangle_raw_frame
example. This example draws a single triangle directly to the swap chain image each timeRedrawRequested
occurs, as does the wgpu example. While nannou takes care of the adapter requesting, device requesting, swap chain creation and surface creation during window creation, I'm yet to find any obvious differences between this process and the wgpu hello-triangle example that could be causing these validation errors to show up.Validation Errors
The first error is related to an attempt at creation of an empty descriptor set pool.
The bug is already known and tracked at gfx-rs/wgpu-rs#149. While possibly related, I doubt this is the cause of the
panic!
as it occurs in both the nannou examples and the wgpu-rs hello-triangle example.The second error reports a queue waiting on a semaphore that can never be signaled.
I'm not sure how we could be causing this just yet, particularly as wgpu itself does not expose any of the device synchronisation primitive APIs directly. In the
wgpu_triangle_raw_frame
example we create a single device and queue during window creation and use this single queue to submit the command buffer built during the user'sview
function after it returns.Finally, the last three errors (presumably one for each swap chain image) are the same and report that the swap chain image is not in the correct layout for presentation:
Things to try
Recreation
You can recreate these errors by cloning my
wgpu
branch from #452 and running the following:@kvark does anything obvious come to mind that we might be doing wrong here? Also, are you able to recreate the case where the validation errors show up only when built and run with
--release
?@MacTuitui a couple more tests that might be useful in the meantime if you get a chance:
VK_INSTANCE_LAYERS=VK_LAYER_LUNARG_standard_validation cargo run --example wgpu_triangle_raw_frame
. I'm curious if you still see these validation layer errors when run in debug mode or if they only show up with--release
enabled for you too?hello-triangle
the only one that works? Or do all of the others work too? If any of those fail it might give us another hint as to what's going on.The text was updated successfully, but these errors were encountered: