-
Notifications
You must be signed in to change notification settings - Fork 404
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
Incorrect SYNC-HAZARD-WRITE-AFTER-READ error with vkCmdPipelineBarrier2 applied to suballocated buffers #8502
Comments
There's likely some relationship with #3605 Basically, the range of a buffer resource is not taken into account in syncval (it seems) |
Yes, looks like the dynamic offset part is fixed: https://chromium-review.googlesource.com/c/angle/angle/+/5873529 We're still getting false positives because the vertex buffer ranges are not taken into account (it seems) |
Should be fixed by #8674 |
It doesn't look like this was about indirect buffers only though. I tried removing this suppression and we still get VVL failures: https://chromium-review.googlesource.com/c/angle/angle/+/5937422 Typically, the failures we see are in the form of vertex-attribute usage reported not synced with transfer, but those are happening to different ranges of the buffer. |
The error message in this issue is exactly what did not work (indirect command that accesses index or vertex buffer which are suballocated) but I might miss something.
@ShabbyX I'm not sure where I need to look for the errors in the above link, could you help to locate it? |
I'm going to use angle directly for testing to be sure. Will be looking into this tomorrow, hopefully we will fix this. |
@ShabbyX could you confirm that Also should I apply any patches to the latest angle code? My impression that the first patch (https://chromium-review.googlesource.com/c/angle/angle/+/5832709/4) is already merged but not the second (https://chromium-review.googlesource.com/c/angle/angle/+/5832710/10). |
That test is fixed, I can confirm. Unsuppressing related VVL errors in https://chromium-review.googlesource.com/c/angle/angle/+/5937422, there are other failures, not related to indirect buffers. You don't need to cherry-pick anything, it has nothing to do with https://chromium-review.googlesource.com/c/angle/angle/+/5832710 and the issue is in fact much older than that. Try taking that first change (unsuppresses VVL errors) and run this test:
|
Ooooh you know what, I think actually I know where this is coming from. If you're confident that syncval is taking buffer ranges into account, the VVL issue probably goes away for us if we use I remember now we had the same problem with robustness, where we couldn't rely on robustness with vertex data in conjunction with suballocation because the driver couldn't tell where the end of the data is. Feel free to re-close for now. |
I can reproduce error with
I can see a potential problem here (and the same with vertex attributes access). The error says data was written by a copy command and then read by the vertex pipeline but sync validation did not detect a barrier that ensures writes can be used by the following read access (write_barriers: 0). Could it be a missing/incomplete barrier in angle? If you think everything is okay then I can debug sync validation to confirm false positive and if that's the case then it should be a separate issue. |
No like I said I'm pretty sure this is just a matter of You can close this, when we get a chance to use |
We are trying to follow the direction now that syncval does not report false positives. Ether to disable specific validation or to make it optional (disabled by default). Something I need to look at. |
Makes sense, my brain was somewhere else |
Sounds good. I guess an easy way to still have some validation for vertex attributes but also remove false positives is to implicitly assume You won't catch bugs with overlapping areas used for different purposes, but that should be very rare. You would correctly catch syncval errors for the usual usage of a buffer range being used as one entity (because one byte represents the entire thing) |
Environment:
Describe the Issue
To reproduce:
https://chromium-review.googlesource.com/c/angle/angle/+/5832709/4 (patchset 4)
https://chromium-review.googlesource.com/c/angle/angle/+/5832710/10 (patchset 10)
gn args out/LinuxDebug
autoninja -C out/LinuxDebug angle_end2end_tests
out/LinuxDebug/angle_end2end_tests --gtest_filter="LineLoopIndirectTest.UShortIndexIndirectBuffer/ES3_1_Vulkan" --verbose --local-output
Observe that the test failed with this validation error:
Expected behavior
Test should pass without the SYNC-HAZARD-WRITE-AFTER-READ validation error.
Valid Usage ID
If applicable, please include the validation messages encountered leading up to the issue
Additional context
The renderdoc capture shows that VVL thinks there is a missing execution barrier on the VkBuffer:
VkBuffer used as index buffer for vkCmdDrawIndexed()
--- VVL thinks there is a missing execution barrier---
VkBuffer used as dest buffer for vkCmdCopyImageToBuffer()
However, the two buffers are suballocated. Even they belong to the same big VkBuffer, they are actually pointing to different memories.
We think that using
VK_KHR_Synchronization2
exposed this issue in VVL. Before we useVK_KHR_Synchronization2
, thesrcStageMask
anddstStageMask
are shared betweenVkMemoryBarrier
,VkBufferMemoryBarier
, andVkImageMemoryBarrier
. in thevkCmdPipelineBarrier ()
call. Between thevkCmdDrawIndex()
andvkCmdCopyImageToBuffer()
, even if only image barrier is needed, thesrcStageMask
anddstStageMask
values also apply to theVkMemoryBarrier
andVkBufferMemoryBarrier
, and it fulfills VVL's validation on buffer execution barrier (even there is no execution barrier needed on buffer because they are suballocated and point to different memories). After switching toVK_KHR_Synchronization2
, thesrcStageMask
anddstStageMask
are packed within theVkMemoryBarrier2
,VkBufferMemoryBarier2
,VkImageMemoryBarrier2
. So now ifVkMemoryBarrier2
is null, there is no execution barrier applied to VkBuffer, and VVL incorrectly thinks that there is a missing execution barrier on the buffer.The text was updated successfully, but these errors were encountered: