KhronosGroup / Vulkan-ValidationLayers

Vulkan Validation Layers (VVL)
https://vulkan.lunarg.com/doc/sdk/latest/linux/khronos_validation_layer.html
Other
764 stars 403 forks source link

Request for clearer GPU assisted validation messages #5495

Closed DethRaid closed 1 year ago

DethRaid commented 1 year ago

Environment:

Describe the Issue

The GPU assisted validation's error message says I have an error at "descriptor index 0"

Expected behavior

The GPU assisted validation layer should say that I have an error at "descriptor set=0 binding=1"

Valid Usage ID

[2023-03-23 09:12:39.171] [error] [ERROR: Validation](user defined)
Validation Error: [ VUID-vkCmdDispatch-None-02706 ] Object 0: handle = 0x228199a3510, type = VK_OBJECT_TYPE_QUEUE; | MessageID = 0x9d0dde06 | Descriptor index 0 access out of bounds. Descriptor size is 524288 and highest byte accessed was 527363 Command buffer (0x2285f6c4600). Compute Index 0x34. Pipeline (Fine binning)(0xe9b2ee0000000094). Shader Module (0xd68cbb0000000091). Shader Instruction Index = 433.  Stage = Compute.  Global invocation ID (x, y, z) = (768, 0, 8 ) Shader validation error occurred in file D:/Source/SahRenderer/Windows/../RenderCore/shaders/voxelizer/binning_fine.comp at line 247.Unable to find suitable #line directive in SPIR-V OpSource. The Vulkan spec states: If the robust buffer access feature is not enabled, and if the VkPipeline object bound to the pipeline bind point used by this command accesses a storage buffer, it must not access values outside of the range of the buffer as specified in the descriptor set bound to the same pipeline bind point (https://vulkan.lunarg.com/doc/view/1.3.216.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdDispatch-None-02706)

Additional context

I enabled GPU assisted validation on my project and encountered the above error. The error states "descriptor index 0 access out of bounds". This was very confusing - I only have one descriptor set for this dispatch, and descriptor index 0 in this set has a size of 1179648! It appeared that the GPU assisted validation layer was simply wrong

After some debugging I realized that it was referring to descriptor index 1 inside of descriptor set 0. This was not clear at all from the error. The error message should clearly state which descriptor in which set had the out-of-bounds access, or at least be clear that it's talking about descriptor sets and not descriptors themselves

Additional context in the Vulkan Discord server: https://discord.com/channels/427551838099996672/427558253275250718/1088511714477232129

DethRaid commented 1 year ago

I've learned more. Apparently when the validation layer reports "descriptor index n" it isn't referring to the descriptor set or the descriptor binding. Instead, it's referring to an index in an array of descriptors

See Discord messages starting here https://discord.com/channels/427551838099996672/427558253275250718/1093924583700189345 for some more info

I had expected that the validation layer would tell me which descriptor set and/or which descriptor binding had the error. Instead, that information appears to be completely absent

I'd like to change this Issue to request that the GPU assisted validation messages tell me which descriptor set and binding encountered the error