diff --git a/src/amd/vulkan/radv_debug.c b/src/amd/vulkan/radv_debug.c index bc4528ec385..ebe4523b282 100644 --- a/src/amd/vulkan/radv_debug.c +++ b/src/amd/vulkan/radv_debug.c @@ -1094,6 +1094,31 @@ radv_GetDeviceFaultInfoEXT(VkDevice _device, VkDeviceFaultCountsEXT *pFaultCount pFaultCounts->vendorInfoCount = 0; pFaultCounts->vendorBinarySize = 0; + if (device->gpu_hang_report) { + const struct radv_physical_device *pdevice = device->physical_device; + + VkDeviceFaultVendorBinaryHeaderVersionOneEXT hdr; + + hdr.headerSize = sizeof(VkDeviceFaultVendorBinaryHeaderVersionOneEXT); + hdr.headerVersion = VK_DEVICE_FAULT_VENDOR_BINARY_HEADER_VERSION_ONE_EXT; + hdr.vendorID = pdevice->vk.properties.vendorID; + hdr.deviceID = pdevice->vk.properties.deviceID; + hdr.driverVersion = pdevice->vk.properties.driverVersion; + memcpy(hdr.pipelineCacheUUID, pdevice->cache_uuid, VK_UUID_SIZE); + hdr.applicationNameOffset = 0; + hdr.applicationVersion = pdevice->instance->vk.app_info.app_version; + hdr.engineNameOffset = 0; + hdr.engineVersion = pdevice->instance->vk.app_info.engine_version; + hdr.apiVersion = pdevice->instance->vk.app_info.api_version; + + pFaultCounts->vendorBinarySize = sizeof(hdr) + strlen(device->gpu_hang_report); + if (pFaultInfo) { + memcpy(pFaultInfo->pVendorBinaryData, &hdr, sizeof(hdr)); + memcpy((char *)pFaultInfo->pVendorBinaryData + sizeof(hdr), device->gpu_hang_report, + strlen(device->gpu_hang_report)); + } + } + if (vm_fault_occurred) { VkDeviceFaultAddressInfoEXT addr_fault_info = { .reportedAddress = fault_info.addr,