Application crashes on Vulkan initialization on AMD gpus

Hello. I’m developing an application that uses Vulkan for rendering 3d scenes and as a compute engine. It initializes one instance for the render engine and one instance for the compute engine. The render engine seems to be initializing correctly, but the application crashes when initializing the compute engine after writing the DRIVER version to the log file:

VkPhysicalDeviceProperties deviceProperties;
vkGetPhysicalDeviceProperties(m_physical_device, &deviceProperties);
Log::Info("GPU: %s\n", deviceProperties.deviceName);
Log::Info("API: %d\n", deviceProperties.apiVersion);
Log::Info("DRIVER: %d\n", deviceProperties.driverVersion);

VkPhysicalDeviceSubgroupProperties subgroupProperties;
subgroupProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES;
subgroupProperties.pNext = NULL;

VkPhysicalDeviceProperties2 physicalDeviceProperties;
physicalDeviceProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
physicalDeviceProperties.pNext = &subgroupProperties;

VkPhysicalDeviceSubgroupProperties deviceSubgroupProperties;
vkGetPhysicalDeviceProperties2(m_physical_device, &physicalDeviceProperties);
Log::Info("SUB GROUP SIZE: %d\n", subgroupProperties.subgroupSize);

I’m receiving many reports with these crashes, and almost all of them happen in AMD Radeon GPUs:

[2021-08-26 08:56:46.887189]: 0x00000c9c I GPU: AMD Radeon RX 5700
[2021-08-26 08:56:46.887189]: 0x00000c9c I API: 4202678
[2021-08-26 08:56:46.887189]: 0x00000c9c I DRIVER: 8388801

[2021-09-16 10:01:08.565587]: 0x00001460 I GPU: Radeon RX 580 Series
[2021-09-16 10:01:08.565587]: 0x00001460 I API: 4202629
[2021-09-16 10:01:08.565587]: 0x00001460 I DRIVER: 8388745

[2021-11-21 11:48:26.717163]: 0x00000e50 I GPU: Radeon RX Vega
[2021-11-21 11:48:26.717163]: 0x00000e50 I API: 4202684
[2021-11-21 11:48:26.717163]: 0x00000e50 I DRIVER: 8388806

[2021-12-27 23:20:08.461632]: 0x00002bf4 I GPU: AMD Radeon (TM) R9 380 Series
[2021-12-27 23:20:08.461632]: 0x00002bf4 I API: 4202666
[2021-12-27 23:20:08.461632]: 0x00002bf4 I DRIVER: 8388787

Almost all the initialization code was copied from vulkan tutorial dot com and/or the vulkan examples from Sasha Willems.

I have uploaded the relevant files to my google drive:
https drive google com slash drive slash folders slash 1NXtv9MkDJwvUnZVT7X-ZREbze0n9H6XP

If needed, I can create a small application that does the same vulkan initialization as my big app does.

Thank you in advance for your help.

vkGetPhysicalDeviceProperties2 requires VK_KHR_get_physical_device_properties2 instance extension or (likely device-level) Vulkan 1.1.

But your application instance version is declared as 1.0:

appInfo.apiVersion = VK_API_VERSION_1_0;

and you enable no relevant extensions neither:

VkInstanceCreateInfo instanceCreateInfo = {};
...
const char *validationExt = VK_EXT_DEBUG_REPORT_EXTENSION_NAME;
instanceCreateInfo.enabledExtensionCount = 1;
instanceCreateInfo.ppEnabledExtensionNames = &validationExt;

PS:

VkPhysicalDeviceSubgroupProperties also requires device version 1.1.

Thank you very much krOoze… I patched the application and asked one of the users to test it again, and he confirmed that it’s working with the patch! It took me way longer to describe the issue than you finding a solution :slight_smile:

Have a great day!
Diego

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.