• Advertisement
  • Popular Tags

  • Popular Now

  • Advertisement
  • Similar Content

    • By khawk
      LunarG has released new Vulkan SDKs for Windows, Linux, and macOS based on the 1.1.73 header. The new SDK includes:
      New extensions: VK_ANDROID_external_memory_android_hardware_buffer VK_EXT_descriptor_indexing VK_AMD_shader_core_properties VK_NV_shader_subgroup_partitioned Many bug fixes, increased validation coverage and accuracy improvements, and feature additions Developers can download the SDK from LunarXchange at https://vulkan.lunarg.com/sdk/home.

      View full story
    • By khawk
      LunarG has released new Vulkan SDKs for Windows, Linux, and macOS based on the 1.1.73 header. The new SDK includes:
      New extensions: VK_ANDROID_external_memory_android_hardware_buffer VK_EXT_descriptor_indexing VK_AMD_shader_core_properties VK_NV_shader_subgroup_partitioned Many bug fixes, increased validation coverage and accuracy improvements, and feature additions Developers can download the SDK from LunarXchange at https://vulkan.lunarg.com/sdk/home.
    • By mark_braga
      I have a pretty good experience with multi gpu programming in D3D12. Now looking at Vulkan, although there are a few similarities, I cannot wrap my head around a few things due to the extremely sparse documentation (typical Khronos...)
      In D3D12 -> You create a resource on GPU0 that is visible to GPU1 by setting the VisibleNodeMask to (00000011 where last two bits set means its visible to GPU0 and GPU1)
      In Vulkan - I can see there is the VkBindImageMemoryDeviceGroupInfoKHR struct which you add to the pNext chain of VkBindImageMemoryInfoKHR and then call vkBindImageMemory2KHR. You also set the device indices which I assume is the same as the VisibleNodeMask except instead of a mask it is an array of indices. Till now it's fine.
      Let's look at a typical SFR scenario:  Render left eye using GPU0 and right eye using GPU1
      You have two textures. pTextureLeft is exclusive to GPU0 and pTextureRight is created on GPU1 but is visible to GPU0 so it can be sampled from GPU0 when we want to draw it to the swapchain. This is in the D3D12 world. How do I map this in Vulkan? Do I just set the device indices for pTextureRight as { 0, 1 }
      Now comes the command buffer submission part that is even more confusing.
      There is the struct VkDeviceGroupCommandBufferBeginInfoKHR. It accepts a device mask which I understand is similar to creating a command list with a certain NodeMask in D3D12.
      So for GPU1 -> Since I am only rendering to the pTextureRight, I need to set the device mask as 2? (00000010)
      For GPU0 -> Since I only render to pTextureLeft and finally sample pTextureLeft and pTextureRight to render to the swap chain, I need to set the device mask as 1? (00000001)
      The same applies to VkDeviceGroupSubmitInfoKHR?
      Now the fun part is it does not work  . Both command buffers render to the textures correctly. I verified this by reading back the textures and storing as png. The left texture is sampled correctly in the final composite pass. But I get a black in the area where the right texture should appear. Is there something that I am missing in this? Here is a code snippet too
      void Init() { RenderTargetInfo info = {}; info.pDeviceIndices = { 0, 0 }; CreateRenderTarget(&info, &pTextureLeft); // Need to share this on both GPUs info.pDeviceIndices = { 0, 1 }; CreateRenderTarget(&info, &pTextureRight); } void DrawEye(CommandBuffer* pCmd, uint32_t eye) { // Do the draw // Begin with device mask depending on eye pCmd->Open((1 << eye)); // If eye is 0, we need to do some extra work to composite pTextureRight and pTextureLeft if (eye == 0) { DrawTexture(0, 0, width * 0.5, height, pTextureLeft); DrawTexture(width * 0.5, 0, width * 0.5, height, pTextureRight); } // Submit to the correct GPU pQueue->Submit(pCmd, (1 << eye)); } void Draw() { DrawEye(pRightCmd, 1); DrawEye(pLeftCmd, 0); }  
    • By turanszkij
      Hi,
      I finally managed to get the DX11 emulating Vulkan device working but everything is flipped vertically now because Vulkan has a different clipping space. What are the best practices out there to keep these implementation consistent? I tried using a vertically flipped viewport, and while it works on Nvidia 1050, the Vulkan debug layer is throwing error messages that this is not supported in the spec so it might not work on others. There is also the possibility to flip the clip scpace position Y coordinate before writing out with vertex shader, but that requires changing and recompiling every shader. I could also bake it into the camera projection matrices, though I want to avoid that because then I need to track down for the whole engine where I upload matrices... Any chance of an easy extension or something? If not, I will probably go with changing the vertex shaders.
    • By Alexa Savchenko
      I publishing for manufacturing our ray tracing engines and products on graphics API (C++, Vulkan API, GLSL460, SPIR-V): https://github.com/world8th/satellite-oem
      For end users I have no more products or test products. Also, have one simple gltf viewer example (only source code).
      In 2016 year had idea for replacement of screen space reflections, but in 2018 we resolved to finally re-profile project as "basis of render engine". In Q3 of 2017 year finally merged to Vulkan API. 
       
       
  • Advertisement
  • Advertisement
Sign in to follow this  

Vulkan Debugging this Vulkan crash

This topic is 751 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So I've slowly been throwing together a vulkan example so that I can get an understanding of how everything works.  Right now I get an access violation, and what I'm really wondering is if anyone has any suggestions on how to debug it.

 

I've read through SaschaWillems' code, and I thought I'd done everything he did (I've also compared it against the demo code that comes with the Lunar SDK, and everything seems in order).  But I get a crash when I call vkQueuePresentKHR, with the error being "Access violation reading location 0xBAADF00D".  So that's an interesting hex value, and googling it reveals that it's generally "used by Microsoft's LocalAlloc to indicate uninitialized allocated heap memory".  In my debugger (Visual Studio 2015), it pops open a window that says "No symbols loaded" and is looking for VkLayer_swapchain.dll.

 

 If I disable that call to vkQueuePresentKHR, the program will run (and obviously not display anything), but will crash on VkDestroySurfaceKHR, with an Access Violation at 0xBAADF025.  The combination of these crashes makes it seem like my surface is uninitialized, but I've walked through that code several times and everything seems in order.  I have checks for VK_SUCCESS on every vulkan function and nothing is failing or indicating an error.

 

So I'm not really looking to dump my Vulkan test code here, as it's a lot, and I'm not sure exactly where the issue is yet.  Really what I'm wondering is if anyone has any tips on debugging this problem.  Maybe a better way to look into VkLayer_swapchain.dll?

Share this post


Link to post
Share on other sites
Advertisement
Check the parameters you pass to vkQueuePresentKHR(). The second pointer in particular might have fields on it which are uninitialized. Check in the debugger, walk through all the pointers you can find that you are passing (either directly or indirectly) into that API.

Share this post


Link to post
Share on other sites

 

So I'm not really looking to dump my Vulkan test code here, as it's a lot, and I'm not sure exactly where the issue is yet.  Really what I'm wondering is if anyone has any tips on debugging this problem.  Maybe a better way to look into VkLayer_swapchain.dll?

 

 

The SDK actually ships with the debug versions of the validation layers in the Source\lib folders. The docs say:

 

Visual Studio 2015 is not officially supported, but can be used to build the demos and samples projects. Using Visual Studio 2015, however, only allows you to run the demos and samples if you use the Release version of the loader and layers.

Attempting to use the Debug versions of the SDK loader or layers (which have been built with VS 2013) will fail on loading MSVCR120.dll. This is because that DLL is a debug DLL shipped only with VS 2013.

 

So if you have VS 2013 or the VS 2013 redistributable package installed stepping into the validation layers should still work when you point VS2015 at the right .pdb and source files. I had to replace the release version dlls in the Bin fold with the debug ones to make them load, not sure if there is a better way.

If there is a problem with using the VS 2013 binaries with VS 2015 you could also build the debug layers yourself, but I have not tried that yet... https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/blob/master/BUILD.md

 

Share this post


Link to post
Share on other sites

Eternal, that is a great help.  Copying those dlls and pointing the compiler to the appropriate .pdb file lets me see what the specific error is.

 

It's a crash in the aforementioned vkQueuePresentKHR function.  The code crashes at:

 

                                   if ((pSurface->numQueueFamilyIndexSupport >
                                         queueFamilyIndex) &&
                                        (!pSurface->pQueueFamilyIndexSupport
                                              [queueFamilyIndex])) {
 
The problem is that pSurface->pQueueFamilyIndexSupport is not an initialized value.  pSurface->numQueueFamilyIndexSupport is 3452816845, which allows this decision to access pQueueFamilyIndexSupport even though it's not valid.
 
This decision is to check if the surface is supported for present operations.  I believe I've followed the code identically to find a queue that supports both graphics operations and present.  I don't understand why numQueueFamilyIndexSupport is such a big value.  When creating the swapchain, I set the queueFamilyIndexCount and pQueueFamilyIndices fields of the VkSwapchainCreateInfoKHR structure to 0 and nullptr respectively.

Share this post


Link to post
Share on other sites
Your number is equal to 0xCDCDCDCD, which is a debugger poison value used to indicate that you allocated memory but did not initialize it. I'm guessing this a straightforward case of user error in that you don't init a member that you're supposed to.

Share this post


Link to post
Share on other sites

After finally circling back to this, I discovered that the problem was that when creating the VkInstance, I was only using the extension "VK_KHR_SURFACE_EXTENSION_NAME."  As I am doing this on Windows, I needed "VK_KHR_WIN32_SURFACE_EXTENSION_NAME."

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement