4
votes

I am currently trying to force Visual Studio to use the debug layer dlls for Vulkan, but somehow it is unable to load the libraries. My steps were those:

  1. Clone https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/blob/master/BUILD.md
  2. Build for Visual Studio 2015 (Release and Debug)
  3. In my Vulkan Application i put this into the Environment variable (for x64 - Debug) (Project Settings -> Debugging): VK_LAYER_PATH=F:\Projects\Vulkan-LoaderAndValidationLayers\build\layers\Debug

When i start my application it runs until it tries to create the Instance, where it returns VK_ERROR_LAYER_NOT_PRESENT and i can see in the output window of Visual Studio that the dlls were indeed not loaded at all. If i just put the "normal" path to the Vulkan binaries in the path above it works fine again. I already checked that there are also the .json files present. This problem is also present if i try to use the Release-DLLs from the LoaderAndValidationLayers folder.

What am i doing wrong? Does anyone have any idea how to make this work?

EDIT: I found out that VK_LAYER_LUNARG_threading seems to be the problem. If i use VK_LAYER_LUNARG_standard_validation it does not load anything. If i just specify all layers included manually (described here: https://vulkan.lunarg.com/app/docs/v1.0.3.1/layers) without the VK_LAYER_LUNARG_threading layer it does work fine. Any idea why this might be?

2
I have also downloaded and built the Vulkan Loader and Layers from their Git. When I tried out the demos that came with it and turned on the validation, it was giving me the same layer not present error. I figured out that the same layer was causing issues; it had been renamed to the google one (VK_LAYER_GOOGLE_threading) in the demo layer string, but changing it back to VK_LAYER_LUNARG_threading caused it to work for me. Also running VulkanInfo.exe lists it as VK_LAYER_LUNARG_threading still so I guess they didn't change the name yet somewhere.graeme

2 Answers

1
votes

Looks like they've slightly changed names of the layers.

Here is the list that works for me:

const char* enabledLayerNames[] = {
    "VK_LAYER_GOOGLE_threading",
    "VK_LAYER_GOOGLE_unique_objects",
    "VK_LAYER_LUNARG_api_dump",
    "VK_LAYER_LUNARG_device_limits",
    "VK_LAYER_LUNARG_draw_state",
    "VK_LAYER_LUNARG_image",
    "VK_LAYER_LUNARG_mem_tracker",
    "VK_LAYER_LUNARG_object_tracker",
    "VK_LAYER_LUNARG_param_checker",
    "VK_LAYER_LUNARG_screenshot",
    "VK_LAYER_LUNARG_swapchain",
//     "VK_LAYER_LUNARG_vktrace",
};

(I just took "name" fields from "C:\VulkanSDK\1.0.5.0\Bin\VkLayer_*.json" files.)

"VK_LAYER_LUNARG_vktrace" is commented, because it provokes an error VK_ERROR_INITIALIZATION_FAILED ("Initialization of an object could not be completed for implementation-specific reasons") on my rig.

You might also want to check if HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\ExplicitLayers registry key has correct paths to the *.json files

My environment setup:

  • GPU Nvidia GeForce GT 730M (Kepler)
  • OS: Windows 10 x64
  • I've first installed fresh Nvidia driver v 364.51 (tick "clean installation")
  • uninstalled LunarG VulkanSDK 1.0.3 along with remains (with Revo Uninstaller)
  • then installed LunarG VulkanSDK 1.0.5

P.S. I haven't edited any files, nor registry. I haven't even recompiled for VS 2015. And it all still links and works somehow.

P.P.S. My physical device reports API version 1.0.4.

1
votes

Ok i think i found the problem. But i am still not 100% certain of why this occurs. I compared the two VkLayer_threading.json files and noticed that the names differ (i suspect a name change from version 1.0.3 to 1.0.5).

  • 1.0.3 ("name": "VK_LAYER_LUNARG_threading") -> 1.0.5 ("name": "VK_LAYER_GOOGLE_threading")

But even though i am also using the debug vulkan-1.lib loader library out of the Vulkan-LoaderAndValidationLayers repo (https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers) it is still unable to load the right library.

My strongest guess at the moment is that since the SDK for Windows is still on version 1.0.3.1 it also still uses the old name inside the meta-layer (VK_LAYER_LUNARG_threading) and thus is not finding the newly named layer. I edited the .json file for the moment and it works again.

EDIT: I just confirmed my guess. After installing the recently released 1.0.5 SDK-update for Windows, i had to undo my above renaming to get it working again. So be careful when using the most up-to-date version of the LoaderAndValidationLayers repo, because it could contain changes which are not yet reflected in the available SDK version.