feat(diagnostics): trace GPU submission and resource retirement stalls #1564

Manually merged
github merged 3 commits from github-bot/gh-1564 into main 2026-11-29 08:21:56 +00:00 AGit
Owner

@⁠jeremygold02 on GitHub · 2026-11-28 21:46 UTC · original
jeremygold02:codex/gpu-stall-diagnostics → main · +199 −32 · 4 files · 3 commits · merged 2026-11-29 08:16 UTC

What it changes

Long frames can overlap GPU fence waits, CPU submission preparation, and cleanup of completed work. This adds timestamped, opt-in measurements to distinguish them in a release build. It preserves submission and retirement ordering.

Flag Measurements
VICTORY_REMAP_TIMING=1 Queue synchronization, waiting for earlier writes, and application time for page-mapping calls of at least 5 ms
VICTORY_RELAY_TIMING=1 Main and readback fence waits, copy-back, publication, resource retirement lock/drain/release, and relay line updates
VICTORY_SUBMISSION_TIMING=1 Worker jobs and host submissions of at least 10 ms, with submission phases of at least 1 ms listed
VICTORY_MEMORY_TRACE=1 Periodic process working set and commit, free physical RAM, and local/shared GPU usage and budgets

All four flags default to off and enable only on the exact value 1. The launcher defaults are unchanged. Set VICTORY_LOG=warn,victory_gpu::host=info,victory_gpu::queue=info,victory_gpu::frame_times=info to capture the events.

How it was tested

  • Setup: Windows 11 Home build 26200, Intel Core Ultra 7 265K, 32 GB RAM, GeForce RTX 5070 12 GB, driver 621.40. Series X at 1440p, DLSS Quality, frame generation off, with the default ray-tracing settings.
  • Before: The page-mapping trace showed calls waiting hundreds of milliseconds for previous GPU work and its writes, but the combined timer could not distinguish fences, copy-back, and resource release.
  • After: One relay retirement released 71,721 objects and spent 403.0 ms in release versus 1.2 ms draining the retirement queue. A separate 1.40-second submission included 634 ms refreshing resources ahead of writes and 718 ms in the GPU-copy preparation phase. These are diagnostic observations on this machine.
  • The release build passed and ran with the flags enabled. That test build also included the independent Xbox page-lifetime logging from #1545. The GPU source in this PR matches the tested build.
  • Shader changes: none.
  • cargo test: not run for this follow-up.

Checked for overlap

  • Searched open pull requests for the same behavior and the affected paths. Related: #1545 traces Xbox backing-section lifetimes, #842 counts changed pieces in relay copy-back, #631 establishes the remap ordering, and #1358 proposes moving retirement off the relay thread. This PR measures the behavior without applying the proposed scheduling change.
**@⁠jeremygold02** on GitHub · 2026-11-28 21:46 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1564) `jeremygold02:codex/gpu-stall-diagnostics` → `main` · +199 −32 · 4 files · 3 commits · merged 2026-11-29 08:16 UTC ## What it changes Long frames can overlap GPU fence waits, CPU submission preparation, and cleanup of completed work. This adds timestamped, opt-in measurements to distinguish them in a release build. It preserves submission and retirement ordering. | Flag | Measurements | |---|---| | `VICTORY_REMAP_TIMING=1` | Queue synchronization, waiting for earlier writes, and application time for page-mapping calls of at least 5 ms | | `VICTORY_RELAY_TIMING=1` | Main and readback fence waits, copy-back, publication, resource retirement lock/drain/release, and relay line updates | | `VICTORY_SUBMISSION_TIMING=1` | Worker jobs and host submissions of at least 10 ms, with submission phases of at least 1 ms listed | | `VICTORY_MEMORY_TRACE=1` | Periodic process working set and commit, free physical RAM, and local/shared GPU usage and budgets | All four flags default to off and enable only on the exact value `1`. The launcher defaults are unchanged. Set `VICTORY_LOG=warn,victory_gpu::host=info,victory_gpu::queue=info,victory_gpu::frame_times=info` to capture the events. ## How it was tested - **Setup:** Windows 11 Home build 26200, Intel Core Ultra 7 265K, 32 GB RAM, GeForce RTX 5070 12 GB, driver 621.40. Series X at 1440p, DLSS Quality, frame generation off, with the default ray-tracing settings. - **Before:** The page-mapping trace showed calls waiting hundreds of milliseconds for previous GPU work and its writes, but the combined timer could not distinguish fences, copy-back, and resource release. - **After:** One relay retirement released 71,721 objects and spent 403.0 ms in release versus 1.2 ms draining the retirement queue. A separate 1.40-second submission included 634 ms refreshing resources ahead of writes and 718 ms in the GPU-copy preparation phase. These are diagnostic observations on this machine. - The release build passed and ran with the flags enabled. That test build also included the independent Xbox page-lifetime logging from #1545. The GPU source in this PR matches the tested build. - Shader changes: none. - `cargo test`: not run for this follow-up. ## Checked for overlap - [x] Searched open pull requests for the same behavior and the affected paths. Related: #1545 traces Xbox backing-section lifetimes, #842 counts changed pieces in relay copy-back, #631 establishes the remap ordering, and #1358 proposes moving retirement off the relay thread. This PR measures the behavior without applying the proposed scheduling change.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 21:48:42 +00:00
github manually merged commit 3dfab24836 into main 2026-11-29 08:21:56 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
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
github/trustno1-coder--VIctory-NVIDIA!1564
No description provided.