Vulkan App enabling renderdoc layer causes ERROR_INITIALIZATION_FAILED
Closed this issue · 3 comments
Description
Creating a vulkan instance with VK_LAYER_RENDERDOC_Capture
specified as a layer causes it to error with ERROR_INITIALIZATION_FAILED
, with no further detail provided.
However, every other way to start an application with renderdoc functions correctly:
- launching through Renderdoc's UI
- vkconfig with
VK_LAYER_RENDERDOC_Capture
force enabled LD_PRELOAD=librenderdoc.so
as env varENABLE_VULKAN_RENDERDOC_CAPTURE=1
as env var
If the vulkan application specifies the renderdoc layer, it will always error, regardless if any of the other methods listed above would have enabled renderdoc anyways.
This only started happening since I updated my Renderdoc to 1.32 today, previously I ran a 1.30 beta build with commit 3eccdc7.
Steps to reproduce
Based on SaschaWillems' Vulkan Examples
- In
base/vulkanexamplebase.cpp
l.131 change the stringVK_LAYER_KHRONOS_validation
toVK_LAYER_RENDERDOC_Capture
- Choose any example, like
examples/triangle
- In it's
VulkanExample
constructor (l.116 in the triangle example) addsettings.validation = true;
- run the example and observe in stderr:
ERROR: [1][
Could not create Vulkan instance :
ERROR_INITIALIZATION_FAILED
Environment
- RenderDoc version: 1.32
- Operating System: Ubuntu 32.10, KDE Plasma via wayland
- Graphics API: Vulkan, Mesa RADV 23.2.1-1ubuntu3.1, AMDVLK 2024.Q1.2
- Vulkan SDK: 1.3.280.0
Only the first method you mentioned is supported and intended to work. None of the others are documented and there is nothing anywhere to suggest these should work. Trying to hack RenderDoc to work in unsupported ways may misbehave or crash. Generally I do not recommend ever having vkconfig open at the same time as RenderDoc as it has caused a number of problems in the past.
If you want to capture your program from RenderDoc you should launch it from the UI. Never specify the layer manually or try to enable internal undocumented functionality.
If the only official way to launch an App with RenderDoc is via it's UI, there does not seem to be a way an application can programmatically attach RenderDoc, is there?
You can save a capture settings file for your application with 'auto start' enabled and launch the UI program with that settings file, which will then run your program.
Otherwise you can use the python replay API, which has access to do capturing, replaying and analysis all programmatically which is how the automated tests run.