vk: RX_VK_CHECKPOINTS on AMD and Intel (VK_AMD_buffer_marker), so GPU hang reports name the program #734
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!734
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/amd-buffer-markers"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Refs #602, #604, #620, #581 (AMD GPU hangs after the intro; on Linux, a failed ring reset leads to a full GPU reset, and sometimes a reboot).
The gap
When the device is lost, the log says
device lost: reading the fault info (RX_VK_CHECKPOINTS=1 for markers). But those markers areVK_NV_device_diagnostic_checkpointsonly. On AMD, with both RADV and the Windows driver, the switch does nothing, andVK_EXT_device_faultisn't available either (#604, #602). So none of the AMD hang reports can say which program the GPU was running. The most we have is "it goes away withRX_VK_NO_MESH=1" (#602, RX 9070 on v2.0.2, which already has the 1024-attempt compare-exchange ceiling).What this does
When
RX_VK_CHECKPOINTSis set (not0orext), the NV extension is missing, andVK_AMD_buffer_markeris present (RADV, the AMD Windows driver, and Intel ANV all have it), each existing checkpoint (checkpoint()andcheckpoint_mark(), so every draw, dispatch, upload, mirror sync and write-back) writes its sequence number into a 512 KB host-memory buffer twice:TOP_OF_PIPE, when the GPU reaches it (word2i);BOTTOM_OF_PIPE, once all the work before it has finished (word2i + 1).The buffer is in system memory if the driver offers it, because a MODE1 reset loses VRAM. After a device loss,
checkpoints_report()logs:followed by the same 40-line watch ring the NV report prints.
It only turns on when asked for: markers twice per draw are not free, and on NVIDIA the checkpoints are known to change timing (vk_main.cpp's comment). The NV path is unchanged apart from sharing the kind names.
Testing
hookshot_vk.sobuilds with the AppImage toolchain (RX_VK_ONLY=1 nx2/build.py --standalone) with no warnings, andtests/run_all.pypasses (88 passed, 4 skipped).VK_AMD_buffer_marker. The reporting logic was checked by hand: with markers 1-100 recorded, the GPU done through 57 and reached through 60, it names marker 57's draw as the one running and lists 58-60 as reached with earlier work unfinished.RX_VK_PARALLELthe order can interleave across command buffers. The "reached, earlier work unfinished" list is printed for that case.If someone with an affected AMD card could run once with
RX_VK_CHECKPOINTS=1inhookshot_env.txtand attach the log, the "RUNNING after" line should name the hanging program.Thanks!