如何使 VK_LAYER_KHRONOS_validation 可用?

How to make VK_LAYER_KHRONOS_validation available?

解决方案:

  1. 卸载 vulkan
  2. 在注册表中 HKLM\SOFTWARE\Khronos\Vulkan\ExplicitLayers 和 HKLM\SOFTWARE\WOW6432Node\Khronos\Vulkan\ExplicitLayers 删除所有内容
  3. 重新安装 vulkan

我最近开始学习如何使用 Vulkan。我正在关注 this tutorial but even with a copy/paste of their code 我收到一个错误,因为当我调用 vkEnumerateInstanceLayerProperties().

时未列出 VK_LAYER_KHRONOS_validation

在 Vulkan 配置器中,VK_LAYER_KHRONOS_validation 出现在右侧面板中但不在底部面板中(我不确定此配置器的用途但底部有一个“可用层”类别面板和上面写的名字是 vkEnumerateInstanceLayerProperties()).

列出的那个
Vulkan Development Status:
- Layers override: "Validation" configuration
- VULKAN_SDK environment variable: D:\Games\lib\Vulkan.2.176.1
- Vulkan Loader version: 1.2.141
- User-Defined Layers Paths from VK_LAYER_PATH environment variable: None
- User-Defined Layers Paths from Vulkan Configurator: None
- Available Layers:
    - VK_LAYER_NV_optimus (1.2.142)
    - VK_LAYER_VALVE_steam_overlay (1.2.136)
    - VK_LAYER_VALVE_steam_fossilize (1.2.136)
    - VK_LAYER_EOS_Overlay (1.2.136)
    - VK_LAYER_EOS_Overlay (1.2.136)
    - VK_LAYER_OBS_HOOK (1.2.131)
    - VK_LAYER_OBS_HOOK (1.2.131)
- Physical Devices:
    - GeForce GTX 950 (Discrete GPU) with Vulkan 1.2.142

我发现的其他教程使用 VK_LAYER_LUNARG_standard_validation 但它也不起作用并且是 Deprecated.

那么我是否需要手动安装验证层,如果是,在哪里? 如果没有,为什么 VK_LAYER_KHRONOS_validation 不可用,我该如何使用它?

我确定我遗漏了一些明显的东西 ç_ç。


补充信息:

  • 我正在编译 x64
  • 我已经 uninstalled/reinstalled sdk 但它仍然无法正常工作
  • 错误信息是:validation layers requested, but not available!
  • SDK 是 2021 年 5 月 5 日的 1.2.176.1。我下载了 SDK Installer(.exe 第一个)
  • 要获得可用层,代码是:
uint32_t layerCount;
vkEnumerateInstanceLayerProperties(&layerCount, nullptr);
std::vector<VkLayerProperties> availableLayers(layerCount);
vkEnumerateInstanceLayerProperties(&layerCount, availableLayers.data());
  • 如果我跳过验证,错误消息是:(顺便说一句,为什么 Rockstar Game 第 3 行??)
validation layer: loaderGetDeviceRegistryFiles: GUID for 23 is not SoftwareComponent skipping
validation layer: loaderGetDeviceRegistryFiles: GUID for 24 is not SoftwareComponent skipping
validation layer: loader_get_json: Failed to open JSON file C:\Program Files\Rockstar Games\Social Club\SocialClubVulkanLayer.json
validation layer: loader_get_json: Failed to open JSON file D:\Games\lib.2.176.1\Bin\VkLayer_api_dump.json
validation layer: loader_get_json: Failed to open JSON file D:\Games\lib.2.176.1\Bin\VkLayer_device_simulation.json
validation layer: loader_get_json: Failed to open JSON file D:\Games\lib.2.176.1\Bin\VkLayer_gfxreconstruct.json
validation layer: loader_get_json: Failed to open JSON file D:\Games\lib.2.176.1\Bin\VkLayer_khronos_synchronization2.json
validation layer: loader_get_json: Failed to open JSON file D:\Games\lib.2.176.1\Bin\VkLayer_khronos_validation.json
validation layer: loader_get_json: Failed to open JSON file D:\Games\lib.2.176.1\Bin\VkLayer_monitor.json
validation layer: loader_get_json: Failed to open JSON file D:\Games\lib.2.176.1\Bin\VkLayer_screenshot.json
validation layer: verifyMetaLayerComponentLayers: Meta-layer VK_LAYER_LUNARG_override can't find component layer VK_LAYER_KHRONOS_validation at index 0.  Skipping this layer.
validation layer: Removing meta-layer VK_LAYER_LUNARG_override from instance layer list since it appears invalid.
validation layer: loaderValidateLayers: Layer 0 does not exist in the list of available layers
failed to create instance!
  • 我的母语不是英语,也不是 Whosebug 的普通用户,所以如果我犯了错误,请告诉我,这样我才能进步

编辑: BIN文件夹中存在VkLayer_khronos_validation.dll/.json/.pdb 所以我 运行 vulkaninfoSDK.exe 并注意到它尝试 从文件 D:\Games\lib.2.176.1\Bin 加载而不是 D:\Games\lib\Vulkan.2.176.1\Bin 所以我想我找到了问题所在。但为什么?该文件不在此处,为什么它会跳过一个文件夹?

编辑2: 我更改了文件夹(删除了目录中的 \Vulkan\),现在错误是(vulkaninfoSDK.exe):

ERROR: [Loader Message] Code 0 : loader_get_json: Failed to open JSON file C:\Program Files\Rockstar Games\Social Club\SocialClubVulkanLayer.json
WARNING: [Loader Message] Code 0 : loaderAddLayerProperties: D:\Games\lib.2.176.1\Bin\VkLayer_api_dump.json invalid layer manifest file version 1.2.0.  May cause errors.
WARNING: [Loader Message] Code 0 : loaderAddLayerProperties: D:\Games\lib.2.176.1\Bin\VkLayer_device_simulation.json invalid layer manifest file version 1.2.0.  May cause errors.
WARNING: [Loader Message] Code 0 : loaderAddLayerProperties: D:\Games\lib.2.176.1\Bin\VkLayer_gfxreconstruct.json invalid layer manifest file version 1.2.0.  May cause errors.
WARNING: [Loader Message] Code 0 : loaderAddLayerProperties: D:\Games\lib.2.176.1\Bin\VkLayer_khronos_synchronization2.json invalid layer manifest file version 1.2.0.  May cause errors.
WARNING: [Loader Message] Code 0 : loaderAddLayerProperties: D:\Games\lib.2.176.1\Bin\VkLayer_khronos_validation.json invalid layer manifest file version 1.2.0.  May cause errors.
WARNING: [Loader Message] Code 0 : loaderAddLayerProperties: D:\Games\lib.2.176.1\Bin\VkLayer_screenshot.json invalid layer manifest file version 1.2.0.  May cause errors.

并使用 code 我得到:

validation layer: loaderGetDeviceRegistryFiles: GUID for 23 is not SoftwareComponent skipping
validation layer: loaderGetDeviceRegistryFiles: GUID for 24 is not SoftwareComponent skipping
validation layer: loader_get_json: Failed to open JSON file C:\Program Files\Rockstar Games\Social Club\SocialClubVulkanLayer.json
validation layer: loaderAddLayerProperties: D:\Games\lib.2.176.1\Bin\VkLayer_api_dump.json invalid layer manifest file version 1.2.0.  May cause errors.
validation layer: loaderAddLayerProperties: D:\Games\lib.2.176.1\Bin\VkLayer_device_simulation.json invalid layer manifest file version 1.2.0.  May cause errors.
validation layer: loaderAddLayerProperties: D:\Games\lib.2.176.1\Bin\VkLayer_gfxreconstruct.json invalid layer manifest file version 1.2.0.  May cause errors.
validation layer: loaderAddLayerProperties: D:\Games\lib.2.176.1\Bin\VkLayer_khronos_synchronization2.json invalid layer manifest file version 1.2.0.  May cause errors.
validation layer: loaderAddLayerProperties: D:\Games\lib.2.176.1\Bin\VkLayer_khronos_validation.json invalid layer manifest file version 1.2.0.  May cause errors.
validation layer: loaderAddLayerProperties: D:\Games\lib.2.176.1\Bin\VkLayer_screenshot.json invalid layer manifest file version 1.2.0.  May cause errors.
validation layer: Searching for ICD drivers named .\nvoglv64.dll
validation layer: Build ICD instance extension list
validation layer: Instance Extension: VK_KHR_device_group_creation (C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_60daf66a00f2e0b6\.\nvoglv64.dll) version 0.0.1
validation layer: Instance Extension: VK_KHR_external_fence_capabilities (C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_60daf66a00f2e0b6\.\nvoglv64.dll) version 0.0.1
validation layer: Instance Extension: VK_KHR_external_memory_capabilities (C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_60daf66a00f2e0b6\.\nvoglv64.dll) version 0.0.1
validation layer: Instance Extension: VK_KHR_external_semaphore_capabilities (C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_60daf66a00f2e0b6\.\nvoglv64.dll) version 0.0.1
validation layer: Instance Extension: VK_KHR_get_physical_device_properties2 (C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_60daf66a00f2e0b6\.\nvoglv64.dll) version 0.0.2
validation layer: Instance Extension: VK_KHR_get_surface_capabilities2 (C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_60daf66a00f2e0b6\.\nvoglv64.dll) version 0.0.1
validation layer: Instance Extension: VK_KHR_surface (C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_60daf66a00f2e0b6\.\nvoglv64.dll) version 0.0.25
validation layer: Instance Extension: VK_KHR_surface_protected_capabilities (C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_60daf66a00f2e0b6\.\nvoglv64.dll) version 0.0.1
validation layer: Instance Extension: VK_KHR_win32_surface (C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_60daf66a00f2e0b6\.\nvoglv64.dll) version 0.0.6
validation layer: Instance Extension: VK_EXT_debug_report (C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_60daf66a00f2e0b6\.\nvoglv64.dll) version 0.0.9
validation layer: Instance Extension: VK_EXT_debug_utils (C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_60daf66a00f2e0b6\.\nvoglv64.dll) version 0.0.2
validation layer: Instance Extension: VK_EXT_swapchain_colorspace (C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_60daf66a00f2e0b6\.\nvoglv64.dll) version 0.0.4
validation layer: Instance Extension: VK_NV_external_memory_capabilities (C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_60daf66a00f2e0b6\.\nvoglv64.dll) version 0.0.1
validation layer: Loading layer library D:\Games\lib.2.176.1\Bin\.\VkLayer_khronos_validation.dll
validation layer: Loading layer library C:\ProgramData\obs-studio-hook\.\graphics-hook64.dll
validation layer: Loading layer library C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_60daf66a00f2e0b6\.\nvoglv64.dll
validation layer: Build ICD instance extension list
validation layer: Instance Extension: VK_KHR_device_group_creation (C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_60daf66a00f2e0b6\.\nvoglv64.dll) version 0.0.1
validation layer: Instance Extension: VK_KHR_external_fence_capabilities (C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_60daf66a00f2e0b6\.\nvoglv64.dll) version 0.0.1
validation layer: Instance Extension: VK_KHR_external_memory_capabilities (C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_60daf66a00f2e0b6\.\nvoglv64.dll) version 0.0.1
validation layer: Instance Extension: VK_KHR_external_semaphore_capabilities (C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_60daf66a00f2e0b6\.\nvoglv64.dll) version 0.0.1
validation layer: Instance Extension: VK_KHR_get_physical_device_properties2 (C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_60daf66a00f2e0b6\.\nvoglv64.dll) version 0.0.2
validation layer: Instance Extension: VK_KHR_get_surface_capabilities2 (C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_60daf66a00f2e0b6\.\nvoglv64.dll) version 0.0.1
validation layer: Instance Extension: VK_KHR_surface (C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_60daf66a00f2e0b6\.\nvoglv64.dll) version 0.0.25
validation layer: Instance Extension: VK_KHR_surface_protected_capabilities (C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_60daf66a00f2e0b6\.\nvoglv64.dll) version 0.0.1
validation layer: Instance Extension: VK_KHR_win32_surface (C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_60daf66a00f2e0b6\.\nvoglv64.dll) version 0.0.6
validation layer: Instance Extension: VK_EXT_debug_report (C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_60daf66a00f2e0b6\.\nvoglv64.dll) version 0.0.9
validation layer: Instance Extension: VK_EXT_debug_utils (C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_60daf66a00f2e0b6\.\nvoglv64.dll) version 0.0.2
validation layer: Instance Extension: VK_EXT_swapchain_colorspace (C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_60daf66a00f2e0b6\.\nvoglv64.dll) version 0.0.4
validation layer: Instance Extension: VK_NV_external_memory_capabilities (C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_60daf66a00f2e0b6\.\nvoglv64.dll) version 0.0.1
validation layer: Unloading layer library C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_60daf66a00f2e0b6\.\nvoglv64.dll
validation layer: Unloading layer library C:\ProgramData\obs-studio-hook\.\graphics-hook64.dll
validation layer: Unloading layer library D:\Games\lib.2.176.1\Bin\.\VkLayer_khronos_validation.dll

为什么选择 Rockestar Game?为什么

invalid layer manifest file version 1.2.0. ?

编辑: 所以我更改了文件位置,我认为它正在工作。

最后一个问题是:loaderAddLayerProperties: D:\Games\lib.2.176.1\Bin\VkLayer_api_dump.json invalid layer manifest file version 1.2.0. May cause errors.为什么“可能会导致错误”,它重要吗?

而且只是为了好玩:为什么要加载 C:\Program Files\Rockstar Games\Social Club\SocialClubVulkanLayer.json? Rockstar 在开发 Vulkan 还是什么?

重新编辑: 我 re-uninstall/re-reinstall sdk 和 ?????? 这次我 100% 确定我没有移动文件,它仍然尝试从 \lib.2.176.1 加载并且正在跳过 \vulkan\ ???

顺便说一句,第一个 sdk 安装在那里(没有 \vulkan),可能没有用,因为我重命名了一个文件夹,但为什么它在重新安装后保留了旧路径?

但无论如何,如果我移动它以匹配这些目录,它似乎可以工作 x)

我 rerere-uninstall/reinstall sdk 在一个完全不同的文件夹中,你猜怎么着? sdk安装在D:\Prgm.2.176.1 当我 运行 vulkaninfoSDK.exe 时:错误:[加载程序消息] 代码 0:loader_get_json:无法打开 JSON 文件 D:\Games\lib.2.176.1\Bin\VkLayer_api_dump.json

所以我想我被第一次安装的路径困住了

开个玩笑:(是的,我很健谈) 我在其原始位置重新 rerere-uninstall/reinstall sdk,现在它尝试从 D:\Games\lib\Vulkan.2.176.1\Bin\VkLayer_api_dump.json 加载文件?我可能搞砸了安装但是该死的

在 Vulkan 安装分析工具中我发现 duplicates。 不知道为什么,但它首先查看以前的和错误的目录,但存在正确的目录

所以我正在尝试删除不必要的目录

根据 SDK 发行说明,警告是正常的。 Rockstar 是一些叠加层或未完全卸载的东西(如果需要,您可以按照以下说明在注册表中将其删除)。

您应该检查 %VULKAN_SDK% 变量的值是否正确。

然后你应该检查HKLM\SOFTWARE\Khronos\Vulkan\ExplicitLayersHKLM\SOFTWARE\WOW6432Node\Khronos\Vulkan\ExplicitLayers是否正确并且没有重复。 (或者你可以先卸载,那样的话里面应该没有SDK路径了)

配置器应用程序也允许覆盖,所以你需要检查它是工具->重置,并设置为“完全由 Vulkan 应用程序控制”。关闭时它应该警告没有 Vulkan 覆盖处于活动状态,您应该单击是。

对于Rockstar的问题,似乎很多游戏启动器都为Vulkan安装了隐式层。在我的例子中,这是一个 GOG 层导致的问题,但似乎当你卸载这些程序中的许多时,它们并没有从注册表中删除它们的密钥。

要解决此问题,请检查两者

  • Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\ImplicitLayers

  • Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\ExplicitLayers

找不到匹配.json的键,删除。然后错误应该停止。

我在 ExplicitLayers 文件夹中有确切的 Rockstar 密钥,并在 ImplicitLayers 文件夹中找到了我的 GOG 密钥。