I have encountered a crash in our Vulkan application when capturing frames in NSight Graphics for debugging.
This is intermittent (75% repro) and seems to occur in the “Refreshing event timings” phase. Sometimes a capture succeeds, but hitting “Refresh Event Timings” later repro’s the crash.
Attaching a debugger to our application before capturing the frame allows us to see the call stack. Our presentation thread is executing vkQueuePresentKHR. A separate thread has a stack involving the NVidia driver and NSight interception dll:
ucrtbase.dll!thread_start<unsigned int (__cdecl*)(void *),1>()
I have replicated this with a minified C++ capture. The capture is also crashing intermittently, without the rest of the application logic.
In the minified repro, we have a single render pass and draw call using a vertex buffer that has been uploaded in a separate transfer queue with a staging buffer. Performing the vkCmdCopyBuffer on the graphics queue rather than the separate transfer queue seems to mask the issue.
Also, please note that we are using both VK_KHR_imageless_framebuffer and VK_KHR_synchronization2. I noticed that the generated VulkanReplay.cpp code does not support overriding image views for swapchain images in the chained VkRenderPassAttachmentBeginInfo structure in VulkanReplay_CmdBeginRenderPass2. It appears that this is implemented only for VulkanReplay_CmdBeginRenderPass. Calling vkCmdBeginRenderPass rather than vkCmdBeginRenderPass2 does not seem to work around the issue; however.
Please advise if I can provide more details to help.
Thank you kindly,
- Kearwood “Kip” Gilbert