VK_EXT_descriptor_heap ray query causes VK_ERROR_DEVICE_LOST

Summary

A minimal native Vulkan 1.4 compute application consistently returns VK_ERROR_DEVICE_LOST when an inline ray query uses an acceleration structure obtained from ResourceHeapEXT data.

The shader loads a raw 64-bit TLAS address from the resource heap, converts it with OpConvertUToAccelerationStructureKHR, and passes it to OpRayQueryInitializeKHR. This is a native Vulkan C++ reproduction with no Direct3D translation layer or game engine.

Reproducer: repository · tested commit

An earlier revision omitted the Vulkan shaderInt64 feature required by OpCapability Int64. That application-side issue is fixed in the revision above. The corrected revision still loses the device with Khronos validation and synchronization validation enabled, all implicit layers disabled, and no reported VUID or synchronization hazard.

Environment

  • OS: Windows 11 Pro 64-bit, build 26200
  • GPU: NVIDIA GeForce RTX 4070 Ti SUPER (0x10de:0x2705)
  • NVIDIA driver: 610.74
  • Device Vulkan API: 1.4.341
  • Vulkan SDK: 1.4.350.0
  • VK_EXT_descriptor_heap revision: 1
  • Slang: 2026.13

Expected and actual behavior

The dispatch should complete and report the expected triangle hit. Instead, submitting the dispatch and waiting for completion returns VK_ERROR_DEVICE_LOST:

GPU: NVIDIA GeForce RTX 4070 Ti SUPER, API 1.4.341
Driver: NVIDIA (610.74)
AS source=raw TLAS address + Slang OpConvertUToAccelerationStructureKHR, shaderStride=0x8
Dispatching Slang descriptor-heap AS ray query...
REPRODUCED: VK_ERROR_DEVICE_LOST

The executable deliberately returns process code 0, so the console message is the authoritative result.

Reproduction

The workload may reset an affected GPU. Please close GPU-sensitive work before running it.

git clone https://github.com/qian-o/VulkanRayQueryTriangle.git
cd VulkanRayQueryTriangle
git checkout 86ff48c50ac6848ec80261744ff6aeb2dbe55d11

cmake -S . -B build
cmake --build build --config Release

$env:VK_INSTANCE_LAYERS = "VK_LAYER_KHRONOS_validation"
$env:VK_LOADER_LAYERS_DISABLE = "~implicit~"
$env:VK_LAYER_VALIDATE_SYNC = "1"

.\build\Release\vulkan_descriptor_heap_ray_query_repro.exe

With VK_LOADER_LAYERS_DISABLE=~implicit~, the audited call chain contained only VK_LAYER_KHRONOS_validation followed by the NVIDIA ICD.

Shader evidence

CMake builds the shader with Slang 2026.13. spirv-val --target-env vulkan1.4 succeeds without diagnostics.

Relevant SPIR-V:

OpCapability RayQueryKHR
OpCapability Int64
OpCapability UntypedPointersKHR
OpCapability DescriptorHeapEXT
OpDecorate %_runtimearr_ulong ArrayStride 8
OpDecorate %slang_resourceHeap BuiltIn ResourceHeapEXT
%58 = OpUntypedAccessChainKHR %_ptr_UniformConstant %_runtimearr_ulong %slang_resourceHeap %54
%60 = OpLoad %ulong %58
%62 = OpConvertUToAccelerationStructureKHR %61 %60
OpRayQueryInitializeKHR %query %62 %uint_0 %uint_255 %98 %99 %100 %101

Validation and host audit

  • The application checks and enables every required feature, including shaderInt64, descriptorHeap, shaderUntypedPointers, rayQuery, accelerationStructure, and bufferDeviceAddress.
  • Both decorated shader resources have descriptor-heap mappings, and the pipeline uses the required null layout.
  • The raw TLAS address is stored immediately after the implementation-reserved heap range with the 8-byte stride generated by Slang.
  • Acceleration-structure addresses, scratch alignment, lifetimes, and BLAS-to-TLAS-to-compute barriers were audited.
  • Khronos validation plus synchronization validation reports no VUID, synchronization hazard, or shader diagnostic.
  • The failure persists with all third-party implicit layers disabled.

The known application-side issue is therefore fixed, and the remaining evidence points to an NVIDIA Vulkan driver issue involving VK_EXT_descriptor_heap, a raw acceleration-structure address, OpConvertUToAccelerationStructureKHR, and an inline ray query.

Request

Please reproduce this on an NVIDIA driver build and investigate why the dispatch loses the device. If an Nsight, Aftermath, crash-dump, or driver-internal capture is needed, please specify the preferred procedure.

Follow-up: I ran a frontend A/B experiment plus a third “mapped” variant to
isolate the fault. The repro repo
(GitHub - qian-o/VulkanRayQueryTriangle · GitHub) now contains all three
variants; build and run with:

vulkan_descriptor_heap_ray_query_repro.exe slang|glsl|mapped

A/B — same extension path, two independent shader frontends

I rewrote the same compute ray query in GLSL (glslang 16.3.0, Vulkan SDK
1.4.350.0) using GL_EXT_descriptor_heap. It exercises the same extension path
(descriptor heap + untyped pointers + ray query on the same TLAS) but emits a
typed acceleration-structure load from the resource heap, instead of the u64
load + OpConvertUToAccelerationStructureKHR pattern produced by Slang.

Results on the same machine (RTX 4070 Ti SUPER, driver 610.74):

  • slang variant (u64 heap load + OpConvertUToAccelerationStructureKHR):
    VK_ERROR_DEVICE_LOST
  • glsl variant (typed OpLoad of OpTypeAccelerationStructureKHR via
    OpUntypedAccessChainKHR): VK_ERROR_DEVICE_LOST

The device loss reproduces with two independent shader frontends and two
distinct SPIR-V patterns, so the problem is in the driver’s descriptor-heap AS
handling itself, not in any single compiler’s output.

Variant C — same heap, same TLAS, but no shader-side heap access

The third variant does not touch the resource heap from the shader at all: the
acceleration structure is a plain

layout(set = 0, binding = 2) uniform accelerationStructureEXT scene;

binding, resolved through a VkDescriptorSetAndBindingMappingEXT with
VK_DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_CONSTANT_OFFSET_EXT pointing at the
same TLAS at the same offset in the same resource heap. Its SPIR-V declares no
DescriptorHeapEXT / UntypedPointersKHR capabilities whatsoever.

Result: runs correctly — the ray query reports the expected triangle hit, no
device loss.

Summary: on driver 610.74, any shader-side access of an acceleration structure
stored in the resource heap — whether a typed AS load or a u64 load + convert —
loses the device, while the same heap-resident AS resolved by the driver
through a constant-offset mapping works fine. All three SPIR-V modules and
their disassemblies are attached.

shader.zip (7.2 KB)

I have also hit this bug in an independent exploration of descriptor heaps and acceleration structures. The only way to mitigate at the moment is to use traditional descriptor set mapping.

Environment:

  • NVIDIA GeForce RTX 4090
  • Driver 610.88 (also reproduced on 610.74)
  • Vulkan 1.4.341 device, app targeting 1.4.0
  • Vulkan SDK 1.4.357.0
  • glslang 16.4.0
  • Windows 11 (26200)

Same result table as in the original post: the TLAS declared as an unsized descriptor_heap array device-losts under both traceRayEXT and rayQueryEXT, while reaching the same heap slot through a VkDescriptorSetAndBindingMappingEXT with VK_DESCRIPTOR_MAPPING_SOURCE_HEAP_WITH_CONSTANT_OFFSET_EXT works. Storage images and uniform buffers as heap arrays work fine in the same shader; only the acceleration structure fails.

Validated with spirv-val --target-env vulkan1.4 passes, and the only capabilities are UntypedPointersKHR, DescriptorHeapEXT, RayTracingKHR, RayQueryKHR. No Int8/Int64. glslang emits a plain typed load, no OpConvertUToAccelerationStructureKHR:

%as_arr = OpTypeRuntimeArray %accelStruct
          OpDecorateId %as_arr ArrayStrideIdEXT %uint_64
%ptr    = OpUntypedAccessChainKHR %_ptr_UniformConstant %as_arr %resource_heap %int_0
%as     = OpLoad %accelStruct %ptr

I have a similar issue. It only happens when these three things are all present:

  • The TLAS is loaded with OpUntypedAccessChainKHR, OpLoad directly from the descriptor heap.
  • The TLAS descriptor is stored in the descriptor heap.
  • A traceRayEXT() call is made on that TLAS.

If all these criteria are met the traceRayEXT() never terminates. If you replace traceRayEXT() with an infinite loop the program behaves the same. The only workaround I found is to use descriptor set mapping, which requires changes to both the shader code and the host side code.

My guess is that the nvidia drivers have bug in their ray traversal code if the acceleration structure is obtained the way I explained above.

  • Driver version: 610.57.04
  • OS: arch
  • Vulkan api version: 1.4.341