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

Merged
jeremygold02 merged 3 commits from upstream-pr/1564 into main 2026-11-29 08:16:55 +00:00
jeremygold02 commented 2026-11-28 21:46:17 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by jeremygold02 on 2026-11-28T21:46:17Z.


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.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5544876586 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1564). Originally posted by [jeremygold02](https://github.com/jeremygold02) on 2026-11-28T21:46:17Z. --- ## 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.
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
trustno1-coder/VIctory-NVIDIA!1564
No description provided.