GPU: time commands by pipeline in VICTORY_GPU_TIMING #1735
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1735
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1735"
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?
@Nixitov on GitHub · 2026-11-24 21:34 UTC · original
Nixitov:prof/gpu-cost→main· +203 −26 · 4 files · 1 commits · openWhat it did
VICTORY_GPU_TIMING=1loggedcommands=0and named nothing. A list only kept command notes, and their timestamps, whenVICTORY_D3D12_DREDwas on: the notes existed for the device-removed report alone. So the timing report could only ever show the slowest commands of a list that happened to also have DRED data.What it does now
noting()), and end-of-command markers are kept to the DRED case that reads them. The timestamps are the notes.GPU cost by pipeline, one line per pipeline: ms/frame, share of the noted time, ms per command, commands/frame. Labels drop per-draw addresses and keep the pipeline hashes, so one pass adds up across the frame, e.g.dispatch_dims), so a slow indirect pass is named with what it launched.VICTORY_GPU_TIMING, as it does now, so its command timestamps are its own and the report reads them as soon as its submission finished.translategrowsVICTORY_NAME_SHADERS=<file>, which appends<hash>\t<source>for every shader container, so a pipeline the runtime names by a 16-digit hash can be named by the RPF source it came from.Measured
RTX 5070, Windows 11 26200.9974, driver 617.14, diagnostics build, title run with
VICTORY_GPU_TIMING=1:commands=0in every report, no pipeline named.Tested
Base
mainffe310e:cargo build --release -p victory: clean.cargo build --profile diag -p victory --features diagnostics: clean.cargo test --workspace --locked --no-fail-fast: all suites pass (0 failed).cargo test --release -p victory-gpu: 50 passed, 1 ignored.cargo clippy --workspace --all-targets --locked -- -D warnings, with and without--all-features: clean.The timing report itself is only exercised by a diagnostics run with a GPU and a title; it has no unit test.
No game data.
AI-assisted (DeepSeek V4.1 Flash coding agent).
@Marvisak on GitHub · 2026-11-25 01:35 UTC · original
Automated triage for the maintainers.
Needs rebase. This pull request conflicts with
main(conflicting:README.md,apps/victory/src/translate.rs,crates/victory-gpu/src/host.rs). It will be reviewed once it is rebased onto the currentmain.Generated by Claude Code
@r4tedx on GitHub · 2026-11-25 20:52 UTC · original
@Nixitov, thanks for this. The per-pipeline report found where our GPU time goes in one run. One problem in how it divides, though: the per-frame figures come out several times too high when the frame rate is low.
In
Meter::frame(host.rs),costs::log(frames)getsframesfrom the 1-second meter: the frames sinceself.since, which the same call has just reset. But the cost tally covers everything since the last 5-second log, the same spancopystat::loguses, and that one divides bycopy_stats_frames. At ~1.2 fps the 1-second window holds about 2 frames, while about 6 fall in the 5-second span, so every "ms/frame" and "/frame" figure in the report is about 3× too high. "ms each" is unaffected.What we saw that gave it away, in our play build with this PR merged (RTX 5070, about 1.2 fps): every per-frame command count in the report was a multiple of 3, and the noted total came to about 993 ms/frame against 374 ms "on the GPU" in the fps line of the same frames. Divided by 3, it's about 331.
A fix that keeps both reports on the same frames:
Local title data was used for that run; only counts and timings from the log are given here.
AI-assisted
@andrewpozdnakov7-jpg on GitHub · 2026-11-26 07:34 UTC · original
VICTORY_GPU_TIMINGregression resultsI ran the same synthetic D3D12 WARP fixture on upstream
main(63bcca43c6a00a758510398fa43096ce7e4f7df0) and a local adaptation of the timing changes from this PR (853bdf540238707d066bc366ccf6eb95fdc5660e). Each list contained twoCopyBufferRegioncommands. The copied values were verified in all cases.main, DRED offmain, DRED onmainemitted no report for a single list in either mode. With DRED off, the same submission on the patch emitted the following lines.The low-FPS regression used two consecutive report windows. The first produced 20 ms/frame and 2 commands/frame from 120 ms, 12 commands and 6 presents. The second produced 4 ms/frame and 1 command/frame from 12 ms, 3 commands and 3 presents. Closing the report takes the guest-present count and the completed-list samples together.
Queue wait is included in the list wall time, measured around submission through the fence wait. GPU command time comes from intervals between timestamps recorded within the list.
The diagnostics suite on app-local Agility SDK and WARP passed 247 tests, with two ignored by default. The ignored timing fixture passed when run explicitly in both DRED modes. Three texture and pipeline tests failed in the full diagnostics run on system WARP and passed with the app-local runtime. The default suite passed 231 tests and strict Clippy passed in both feature configurations.
The local adaptation retains the original Git author from #1735. If these regression tests or the frame-window fix are folded into another commit, please retain their credit with
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.AI-assisted.
@andrewpozdnakov7-jpg on GitHub · 2026-11-26 07:38 UTC · original
@Nixitov The timing fix and regression tests are available in
853bdf5, oncodex2/gpu-timing-report. It adapts the timing changes from #1735 onto63bcca4and preserves the original Git author.On the same WARP fixture,
mainemitted no report for a single list. The patch reported2.00 commands/framein both DRED modes. For two lists, including a repeat of the same list, the count went from 0 to 4 with DRED off and stayed at 4 with DRED on.The two low-FPS report windows produced
20 ms/frame, 2 commands/frameand4 ms/frame, 1 command/frame. If you fold the regression tests or the frame-window fix into another commit, please retainCo-authored-by: andrewpozdnakov7-jpg <[email protected]>.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.