baldurk / renderdoc

RenderDoc is a stand-alone graphics debugging tool.
https://renderdoc.org
MIT License
8.62k stars 1.3k forks source link

Headless Vulkan with enabled validation layers leads to stucked StartFrameCapture call #3316

Closed PolarNick239 closed 1 month ago

PolarNick239 commented 1 month ago

Note that this issue is just for those who may encounter the same problem, because I found the fix - see Workaround below.

Thanks a lot for all your work! This project is great and very helpful!

Description

I have App that uses rendering via Vulkan API in headless mode (without GUI). Due to headless mode - I followed the guide about in-app API and added RenderDoc shared library dynamic loading and these two calls:

std::cout << "going to call StartFrameCapture..." << std::endl;
global_rdoc_api->StartFrameCapture(NULL, NULL);
std::cout << "StartFrameCapture() finished!" << std::endl;
...
// my calls to Vulkan API
...
global_rdoc_api->EndFrameCapture(nullptr, nullptr);

After that I tried to capture my rendering - launched my App from the RenderDoc GUI, but sadly I observed that call to StartFrameCapture(NULL, NULL) stuck (i.e. this call never finishes) - I ensured that this is so due to the fact thet the first output is printed ("going to call StartFrameCapture..."), but not the second output (no "StartFrameCapture() finished!" in console).

Steps to reproduce

I cannot share my App, but I already found the fix - so this issue is just for those who may encounter the same problem.

The workaround/The fix

My App always loads Validation layer, and when I disabled Validation layers - everything worked, call to StartFrameCapture(NULL, NULL) now finishes successfully and RenderDoc GUI shows the captured frame.

Environment