mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-16 15:59:59 -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:
@@ -51,6 +51,12 @@ RtDispatchStats rt_dispatch_stats(void);
|
||||
|
||||
// Runtime fatal error: message to stderr, then exit. Used by the dispatcher and the stubs.
|
||||
void rt_fatal(const char *fmt, ...) __attribute__((noreturn, format(printf, 1, 2)));
|
||||
// The same end with an exit code of its own, for a failure that a script or the launcher tells from the others by it
|
||||
// (vk_device.c vk_device_lost_check ends with RT_LOST_EXIT). rt_fatal ends with RT_FATAL_EXIT; 71 is the crash report's
|
||||
// (main.c crash_handler).
|
||||
#define RT_FATAL_EXIT 70
|
||||
#define RT_LOST_EXIT 72
|
||||
void rt_fatal_code(int code, const char *fmt, ...) __attribute__((noreturn, format(printf, 2, 3)));
|
||||
// Lines of context for a fatal error's report, which rt_fatal and the crash report (main.c crash_handler) write after
|
||||
// their own: fn logs one with rt_log. It runs on the failing thread, which may hold any lock, so it reads only what
|
||||
// needs none. At most four; adding one twice keeps one. rt_fatal_notes runs them, once per process.
|
||||
|
||||
Reference in New Issue
Block a user