End the run as a lost device when a timeline reads above every value its signals carry, and log the submissions' state with the first occlusion query left unwritten.

The RX 6000 reports of 0.9.1 and 0.9.2 ran the completion callbacks of submissions the GPU never finished before any call returned VK_ERROR_DEVICE_LOST, although the completion thread polled the device first. Every value a queue hand-over or a host signal gives the submissions' timeline or the executed timeline is now noted before the signal (vk_sync_hw.h); the completion thread and the wait after a submit end the run when a timeline reads above that note. The first occlusion query found unwritten after its fence logs its submission, the submissions' values, both timelines' readings and the GPU breadcrumbs, and the lost device's report starts with the same line, so the next report shows whether the driver gave a value above the note.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-13 12:27:05 -05:00
parent a84a3ab12d
commit 8df4311723
7 changed files with 258 additions and 7 deletions

View File

@@ -129,6 +129,14 @@ static inline int vk_device_is_lost(void) { return __atomic_load_n(&vk_lost, __A
// signals), and ends the run through vk_device_lost_check when it is. The completion thread calls it before it runs
// callbacks: a lost device may report the submissions' timeline as reached (vk_sync.c completion_main).
void vk_device_lost_poll(void);
// vk_sync.c "a lost device in the timelines' values": a host signal of VkCtx.timeline notes its value first; a read of
// the timeline above every value its signals carry ends the run as a lost device (vk_sync_check_timeline, any thread,
// `where` for the fatal line). vk_sync_state_text: the submissions' values and the two timelines' readings, one line
// without a lock; vk_sync_lost_report logs it (vk_device.c device_fault_report).
void vk_sync_signal_note(uint64_t value);
void vk_sync_check_timeline(const char *where);
void vk_sync_state_text(char *o, size_t n);
void vk_sync_lost_report(void);
// ---- GPU breadcrumbs (vk_crumbs.c): with VK_AMD_buffer_marker, each crumb has the GPU write its code into host memory
// twice, when the command processor reaches it and when all work before it has finished. After a lost device the two