Can't view captures due to crash when loading
Description
Whenever I try openening a frame capture qrenderdoc crashes with a segfault. It does not happen when capturing the frame or saving the capture to disk, only at the time of opening it. When closing qrenderdoc it seems to open the capture for a short time and this causes it to crash, too.
Steps to reproduce
Load the capture file provided (still looking into uploading it, will comment soon).
Environment
- QRenderDoc v1.21 (NO_GIT_COMMIT_HASH_DEFINED)
- Packaged for Arch - https://aur.archlinux.org/packages/renderdoc
- Graphics API: NVIDIA-SMI 515.65.01 Driver Version: 515.65.01 CUDA Version: 11.7
- Graphics Card: NVIDIA GeForce GTX 960
Ah, it works as a zip file: crash.zip
Can you please test with an official build or building directly from source on either a stable version or latest code? I do not support distribution-made packages and they're not considered reliable.
No problem, same issue with QRenderDoc v1.21 (98a93408c6df02502f9e7dbbc35fa234c8da024e)
This crash is caused by your application creating two devices simultaneously, which is not supported. I will look at adding an error return code in this case when the second device is created, but I have no plans to support this use case.
I'm not aware of creating two parallel devices. Also, why segfault on this. I'd be fine with an error message but Undefined Behavior seems excessive.
Ah, I might have misunderstood. The issue isn't just using two devices simultaneous but even having them requested from the adapter at the same time. Okay, yes, that would be an issue.
I don't know what you mean "requested from the adapter" as that isn't a terminology used in the vulkan API. If you mean enumerating physical devices via vkEnumeratePhysicalDevices, then that's fine to do. I'm saying that you can't call vkCreateDevice and create one device, then call vkCreateDevice again while the first is still alive. It's legal in vulkan but not something RenderDoc supports.
The segfault isn't deliberate, that's what a bug is. As I clearly said in the previous comment I will look at detecting this case and returning an error message instead.
Perfect, I understand now. vkDestroyDevice must have been called before the second device is created. I've got a library mapping to the underlying Vulkan calls, hence the difference in terminology. Thank you :+1:
Multiple calls to vkCreateDevice will now fail unless previous devices are destroyed, and send a message via debug reporting mechanisms.