Showing results for 
Search instead for 
Did you mean: 

OpenGL & Vulkan

Journeyman III
Journeyman III

[Vulkan] Driver crash when calling vkCmdCopyQueryPoolResults for blas compacted size

Calling vkCmdCopyQueryPoolResults to retrieve the compacted size of an acceleration structure is causing a crash in the driver. It works fine for the other query types (eg. timestamp and pipeline statistics).

The driver callstack is (base address of 00007FFFD64A0000):

amdvlk64.dll!00007fffd67ef7e3() Unknown
amdvlk64.dll!00007fffd682a279() Unknown
amdvlk64.dll!00007fffd64f3a3c() Unknown

amdvlk64.dll amdvlk64.dll C:\Windows\System32\DriverStore\FileRepository\u0362332.inf_amd64_0129053b8ff6a9cb\B362329\amdvlk64.dll N/A N/A Cannot find or open the PDB file. 248 27.20.14501.33001 12/16/2020 7:30 PM 00007FFFD64A0000-00007FFFD8B49000

0 Kudos
1 Reply
Journeyman III
Journeyman III

Re: [Vulkan] Driver crash when calling vkCmdCopyQueryPoolResults for blas compacted size

Steps to repro:


throw std::runtime_error("Device fails to support ray recursion (m_rtProperties.maxRayRecursionDepth <= 1)");

It's not necessary for this repro.

  • In hello_vulkan.cpp:724, replace:
    m_rtBuilder.buildBlas(allBlas, vk::BuildAccelerationStructureFlagBitsKHR::ePreferFastTrace);
    m_rtBuilder.buildBlas(allBlas, vk::BuildAccelerationStructureFlagBitsKHR::eAllowCompaction);
    To enable compaction.
  • In raytraceKHR_vk.hpp:312, use the following code to get the crash:
    nvvk::Buffer testBuffer =
    m_alloc->createBuffer(compactSizes.size() * sizeof uint32_t, VK_BUFFER_USAGE_TRANSFER_DST_BIT);
    vkCmdCopyQueryPoolResults(cmdBuf, queryPool, 0u,(uint32_t)compactSizes.size(), testBuffer.buffer, 0u, sizeof(uint32_t), VK_QUERY_RESULT_WAIT_BIT);

Moreover, in raytraceKHR_vk.hpp:312, the call to `vkGetQueryPoolResults` is returning an incorrect result. There are 2 blases, the second one gets a size of 0.


0 Kudos