[PR #2187] [MERGED] device-fault: AMD buffer-marker breadcrumbs name the dispatch that hung (RT-DEVICE-MARKERS-AMD) #2192

Closed
opened 2026-11-26 21:20:21 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2187
Author: @aslan2142
Created: 11/26/2026
Status: ✅ Merged
Merged: 11/26/2026
Merged by: @aslan2142

Base: main ← Head: device-markers-amd


📝 Commits (1)

  • e418c1e vulkan: AMD breadcrumbs name the dispatch that hung (LEONIDA_DEVICE_MARKERS)

📊 Changes

12 files changed (+907 additions, -16 deletions)

View changed files

📝 docs/d3d12_vulkan.md (+30 -0)
📝 runtime/CMakeLists.txt (+18 -0)
📝 runtime/README.md (+1 -0)
📝 runtime/shims/d3d12_com.h (+1 -0)
📝 runtime/shims/d3d12_vulkan_device.cpp (+9 -2)
📝 runtime/src/vulkan_backend.h (+5 -2)
📝 runtime/src/vulkan_device_fault.h (+148 -12)
➕ runtime/src/vulkan_device_markers.h (+245 -0)
📝 runtime/src/vulkan_replay.h (+2 -0)
➕ runtime/test/vk_device_markers_test.cpp (+142 -0)
📝 runtime/test/vk_test_device.h (+6 -0)
➕ runtime/test/vulkan_device_markers_test.cpp (+300 -0)

📄 Description

On AMD a GPU hang ends in VK_ERROR_DEVICE_LOST with no checkpoints, so the device-fault report can only list what was in flight (64 dispatches in one hang today). This adds LEONIDA_DEVICE_MARKERS=1, so the report names the dispatch that hung.

Item: RT-DEVICE-MARKERS-AMD

  • Needs: LEONIDA_DEVICE_FAULT=1/2 and VK_AMD_buffer_marker; otherwise it logs one "unavailable" line. Off by default.
  • Markers: each dispatch writes its seq at top and bottom of pipe into one persistent host-visible buffer, one slot per queue.
  • Report: each queue's finished and started seq, and the oldest started-but-unfinished dispatch marked as the likely hang (best-effort after a loss). A history of the last 16,384 dispatches names it even after it has left the 64-entry list.
  • Numbering: seq is now given out when a dispatch is recorded, so the markers and the "submitted dispatch" list share one numbering.
  • Cost: two marker writes per dispatch when on; nothing when off.
  • Tests: vulkan_device_markers (CPU, runs in the Linux subset) and vk_device_markers (GPU, skipped without the extension). Docs: a runtime/README.md row and docs/d3d12_vulkan.md 4.11.
  • Tested: under Wine on the AMD Radeon iGPU of a Ryzen 9 7950X3D (gfx1036, RADV, Mesa 26.3.1), clang-cl. The new tests and the device-fault tests pass; the full Wine suite shows nothing new beyond tests already failing on main.

AI-assisted (Claude Code, Claude Opus 5.5).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/2187 **Author:** [@aslan2142](https://github.com/aslan2142) **Created:** 11/26/2026 **Status:** ✅ Merged **Merged:** 11/26/2026 **Merged by:** [@aslan2142](https://github.com/aslan2142) **Base:** `main` ← **Head:** `device-markers-amd` --- ### 📝 Commits (1) - [`e418c1e`](https://github.com/ubiquitarianism/leonida/commit/e418c1e4b607570e46f9d6e181d44c87f7265b06) vulkan: AMD breadcrumbs name the dispatch that hung (LEONIDA_DEVICE_MARKERS) ### 📊 Changes **12 files changed** (+907 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `docs/d3d12_vulkan.md` (+30 -0) 📝 `runtime/CMakeLists.txt` (+18 -0) 📝 `runtime/README.md` (+1 -0) 📝 `runtime/shims/d3d12_com.h` (+1 -0) 📝 `runtime/shims/d3d12_vulkan_device.cpp` (+9 -2) 📝 `runtime/src/vulkan_backend.h` (+5 -2) 📝 `runtime/src/vulkan_device_fault.h` (+148 -12) ➕ `runtime/src/vulkan_device_markers.h` (+245 -0) 📝 `runtime/src/vulkan_replay.h` (+2 -0) ➕ `runtime/test/vk_device_markers_test.cpp` (+142 -0) 📝 `runtime/test/vk_test_device.h` (+6 -0) ➕ `runtime/test/vulkan_device_markers_test.cpp` (+300 -0) </details> ### 📄 Description On AMD a GPU hang ends in `VK_ERROR_DEVICE_LOST` with no checkpoints, so the device-fault report can only list what was in flight (64 dispatches in one hang today). This adds `LEONIDA_DEVICE_MARKERS=1`, so the report names the dispatch that hung. Item: RT-DEVICE-MARKERS-AMD - **Needs:** `LEONIDA_DEVICE_FAULT=1`/`2` and `VK_AMD_buffer_marker`; otherwise it logs one "unavailable" line. Off by default. - **Markers:** each dispatch writes its `seq` at top and bottom of pipe into one persistent host-visible buffer, one slot per queue. - **Report:** each queue's finished and started `seq`, and the oldest started-but-unfinished dispatch marked as the likely hang (best-effort after a loss). A history of the last 16,384 dispatches names it even after it has left the 64-entry list. - **Numbering:** `seq` is now given out when a dispatch is recorded, so the markers and the "submitted dispatch" list share one numbering. - **Cost:** two marker writes per dispatch when on; nothing when off. - **Tests:** `vulkan_device_markers` (CPU, runs in the Linux subset) and `vk_device_markers` (GPU, skipped without the extension). Docs: a `runtime/README.md` row and `docs/d3d12_vulkan.md` 4.11. - **Tested:** under Wine on the AMD Radeon iGPU of a Ryzen 9 7950X3D (gfx1036, RADV, Mesa 26.3.1), clang-cl. The new tests and the device-fault tests pass; the full Wine suite shows nothing new beyond tests already failing on `main`. AI-assisted (Claude Code, Claude Opus 5.5). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 21:20:21 +01:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#2192
No description provided.