KhronosGroup / KhronosGroup/Vulkan-ValidationLayers

False positive with VUID-VkCopyAccelerationStructureInfoKHR-src-04963 and possibly other AS is_built checks

Open
#11,839 7 comments 0 reactions 2 assignees Claimed by @arno-lunarg View on GitHub
Incomplete RT Synchronization
Dominant language
C++
Stars
1k
Forks
504
Avg merge
11h 35m
Merged PRs (30d)
224

Description

Update - This is not tracking missing VU coverage (removed in https://github.com/KhronosGroup/Vulkan-ValidationLayers/pull/11841/changes)

- [ ] VUID-vkCmdBuildAccelerationStructuresKHR-pInfos-03667
- [ ] VUID-vkCmdBuildAccelerationStructuresIndirectKHR-pInfos-03667
- [ ] VUID-vkBuildAccelerationStructuresKHR-pInfos-03667
- [ ] VUID-vkWriteAccelerationStructuresPropertiesKHR-pAccelerationStructures-04964
- [ ] VUID-vkCmdWriteAccelerationStructuresPropertiesKHR-pAccelerationStructures-04964
- [ ] VUID-VkCopyAccelerationStructureInfoKHR-src-04963
- [ ] VUID-VkCopyAccelerationStructureToMemoryInfoKHR-src-04959
- [ ] VUID-vkCmdCopyAccelerationStructureKHR-src-11633 (added after)

**Environment:**
- OS: Windows
- GPU and driver version: NVIDIA
- SDK or header version if building from repo: commit 3774a604909122519f803c21b19adfc0fbb3c5e5
- Options enabled (synchronization, best practices, etc.): validation, sync val

**Describe the Issue**

I believe there is a false positive with the following error:

VK ERROR : VALIDATION - Message Id Number: -1088202432 | Message Id Name: VUID-VkCopyAccelerationStructureInfoKHR-src-04963
    vkCmdCopyAccelerationStructureKHR(): pInfo->src has not been built.
    The Vulkan spec states: The source acceleration structure src must have been constructed prior to the execution of this command (https://docs.vulkan.org/spec/latest/chapters/accelstructures.html#VUID-VkCopyAccelerationStructureInfoKHR-src-04963)

As far as I can see from reading VVL code, it is checking whether the acceleration structure was ever built on the CPU timeline, whereas it needs to check on the GPU timeline.

Imagine the following scenario:
- Thread 1 does `vkCmdCopyAccelerationStructureKHR` with source A and dst B
- Thread 2 calls `vkCmdCopyAccelerationStructureKHR` to do compaction of source C -> dst A.

In CPU timeline, Thread 1 happens first, Thread 2 happens second.

On GPU timeline, Thread 2 happens first, Thread 1 happens second.

Validation is throwing this error on the CPU timeline because it's not checking when the vkQueueSubmit for the copy occurred (at least, if I'm reading the code correctly).

**Expected behavior**
I think checking for this needs to be moved to vkQueueSubmit, it's the only time you can know whether the acceleration structure was built.

**Valid Usage ID**
VUID-VkCopyAccelerationStructureInfoKHR-src-04963

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.