cwindowsmingwvulkanvalidation-layers

Vulkan VK_LAYER_KHRONOS_validation is Wrong Bit-Type


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:

What I Need to Solve the Problem:

Thank you for your help!


Solution

  • 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.