RenderDoc builtin Vulkan compute pipelines fail to create
This is a very simple Vulkan app (just clears the screen, no rendering) I can provide source code for my test app if needed. (VS2015 project) Compiled as 64bit release mode. Win 7 64bit, AMD HD7770, driver: AMD Radeon™ Software Beta for Vulkan™ Version 16.15.1009 Beta 5
I've attached Vulkan logs captured by my app. (this is as much as I recorded, it keeps going though. It seems RenderDoc's overlay is the issue?)
Also note: I load all the debug/validation layers and the debug extension
Yes if you're able to share the source that would be great, since I know there can be debug output but I'd need something more to track down the crash itself.
Some of those messages are expected (e.g. all of the [SC] messages) as they are false positives. Unfortunately there's no real way for me to mute them so they will get sent to the app. I'm hoping that eventually the validation layers will improve so that they're not sent.
Others aren't expected - e.g. particularly the compute pipelines failing to create. I'll double check but I think compute should be supported unconditionally, so it might be a driver issue there. Those pipelines aren't needed during capturing but they will be needed on replay.
Which version of the layers are these messages from - are you running with a recent version from github, or the prebuilt layers from SDK 1.0.3.1?
@Ashalah: Is the vkCreateComputePipelines() call returning the same VK_ERROR_INITIALIZATION_FAILED error code if launched outside RenderDoc, but with validation layers enabled? What if they are disabled?
Furthermore, some of the errors reported by the validation layer will be critical for our driver. I didn't check the app code, but I'd suggest dealing with this problems first:
All the [SC] layer errors. Your descriptor sets seem to be incompatible with the descriptor set layout.
Warning: [DS] Code 11: Source AccessMask 0 [None] must have required access bit 16384 [VK_ACCESS_HOST_WRITE_BIT] when layout is VK_IMAGE_LAYOUT_PREINITIALIZED, unless the app has previously added a barrier for this transition.
Error: [DS] Code 60: VkDescriptorSet (0x9dd4c40) bound as set #2 has dynamic offset 36880. Combined with offet 0 and range 0x1000 from its update, this oversteps its buffer (0x9dd4d20) which has a size of 0xa000.
Both errors could result in the crash you're seeing.
FWIW I tried to repro earlier today but didn't get any crashes on my NV system, I need to test on AMD though to see what happens there. Those vkCreateComputePipelines() calls though are coming from RenderDoc's compute pipelines so I know they aren't generally broken everywhere, it might only be on that card or something.
The VK_ACCESS_HOST_WRITE error I don't think is a problem, it was leftover from when the text atlas texture sat in host-accessible memory and was preinitialized, but the data wasn't actually being used. Should be fixed with this commit.
The dynamic offset is also fixed with this commit - short story was that I had a buffer that was vec4[256] but the shader was only reading e.g. 32 of them, so the 'rest' of the buffer was poking off the end of the memory. Possibly undefined behaviour or possibly valid, I'm not sure. It's fixed now anyway.
As to the [SC] errors, I would need to check these in detail but last time I looked they were all false positives, that's why I blanket ignore SC for now. The problem seems to be that the shader checker layer doesn't understand to only check for descriptors that are actually referenced in the shader. I declare all my uniform buffers in the same file for convenience but each shader only actually uses one or the other of them. The layer though will error about unused descriptors that overlap or are otherwise bound. That's why you see the same errors repeated many times - they will be repeated for every shader that doesn't use a particular uniform buffer.
I'm OOO for the next two days, but I'm adding this on my list of things to look at right after I'm back in the office.
There's probably a problem with that code, it doesn't have a semaphore between the command buffer that clears the screen and the present call, but I doubt it'll help. I'll check again tonight with RenderDoc and reupload the fixed code.
No change. I also tried a clean uninstall of the AMD drivers (using their clean tool), and reinstalling drivers, just in case.
Are you able to get a callstack and/or error information of exactly where the crash happens? I mentioned above that those compute shaders failing to compile shouldn't affect the actual capture (although it'll be a problem on replay), so I'm wondering what the actual crash you're hitting is.
Sorry, it's not actually crashing, just hitting my DebugBreak() when the validation layer hits an error, which is "crashing" it. I've disabled my log function (commented out a call to vkCreateDebugReportCallbackEXT) and now it actually runs under RenderDoc. It prints text OK over my window, and I can capture a frame and see the Vulkan calls I've made. I must have been tired last night and did not realize this situation, sorry for the confusion.
With vkCreateDebugReportCallbackEXT on, it's breaking on an error with the message pMsg = 0x000000000028bb60 "var 47 (type 46) in uniform interface in descriptor slot (0,0) conflicts with existing definition" and the callstack looks like this:

/edit: so to clarify, the validation layers are showing errors, but RenderDoc is actually working if I ignore the validation layers. (which are still on)
Ahhh, I understand now. Sorry I thought you meant you were hitting an actual crash after those messages in vulkan_log.txt.
I'll keep working on getting RenderDoc as validation message free as possible during capture so that it doesn't trigger application handlers like this. At least at the moment though there are false positives and things, but I've heard at least the shader checker messages should be improved on the latest master build of the validation layers so I will test that.
The more serious bug is the compute pipeline failing to create, so I'm going to morph this bug slightly with a rename :).
RE: your crash upload, it looks like the code isn't properly handling those NULL compute pipelines and is crashing in the AMD driver trying to destroy them. At least going by the callstack. I should be able to determine if that's the case just by deliberately breaking the compute pipeline creation.
Capturing another time after capturing once will implicitly close the first logfile, so it is probably the same bug manifesting.
That's what I thought happened, but today I remembered that DebugBreak() isn't ignored if a debugger is not attached, it actually terminates the process, including in release mode. I confused it with my Assert macro, which gets turned off in release mode. My bad! I should really take Sundays off I guess!
Anything here at this point you guys would like me to have a look at?
I'd be interested to see if you can repro the compute pipelines failing to create - I don't think I got that on my AMD machine, but it's an R9 290 rather than HD7770 which might make a difference? If there's something to fix on my side for that, I don't know about it.
Could this have something to do with the CS problem I reported a few weeks ago, where RenderDoc attempted to use a compute shader which relied on local work-group size that exceeded the spec-defined limits? This only affected older hardware generations.
Ashalah: can you confirm you're using the latest RenderDoc build, compiled from source code checked out from this repository? The SDK version of the debugger has a confirmed issue which could be causing the crash.
If that is not the case, I wouldn't mind getting my hands on a working executable I could use to try to reproduce the issue.
You could be right actually, I didn't connect the dots and think to ask about that.
@Ashalah there are pre-built binaries available nightly on the builds page that you can use to try quickly without needing to build RenderDoc yourself. Please let us know if you still see the error messages about compute pipelines failing to create on a recent build.
I am hoping to do at least a new beta release once I am back from GDC, if not a new stable release, as there are a few important fixes to distribute.
Yep, I can do that tomorrow or Friday the latest. I'll let you know.
@baldurk I took his current source, removed all the DebugBreak and could reproduce the NULL result from vkCreateComputePipelines in an old x64 build of RenderDoc.
Bisecting the nightlies I found that going from 2016-02-22 (3e37e1a1) to 2016-02-23 (e17e02d1), those failures disappear from DebugView's output.
I've got a Windows 10 (10586.104) x64 OS, HD7870 and the Feb25 drivers labelled "Version 16.15.1009 Beta 5".
Yup, that includes 07c4274 which is where the discussed fix has been applied.