mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-18 06:59:57 -04:00
End a run whose GPU device is lost in one place: one report, no callbacks of unfinished submissions, and exit code 72.
A lost device used to end the process from whichever submit or wait noticed it first, while the present only logged it and went on and the other threads kept calling the driver. The completion thread could take the submissions' timeline as reached and run the callbacks of submissions that never finished. vk_device_lost_check now takes the result of every submit, present, acquire and wait. The first thread to see the loss sets a flag, writes the report and ends the process as a fatal error does (the log written, a save commit under way finished), with an exit code of its own; later threads stop in that call, and a watchdog ends the process after ten seconds should the first thread hang. The replay, its submit, the uploads, the present and the lazy fetch read the flag and return without touching the device. The completion thread asks the device with a call of its own before a new value counts and runs no callback once the flag is set. The executable's --probe-devlost and tests/device_lost_check.py check this without a lost device, and device_lost_at in nx2navi.ini ends a real run the same way. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
@@ -311,7 +311,7 @@ static void oq_read(VkDevice dev, uint32_t first, uint32_t n) {
|
||||
VkResult r = vkGetQueryPoolResults(dev, oq_pool, first, n, sizeof OQB.v[0] * 2 * n, OQB.v, 2 * sizeof OQB.v[0],
|
||||
VK_QUERY_RESULT_64_BIT | VK_QUERY_RESULT_WITH_AVAILABILITY_BIT);
|
||||
if (r != VK_SUCCESS && r != VK_NOT_READY) {
|
||||
vk_device_fault_report(r);
|
||||
vk_device_lost_check(r, "the read of occlusion query results");
|
||||
rt_fatal("vk: occlusion query results failed (%d)", (int)r);
|
||||
}
|
||||
OQB.first = first, OQB.n = n;
|
||||
@@ -353,6 +353,7 @@ static void oq_cb(void *arg) {
|
||||
if (avail) sum += v;
|
||||
else {
|
||||
sum += 1;
|
||||
vk_device_lost_poll(); // a query its submission never wrote: on a lost device the run ends here
|
||||
LOG_ONCE("vk: occlusion query slot %u not available after its fence, counted as visible", s->q[i]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user