Hi,
I’m integrating DLSS (super resolution only) into my vulkan app through GitHub - NVIDIA/DLSS: NVIDIA DLSS is a new and improved deep learning neural network that boosts frame rates and generates beautiful, sharp images for your games.
I’m getting a bunch of vulkan validation errors spamming my game logs due to vkCmdClearColorImage when dispatching DLSS. It seems like DLSS has an internal vkCmdClearColorImage call on the DLSS output texture, and it’s causing issues.
So far as I can tell:
- DLSS needs the TRANSFER_DST usage bit set on the output texture in order to be able to use vkCmdClearColorImage. This is not mentioned in section 3.4 of the DLSS programming guide. It’s only mentioned that the inputs need to be SRV, and the output UAV.
- Even after adding the usage bit, there are still write-after-write sync hazards. It seems like DLSS is missing a barrier internally.
Unfortunately I cannot debug this any further, as NSight shows the DLSS dispatch as an opaque API call (sidenote: NSight also does not show which resources the dispatch is using, nor does the DLSS dispatch show up in the resource use timeline, which makes debugging a huge pain).
2025-03-08T19:08:13.835163Z ERROR wgpu_hal::vulkan::instance: VALIDATION [VUID-vkCmdClearColorImage-image-00002 (0x636f8691)]
Validation Error: [ VUID-vkCmdClearColorImage-image-00002 ] Object 0: handle = 0x1e7721fea70, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x602e9b0000010c9f, name = main_texture_b, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0x636f8691 | vkCmdClearColorImage(): image (VkImage 0x602e9b0000010c9f[main_texture_b]) was created with usage VK_IMAGE_USAGE_TRANSFER_SRC_BIT|VK_IMAGE_USAGE_SAMPLED_BIT|VK_IMAGE_USAGE_STORAGE_BIT|VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT (missing VK_IMAGE_USAGE_TRANSFER_DST_BIT). The Vulkan spec states: image must have been created with VK_IMAGE_USAGE_TRANSFER_DST_BIT usage flag (https://vulkan.lunarg.com/doc/view/1.3.275.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdClearColorImage-image-00002)
2025-03-08T19:08:13.835523Z ERROR wgpu_hal::vulkan::instance: command buffers: dlss, dlss
2025-03-08T19:08:13.835638Z ERROR wgpu_hal::vulkan::instance: objects: (type: COMMAND_BUFFER, hndl: 0x1e7721fea70, name: ?), (type: IMAGE, hndl: 0x602e9b0000010c9f, name: main_texture_b)
2025-03-08T19:08:13.843695Z ERROR wgpu_hal::vulkan::instance: VALIDATION [SYNC-HAZARD-WRITE-AFTER-WRITE (0x5c0ec5d6)]
Validation Error: [ SYNC-HAZARD-WRITE-AFTER-WRITE ] Object 0: handle = 0x1e739bfe080, type = VK_OBJECT_TYPE_QUEUE; | MessageID = 0x5c0ec5d6 | vkQueueSubmit(): Hazard WRITE_AFTER_WRITE for entry 35, VkCommandBuffer 0x1e7721fea70[], Submitted access info (submitted_usage: SYNC_CLEAR_TRANSFER_WRITE, command: vkCmdClearColorImage, seq_no: 3, reset_no: 19). Access info (prior_usage: SYNC_IMAGE_LAYOUT_TRANSITION, write_barriers: SYNC_VERTEX_SHADER_SHADER_SAMPLED_READ|SYNC_VERTEX_SHADER_SHADER_STORAGE_READ|SYNC_VERTEX_SHADER_SHADER_STORAGE_WRITE|SYNC_VERTEX_SHADER_UNIFORM_READ|SYNC_FRAGMENT_SHADER_SHADER_SAMPLED_READ|SYNC_FRAGMENT_SHADER_SHADER_STORAGE_READ|SYNC_FRAGMENT_SHADER_SHADER_STORAGE_WRITE|SYNC_FRAGMENT_SHADER_UNIFORM_READ|SYNC_COMPUTE_SHADER_SHADER_SAMPLED_READ|SYNC_COMPUTE_SHADER_SHADER_STORAGE_READ|SYNC_COMPUTE_SHADER_SHADER_STORAGE_WRITE|SYNC_COMPUTE_SHADER_UNIFORM_READ, queue: VkQueue 0x1e739bfe080[], submit: 2039, batch: 0, batch_tag: 190278, command: vkCmdPipelineBarrier, command_buffer: VkCommandBuffer 0x1e7722080d0[(wgpu internal) Transit], seq_no: 2, VkImage 0x602e9b0000010c9f[main_texture_b], VkImage 0xac3a4f000000024d[], reset_no: 22).
2025-03-08T19:08:13.844115Z ERROR wgpu_hal::vulkan::instance: objects: (type: QUEUE, hndl: 0x1e739bfe080, name: ?)
2025-03-08T19:08:13.844425Z ERROR wgpu_hal::vulkan::instance: VALIDATION [SYNC-HAZARD-WRITE-AFTER-WRITE (0x5c0ec5d6)]
Validation Error: [ SYNC-HAZARD-WRITE-AFTER-WRITE ] Object 0: handle = 0x1e739bfe080, type = VK_OBJECT_TYPE_QUEUE; | MessageID = 0x5c0ec5d6 | vkQueueSubmit(): Hazard WRITE_AFTER_WRITE for entry 36, VkCommandBuffer 0x1e7721f8630[(wgpu internal) Pre Pass], Submitted access info (submitted_usage: SYNC_IMAGE_LAYOUT_TRANSITION, command: vkCmdPipelineBarrier, seq_no: 1, VkImage 0x66f2e90000010c9c[main_texture_a], VkImage 0x602e9b0000010c9f[main_texture_b], reset_no: 16). Access info (prior_usage: SYNC_CLEAR_TRANSFER_WRITE, write_barriers: 0, queue: VkQueue 0x1e739bfe080[], submit: 2039, batch: 0, batch_tag: 190285, command: vkCmdClearColorImage, command_buffer: VkCommandBuffer 0x1e7721fea70[], seq_no: 3, reset_no: 19).
2025-03-08T19:08:13.844801Z ERROR wgpu_hal::vulkan::instance: objects: (type: QUEUE, hndl: 0x1e739bfe080, name: ?)
Please let me know if you need any additional details or a reproduction project.
Thank you.