Vulkan: VkInstance's apiVersion mismatchs with VkDevice's apiVersion

Hi! PowerVR GE8300, Android 9, Huawei Y6 2019

vkEnumerateInstanceVersion returns 1.1, but vkGetPhysicalDeviceProperties returns VkPhysicalDeviceProperties::apiVersion == 1.0.76

Also I have Validation Layers’s Warnings :

D/androidvulkan.androidvulkan.d: Thu Mar 25 22:53:05 2021 Vulkan Debug Ouput: WARNING: [Validation] Code 0 : Validation Warning: [ UNASSIGNED-BestPractices-vkCreateDevice-API-version-mismatch ] Object 0: VK_NULL_HANDLE, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x594a8f91 | vkCreateDevice(): API Version of current instance, 1.1.0 (0x00401000) is higher than API Version on device, 1.0.76 (0x0040004c)
D/androidvulkan.androidvulkan.d: Thu Mar 25 22:53:05 2021 Vulkan Debug Ouput: WARNING: [Validation] Code 0 : Validation Warning: [ UNASSIGNED-BestPractices-vkCreateDevice-deprecated-extension ] Object 0: VK_NULL_HANDLE, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xad32db6 | CreateDevice(): Attempting to enable deprecated extension VK_KHR_shader_draw_parameters, but this extension has been promoted to VK_VERSION_1_1.
2021-03-25 22:53:05.181 15250-16229/androidvulkan.androidvulkan.d D/androidvulkan.androidvulkan.d: Thu Mar 25 22:53:05 2021 Vulkan Debug Ouput: WARNING: [Validation] Code 0 : Validation Warning: [ UNASSIGNED-BestPractices-vkCreateDevice-deprecated-extension ] Object 0: VK_NULL_HANDLE, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xad32db6 | CreateDevice(): Attempting to enable deprecated extension VK_KHR_get_memory_requirements2, but this extension has been promoted to VK_VERSION_1_1.
2021-03-25 22:53:05.182 15250-16229/androidvulkan.androidvulkan.d D/androidvulkan.androidvulkan.d: Thu Mar 25 22:53:05 2021 Vulkan Debug Ouput: WARNING: [Validation] Code 0 : Validation Warning: [ UNASSIGNED-BestPractices-vkCreateDevice-deprecated-extension ] Object 0: VK_NULL_HANDLE, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xad32db6 | CreateDevice(): Attempting to enable deprecated extension VK_KHR_dedicated_allocation, but this extension has been promoted to VK_VERSION_1_1.
2021-03-25 22:53:05.182 15250-16229/androidvulkan.androidvulkan.d D/androidvulkan.androidvulkan.d: Thu Mar 25 22:53:05 2021 Vulkan Debug Ouput: WARNING: [Validation] Code 0 : Validation Warning: [ UNASSIGNED-BestPractices-vkCreateDevice-deprecated-extension ] Object 0: VK_NULL_HANDLE, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xad32db6 | CreateDevice(): Attempting to enable deprecated extension VK_KHR_relaxed_block_layout, but this extension has been promoted to VK_VERSION_1_1.

Also I have crash during vkCreateDevice.

How to get a correct Vulkan Instance Version ?

It works on other Mobile GPU: Mali G71, Mali G76, Adreno 506, Adreno 610.
It works ob Desktop GPU.

Hi andreyogld3d,

Thanks for your message, we’ll look into it and come back to you.

Best regards,
Alejandro

1 Like

Hi andreyogld3d,

After reviewing the Vulkan specification, on a note about VkPhysicalDeviceProperties::apiVersion (Vulkan® 1.2.162 - A Specification (with all registered extensions)), turns out Vulkan can have different API versions for instance and device. The application should not be using functionality that is beyond the max supported corresponding version: The API version returned by vkEnumerateInstanceVersion is associated to the instance, and the one by VkPhysicalDeviceProperties::apiVersion, to the physical device:

The value of apiVersion may be different than the version returned by vkEnumerateInstanceVersion; either higher or lower. In such cases, the application must not use functionality that exceeds the version of Vulkan associated with a given object. The pApiVersion parameter returned by vkEnumerateInstanceVersion is the version associated with a VkInstance and its children, except for a VkPhysicalDevice and its children. VkPhysicalDeviceProperties::apiVersion is the version associated with a VkPhysicalDevice and its children.

There are notes on this regard also in the usage of extensions (Vulkan® 1.2.162 - A Specification (with all registered extensions)):

Instance-level functionality or behavior added by an instance extension to the API must not be used unless that extension is supported by the instance as determined by vkEnumerateInstanceExtensionProperties, and that extension is enabled in VkInstanceCreateInfo.

Device functionality or behavior added by a device extension to the API must not be used unless that extension is supported by the device as determined by vkEnumerateDeviceExtensionProperties, and that extension is enabled in VkDeviceCreateInfo.

So the validation errors you’re getting with vkCreateDevice seem to be following the official Vulkan spec I’m afraid:

  • vkCreateDevice is trying the be created with version 1.1 when it supports up to 1.0.76.
  • The extensions VK_KHR_shader_draw_parameters, VK_KHR_get_memory_requirements2, VK_KHR_dedicated_allocation and VK_KHR_relaxed_block_layout require Device API version 1.1, but your Device API version is 1.0.76.

Best regards,
Alejandro

1 Like

Hi

So, sould I recreate VkInstance with 1.0.76 ? Because in this case I will not get any validation errors.

Any way, this device supports these extensions for 1.0.76, so I could add them for extension list for VkDevice creation, but what about validation’s error message in this case?

Hi andreyogld3d,

You are right, you should create the instance with API version 1.0.76.

In that case, you should not get the best practices layer validation warnings, since in 1.0.76 it makes sense to use those extensions (it is from v1.1 onwards when you should use for each extension its promoted core functionality).

Best regards,
Alejandro

1 Like

Hi @AlejandroCosin Thank youi for your answer!

Hi andreyogld3d,

You are welcome, please let us know if you have any other issues we could help you with.

Best regards,
Alejandro

1 Like

© Imagination Technologies Limited. All rights reserved.
Privacy PolicyTerms & ConditionsTrademarksCookies