From c4254f374ff1391d41dd158a74480ceeb7462bd0 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Sat, 27 Jan 2024 10:46:21 -0600 Subject: [PATCH] nvk: Do a second submit to check for errors in the sync case With NVK_DEBUG=push_sync, we signal and immediately wait on a syncobj to better detect whitch push failed and then print it. However, the syncobj wait itself isn't enough to check for errors. We have to try pushing again. Adding an empty push lets us get errors immediately and print the actually failing pushbuf to stderr. Part-of: --- src/nouveau/vulkan/nvk_queue_drm_nouveau.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/nouveau/vulkan/nvk_queue_drm_nouveau.c b/src/nouveau/vulkan/nvk_queue_drm_nouveau.c index 3c7653a48c0..e496363a50c 100644 --- a/src/nouveau/vulkan/nvk_queue_drm_nouveau.c +++ b/src/nouveau/vulkan/nvk_queue_drm_nouveau.c @@ -269,6 +269,18 @@ push_submit(struct push_builder *pb, struct nvk_queue *queue, bool sync) return vk_errorf(queue, VK_ERROR_UNKNOWN, "DRM_SYNCOBJ_WAIT failed: %m"); } + + /* Push an empty again, just to check for errors */ + struct drm_nouveau_exec empty = { + .channel = pb->req.channel, + }; + err = drmCommandWriteRead(pb->dev->ws_dev->fd, + DRM_NOUVEAU_EXEC, + &empty, sizeof(empty)); + if (err) { + return vk_errorf(queue, VK_ERROR_DEVICE_LOST, + "DRM_NOUVEAU_EXEC failed: %m"); + } } return VK_SUCCESS; }