From 6d988ad4a21f25899936963e385e702002e4f18e Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Fri, 7 Aug 2020 17:18:41 +0200 Subject: [PATCH] radv: report a better error message when QueueWaitIdle() failed Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen Part-of: --- src/amd/vulkan/radv_device.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 00df3a97dd6..799f291f0ae 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -4749,6 +4749,21 @@ VkResult radv_QueueSubmit( return VK_SUCCESS; } +static const char * +radv_get_queue_family_name(struct radv_queue *queue) +{ + switch (queue->queue_family_index) { + case RADV_QUEUE_GENERAL: + return "graphics"; + case RADV_QUEUE_COMPUTE: + return "compute"; + case RADV_QUEUE_TRANSFER: + return "transfer"; + default: + unreachable("Unknown queue family"); + } +} + VkResult radv_QueueWaitIdle( VkQueue _queue) { @@ -4762,8 +4777,11 @@ VkResult radv_QueueWaitIdle( if (!queue->device->ws->ctx_wait_idle(queue->hw_ctx, radv_queue_family_to_ring(queue->queue_family_index), - queue->queue_idx)) - return VK_ERROR_DEVICE_LOST; + queue->queue_idx)) { + return vk_errorf(queue->device->instance, VK_ERROR_DEVICE_LOST, + "Failed to wait for a '%s' queue to be idle. " + "GPU hang ?", radv_get_queue_family_name(queue)); + } return VK_SUCCESS; } -- 2.30.2