Vulkan VK_LAYER_KHRONOS_validation 是错误的位类型

huangapple go评论131阅读模式
英文:

Vulkan VK_LAYER_KHRONOS_validation is Wrong Bit-Type

问题

问题:

你好!我正在开发一个在两台64位Windows系统之间使用相同的MinGW/GCC构建系统的Vulkan项目。我正在使用C语言编写程序,以挑战自己,到目前为止一切都很顺利。当我在System 1上运行我的程序时,验证层正常工作。**请注意:禁用验证层后,程序在两个系统上都可以正常运行。**在System 2上,运行我的程序时,这是我的控制台输出:

INFO: 3 Vulkan extension(s) required by GLFW:
        VK_KHR_surface
        VK_KHR_win32_surface
        VK_EXT_debug_utils
        All GLFW-required Vulkan extensions are supported!
INFO: 1 Vulkan validation layer(s) required:
        VK_LAYER_KHRONOS_validation
        Required Vulkan validation layers are supported!
ERROR: loader_get_json: Failed to open JSON file E:\Epic Games\Launcher\Portal\Extras\Overlay\EOSOverlayVkLayer-Win32.json
ERROR: loader_get_json: Failed to open JSON file E:\Epic Games\Launcher\Portal\Extras\Overlay\EOSOverlayVkLayer-Win64.json
WARNING: Layer VK_LAYER_OBS_HOOK uses API version 1.2 which is older than the application specified API version of 1.3. May cause issues.
WARNING: Layer VK_LAYER_OBS_HOOK uses API version 1.2 which is older than the application specified API version of 1.3. May cause issues.
ERROR: Requested layer "VK_LAYER_KHRONOS_validation" was wrong bit-type!
ERROR: Vulkan instance creation failed with result code -6!
ERROR: Vulkan debug messenger creation failed with result code -7!
Assertion failed: instance != VK_NULL_HANDLE, file C:\Users\Kade\Documents\westy\src\lib\glfw-3.3.2\src\vulkan.c, line 305

我得出结论,前两个 loader_get_json 错误并不是问题的根本原因(参见此GitHub票)。

我没有使用 VK_LAYER_OBS_HOOK 层,因此这个问题(很可能)不关心我。

最后3个错误让我感到困扰。"Requested layer "VK_LAYER_KHRONOS_validation" was wrong bit-type!" 是否表明我在特定验证层和我的构建系统之间存在32/64位不匹配,或者是其他原因?如果这是错误,我不太确定如何解决这个问题。实例和调试信使的错误代码分别翻译为 VK_ERROR_LAYER_NOT_PRESENTVK_ERROR_EXTENSION_NOT_PRESENT。所涉及的层是我遇到问题的验证层,所涉及的扩展是 VK_EXT_debug_utils,它依赖于验证层的工作。

我尝试过的事情:

  • 检查Vulkan维护工具以寻找潜在的修复方案(没有找到)。
  • 检查Vulkan配置工具和所有系统环境变量(所有路径都正确)。
  • 重新安装Vulkan SDK;这似乎没有效果。
  • 重新安装MinGW,因为我已经没有更多的想法。

我需要解决这个问题的方法:

  • 这个错误是什么意思?我找不到在线文档,也许我还没有努力寻找。
  • 有哪些潜在的解决方案我还没有尝试过?

感谢您的帮助!

英文:

The Problem:

Hello! I am developing a Vulkan project between two 64-bit Windows systems, using the same MinGW/GCC build system on both. I am writing the program in C to challenge myself, and it has gone well until now. When I run my program on System 1, validation layers work as expected. Please note: the program works just fine on both systems with validation layers disabled. On System 2, this is my console output when I run my program:

INFO: 3 Vulkan extension(s) required by GLFW:
        VK_KHR_surface
        VK_KHR_win32_surface
        VK_EXT_debug_utils
        All GLFW-required Vulkan extensions are supported!
INFO: 1 Vulkan validation layer(s) required:
        VK_LAYER_KHRONOS_validation
        Required Vulkan validation layers are supported!
ERROR: loader_get_json: Failed to open JSON file E:\Epic Games\Launcher\Portal\Extras\Overlay\EOSOverlayVkLayer-Win32.json
ERROR: loader_get_json: Failed to open JSON file E:\Epic Games\Launcher\Portal\Extras\Overlay\EOSOverlayVkLayer-Win64.json
WARNING: Layer VK_LAYER_OBS_HOOK uses API version 1.2 which is older than the application specified API version of 1.3. May cause issues.
WARNING: Layer VK_LAYER_OBS_HOOK uses API version 1.2 which is older than the application specified API version of 1.3. May cause issues.
ERROR: Requested layer "VK_LAYER_KHRONOS_validation" was wrong bit-type!
ERROR: Vulkan instance creation failed with result code -6!
ERROR: Vulkan debug messenger creation failed with result code -7!
Assertion failed: instance != VK_NULL_HANDLE, file C:\Users\Kade\Documents\westy\src\lib\glfw-3.3.2\src\vulkan.c, line 305

I have come to the conclusion that the first two loader_get_json errors are not the source of the problem (see this GitHub ticket).

I am not using the VK_LAYER_OBS_HOOK layer, so this issue (likely) does not concern me at this point.

The final 3 errors are what bother me. Does the "Requested layer "VK_LAYER_KHRONOS_validation" was wrong bit-type!" indicate that I have a 32/64-bit mismatch between this particular validation layer and my build system, or something else? If this is the error, I am not quite sure how to resolve the issue. The instance and debug messenger error codes translate to VK_ERROR_LAYER_NOT_PRESENT and VK_ERROR_EXTENSION_NOT_PRESENT respectively. The layer-in-question is the validation layer I am having problems with, and the extension-in-question is VK_EXT_debug_utils, which depends on the validation layers to work.

What I Have Tried:

  • Check the Vulkan Maintenance Tool for potential repairs (nothing).
  • Check the Vulkan Configurator & all system environment variables (all paths correct).
  • Reinstall the Vulkan SDK; this appeared to do nothing.
  • Reinstall MinGW because I am out of ideas.

What I Need to Solve the Problem:

  • What does this error mean? I cannot find documentation online; maybe I haven't looked hard enough.
  • What are some potential solutions I haven't tried already?
    <br /><br />

Thank you for your help!

答案1

得分: 0

我的MinGW版本是32位版本。我安装了MinGW-64,并在制作项目时在GCC的选项中指定了“-m64”。这还显示了一些性能验证警告,这是我在第一个系统上没有遇到的。我还发现了一些不在32位构建中引发任何问题的误放置的“free()”调用。奇怪,但我很高兴一切都解决了。

英文:

Solution:

My version of MinGW was the 32-bit version. I installed MinGW-64, and specified -m64 in GCC's options when making the project. This also revealed a few validation performance warnings that I was not getting on System 1. I also discovered a few misplaced calls to free() which were not causing any issues in my 32-bit build. Strange, but I'm glad I got that all worked out.

huangapple
  • 本文由 发表于 2023年3月21日 03:08:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/75794351-2.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定