diff options
| author | aslan2142 <jan.trencansky@protonmail.com> | 2026-11-25 04:19:16 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-25 04:19:16 +0100 |
| commit | 0bc810504aa44ba7e30f3c3352ebad697b9814d6 (patch) | |
| tree | 20d922b91a26ab50978da9167a984bc3a1322d2c /runtime/src | |
| parent | 603d8b3478ffeb56117722a709dc51149b4cdf32 (diff) | |
| parent | 427abf2613a49fd1a52a50ab7cd5fa630ec780a4 (diff) | |
Merge pull request #1028 from quartz-heron-58/device-fault
vulkan: print the driver's fault report when the device is lost (RT-DEVICE-FAULT-INFO)
Diffstat (limited to 'runtime/src')
| -rw-r--r-- | runtime/src/vulkan_backend.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/runtime/src/vulkan_backend.h b/runtime/src/vulkan_backend.h index 9652fd51b..5c3e884ba 100644 --- a/runtime/src/vulkan_backend.h +++ b/runtime/src/vulkan_backend.h | |||
| @@ -2091,6 +2091,22 @@ public: | |||
| 2091 | return UINT64_MAX; | 2091 | return UINT64_MAX; |
| 2092 | } | 2092 | } |
| 2093 | if (result != VK_SUCCESS) return 0; | 2093 | if (result != VK_SUCCESS) return 0; |
| 2094 | if (value == UINT64_MAX) { | ||
| 2095 | // A lost device can show itself here first: measured on NVIDIA 621.24 and reported on 617.14, the counter | ||
| 2096 | // query succeeds with UINT64_MAX (and vkWaitSemaphores with a zero timeout succeeds too) before any call | ||
| 2097 | // has returned VK_ERROR_DEVICE_LOST. vkDeviceWaitIdle is what then says so, and it is also what a driver | ||
| 2098 | // needs to have returned before vkGetDeviceFaultInfoEXT answers (LEONIDA_DEVICE_FAULT=1). When | ||
| 2099 | // vkDeviceWaitIdle succeeds, nothing is recorded and the value is returned as the driver gave it. | ||
| 2100 | VkResult idle = VK_SUCCESS; | ||
| 2101 | { | ||
| 2102 | std::lock_guard lock(context_.submit_mutex()); | ||
| 2103 | idle = context_.observe_result(context_.vk.vkDeviceWaitIdle(context_.device()), | ||
| 2104 | "vkDeviceWaitIdle (a fence counter of UINT64_MAX)"); | ||
| 2105 | } | ||
| 2106 | if (idle == VK_ERROR_DEVICE_LOST) | ||
| 2107 | context_.mark_device_lost( | ||
| 2108 | "a fence's counter read UINT64_MAX and vkDeviceWaitIdle then returned VK_ERROR_DEVICE_LOST"); | ||
| 2109 | } | ||
| 2094 | return value; | 2110 | return value; |
| 2095 | } | 2111 | } |
| 2096 | 2112 | ||