Copy-back of 27.8 MB costs 100 ms of a 210 ms frame (RTX 5070 Ti) #3590
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Imported from Marvisak/VIctory. Originally posted by ChenmouXu on 2026-11-27T19:34:58Z.
Copy-back of 27.8 MB costs 100 ms of a 210 ms frame (RTX 5070 Ti, 0x887A-free, picture correct)
Split out from #2626 at andrewpozdnakov7-jpg's suggestion: the copy-back path is separate from the refresh/copy work #2428 touches, so it does not belong in that PR's review.
Machine: RTX 5070 Ti Laptop (Blackwell, driver 32.0.16.1074), Ryzen 9 9955HX, 32 GB, Windows 11 26200. Title 1.0.2.1, Series S profile, DLSS Quality (0.667), 4,611 draws/frame. Stack:
main63bcca4+ #2626 + #2098 + #2178 + thepacked target formatdiagnostic commit.The frame line:
Why it looks wrong: 27.8 MB in 100.0 ms is about 280 MB/s. A PCIe link on this machine is an order of magnitude faster than that, so the time is most likely per-range setup or stalls rather than bandwidth. It is also the largest single line in the frame after preparation, and it sits on the CPU side of the present, so it lands directly in the frame time.
What I can measure if it is useful:
VICTORY_LOG=infoacross two or three frames, to see whether the 100 ms is stable or spiky;--console series-x, where the buffers are larger, to see whether the cost scales with bytes or with ranges.Point me at the switch or line you want and I will run it; I do not have a build with instrumentation beyond the diagnostics profile.
Not claimed: that this is worse than expected for this design -- only that 280 MB/s for a copy-back looks like per-range cost, and that it is now the largest line in a 210 ms frame.
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T19:54:40Z.
@ChenmouXu, #3594 adds the range measurement. In a build with
diagnosticsandVICTORY_LOG=info, look forcopy-back ranges per frame. It reports the average counts of distinct explicit ranges eligible for copy-back, ranges that actually write bytes, and ranges withheld.The time in the existing frame line starts before the range collection and includes marked-page handling and after-submission work. The MB beside it come from writes through the explicit range path. The separate
marked pagescounters already report their own bytes and time.If you can repeat the same scene with the same settings, two or three reporting windows would help. Please share only the FPS/copy-back timing, the new range line and the
marked pagesfigures fromcopies per frame. The synthetic Windows verification is linked below.Verification
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T20:13:55Z.
The paired branch is available if you want both measurements in one diagnostics build. It combines #3594 and #3598. In this build the MB in the frame line already include the writes from marked pages. The
marked pagesline gives that component separately.The same report fields from my earlier comment are enough. Please include the commit used with the sample so we can read the byte total correctly. Both reporting paths were verified on Windows WARP.
Paired verification
Imported from Marvisak/VIctory. Originally posted by ChenmouXu on 2026-11-27T20:27:35Z.
Measured with the fields from #3594 -- and the copy-back is not the problem I reported; the GPU time is
Build:
main63bcca4+ #2626 + #2098 + #2178 + the packed-format diagnostic76f8792+e7fc3fba(#3594 and #3598) applied on top, diagnostics profile,VICTORY_LOG=info, Series S profile, DLSS Quality (0.667), 1,440 picture. Same save as before.Three reporting windows:
So with these fields: 38.9-39.3 ms copying back 37.4 MB, and zero explicit ranges actually wrote bytes -- every eligible range came back written=0, which says the bytes in that MB figure come through the marked-pages path, exactly as you described. Effective ~950 MB/s on the copy-back, not the ~280 MB/s I reported.
My earlier number was not comparable and I should withdraw it. The 100 ms / 27.8 MB sample came from
VICTORY_DLSS_MODE=ultraperformancewithVICTORY_MENU_RES=1080to1440; these are Quality at 1440. Different render resolution, different frame mix. So there is no evidence here that the copy-back is unusually slow, and the 280 MB/s reading was an artefact of comparing two different configurations.What the same windows do show is where the frame actually goes: 543.9 and 612.7 ms on the GPU, against 120-127 ms of preparation. At 3,366-3,718 draws the card is the limit in this profile, not the copy-back and not the submission.
I am sorry for sending you after a number that did not survive the measurement -- the instrumented fields are what settled it. If a GPU-side question is more useful, I can keep the same build and report the frame line with
VICTORY_GPU_TIMING=1on this save.Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T20:31:00Z.
Thanks for the matched windows. In the two full samples, the GPU accounts for 544–613 ms of the 712–775 ms frame and copy-back accounts for about 39 ms. Zero explicit writes identifies the marked-page path as the source of the reported bytes on this branch. The earlier sample used a different render configuration.
A GPU timing sample on the same Quality/1440 settings would help attribute the longer interval. The command timing on
63bcca4can be empty when DRED is off. #3534 enables command timing and I verified that path on Windows WARP. If you take another sample, please share only the aggregate slow command types and durations, plus the frame line. Timing verificationImported from Marvisak/VIctory. Originally posted by ChenmouXu on 2026-11-27T20:36:44Z.
GPU timing on Quality/1440 (Series X): 486 ms of commands, and no single slow command -- 306 of them, none over 3.7 ms
Build:
main63bcca4+ #2626 + #2098 + #2178 +76f8792(packed-format line) +e7fc3fb(#3594/#3598) + #3534 for the command timing. Diagnostics profile,VICTORY_LOG=info,VICTORY_GPU_TIMING=1, Series X profile, DLSS Quality (0.667), 1,440 picture, same save. 4,121 draws/frame.The
slow list commandlines, grouped (306 in total):The largest single one is 3.7 ms:
So the 486 ms is not a bottleneck command that could be named and fixed: it is ~300 commands averaging ~1.6 ms each, and the count is dominated by compute dispatches rather than draws. If that is the shape on your side too, the lever is fewer commands or a cheaper per-command path, not a single hot command.
One caveat on the frame line from the same window, so it is not read as a regression:
VICTORY_GPU_TIMINGruns the lists separately, which is where the 4,266 dropped draws and the much longer frame come from -- the ordinary frame line is the baseline, as you said. The 486 ms of commands is the part worth comparing.If a breakdown of what the 144 dispatches do is useful (their pipelines or their sizes), say which field you want and I will pull it from the same run.
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T20:46:51Z.
@ChenmouXu The most useful lines from that same run are the five highest
GPU … ms/frame in … commands/frame: dispatch […]entries under the 485.8 ms/frame summary. Those lines already carry the cumulative time, count and pipeline tag. If the first entry stands out, the dispatch group dimensions for just that pipeline would help distinguish a large workload from a frequently repeated one. The aggregate lines alone are enough if dimensions take extra work to extract.The
slow list commandlines show up to six commands from each separately timed list whose wall time exceeds 50 ms. The 485.8 ms/frame summary includes all timestamped commands on the timed lists, so the aggregate pipeline lines are the better starting point for prioritizing. The timing mode waits for each list separately. I will keep the timing-off window as the frame-rate baseline given the change in dropped draws. Thanks for recording both.Imported from Marvisak/VIctory. Originally posted by ChenmouXu on 2026-11-28T02:37:30Z.
The five highest from that window -- and two of them are single commands per frame that cost 147 ms together
Same run and same window as the aggregate report above (
main63bcca4+ #2626 + #2098 + #2178 +76f8792+e7fc3fb+ #3534, diagnostics,VICTORY_GPU_TIMING=1, Series X, Quality/1440, 4,121 draws). UnderGPU timing: lists 526.8 ms/frame of wall time, their commands 485.8 ms/frame, the top entries of that window:indirect [compute 0184869d6e47e5fa]indirect [compute ce30cb330ef34306]indirect [mesh b7a81f5b96f4ca93, pixel 43e24028d4a1faef]dispatch [compute aaf7da7a94dc72a9]indirect [mesh 6016f52cd61f30f6]This corrects what I said about there being no hot command. The
slow list commandlines only name commands over 50 ms within a list that was timed separately, and these two never appeared there -- but one command per frame at 99 ms and 48 ms is 147 ms of the 486, about 30%, and they are the only entries in the top five with a count of 1.0/frame. Everything below them is the shape I described: many repetitions of a cheap command (467.0and88.5commands/frame).So it is both at once: two large one-off compute passes, and a long tail of repeated work.
Which is why the group dimensions you offered to look at would settle it for the top two: if
0184869d6e47e5fadispatches a very large grid, it is a different problem from a small grid repeated once, and the same force30cb330ef34306. I can pull the dispatch arguments for just those two pipelines from the same run if the log carries them -- say which field, or I will trydispatchgroup dimensions first.Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T02:39:49Z.
Thanks, this narrows the next check to the two indirect compute entries. They account for 147.01 ms/frame, about 30% of the 485.8 ms/frame in timestamped commands. The 1.0 commands/frame is a window average. The slow-list warnings cover only lists above their wall-time threshold.
On the reported stack,
dispatch XxYxZbelongs to direct dispatches. The indirect note carries the command kind and the maximum record count passed to ExecuteIndirect. The GPU consumes the actual group counts from the arguments, so that note has no X/Y/Z field to extract. The aggregate you already posted is enough to prioritize these two. For the next matched sample, the timing summary and frame line are sufficient. Please keep the timing-off sample as the frame-rate baseline.Imported from Marvisak/VIctory. Originally posted by ChenmouXu on 2026-11-28T03:49:49Z.
Peak per command settles it: the top two are single commands, and the first one is 178.77 ms on its own
Branch
889bf90(#3534 + #3651) merged onto the stack (main63bcca4+ #2626 + #2098 + #2178 +76f8792+e7fc3fb), diagnostics,VICTORY_LOG=info,VICTORY_GPU_TIMING=1, Series X, DLSS Quality (0.667), 1,440 picture, same save.Per pipeline, sorted by cumulative time, with the peak the new field reports:
indirect [compute bba90b2f0ff2eada]indirect [compute 919bafe017d59512]dispatch [compute 3cf39f4495b908d0]indirect [mesh b7a81f5b96f4ca93, pixel 43e24028d4a1faef]indirect [mesh ef5409053e14aa82, pixel 94d281151ca58b4f]dispatch [compute aaf7da7a94dc72a9]So the answer to "large interval or many short calls" splits cleanly:
The first two are single large commands. One
ExecuteIndirectofbba90b2f0ff2eadasampled at 178.77 ms, and one of919bafe017d59512at 52.38 ms. Together ~180 ms of the 479, about 38%, from two commands per frame. This is the kind of entry where the group counts would matter -- a very large grid, or a grid far larger than intended.The rest is the long tail.
3cf39f4495b908d0is 44.6 dispatches per frame with a 9.67 ms peak, and the mesh entries peak at 5-7 ms while repeating. Nothing there is worth naming.Both are in the same frame, so this is one frame with a 178 ms compute command and ~45 small ones -- worth knowing that the two shapes coexist rather than one explaining the other.
For scale: this window was 6,060 draws/frame (the earlier one was 4,121), so the absolute numbers are not directly comparable to the previous sample; the split between the two shapes is what the peak field adds.
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T03:51:40Z.
Thanks for running the peak build. The two indirect compute rows contribute 180.08 of 479.1 ms/frame in the sampled window, about 38%. Their
1.0 commands/frameis a window average. The 178.77 ms peak is one timestamp interval attributed to anExecuteIndirectcall. Work recorded before the next timestamp can contribute to that interval, and one call can execute several indirect records.If the matching
slow list commandlines are available, themaxvalue for each of those two tags is useful on its own. It gives the maximum number of records for that call. A later comparison is most useful with the same scene and draw-count range, plus the timing-off frame line as a performance control.Imported from Marvisak/VIctory. Originally posted by ChenmouXu on 2026-11-28T03:53:07Z.
Both hot tags are
indirect kind 2 max 1-- so the 179 ms is one dispatch doing real work, not many indirect recordsMatching
slow list commandlines from the same run as the peak sample:So for both of them
maxis 1: oneExecuteIndirectcall carrying a single record. That removes the "one call executed several indirect records" explanation for this window, and it means the 178.77 ms interval is one dispatch's own work rather than a pile of records in one call. With one record and no work recorded before it in that list, the earlier caveat about preceding work bleeding into the interval does not have much room here either -- though it is still one timestamp interval, not a GPU-side breakdown.Two more details that may mean something to you: both use
indirect kind 2, and both name the same heap (330576) with argument addresses 16 bytes apart (0xdc799b520and0xdc799b560). That reads like two stages of one pass rather than two unrelated passes.So the shape for these two is: one record, one dispatch, ~180 ms of GPU time, arguments written back to back in one heap. A grid-size question, or something in that pass that scales badly -- not an indirect-organisation question.
For the matching comparison you asked for, the timing-off frame line from this same run and scene is
1 fps, 1256.6 ms/frame, 6060 draws/frame; the peak sample itself wasGPU timing: lists 510.7 ms/frame of wall time, their commands 479.1 ms/frame. Draw counts here are higher than the earlier 4,121 window, so I can rerun until it lands in the same range if you want the two windows strictly comparable.Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T04:01:32Z.
Thanks,
max 1caps each indirect call at one record. The next measurement that can distinguish a large amount of compute work from a costly interval isCSInvocationsfor each tagged interval. The #1723 WARP fixture verified that counter on its own branch. It overlaps the current timing code, so the combined path needs the same check.The updated peak and coverage build gives a line when a list has notes beyond its timestamp budget. That line and the two timing rows are sufficient for another matched sample if you run one.
If either patch is reused, please retain the Git author on cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>when folding it into another commit.Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T04:11:12Z.
I put the counters together with the peak and note-coverage report in 9f64e98. With
VICTORY_GPU_TIMING=1, the slow-list rows includecompute runs Nfor the timed command interval. In a generated WARP dispatch throughExecuteIndirect, the row reported the expected 56 shader invocations with DRED on and off. The aggregate keeps the existing command and pipeline labels.ChenmouXu, if you can repeat the same short capture on this build, the useful lines are the slow-list command rows for the two
ExecuteIndirectgroups, with the interval time andcompute runs, plus the aggregate coverage line if present. The postedmax 1is the record limit for a call. The new counter measures shader invocations within the noted interval, which can include work before the next note.Please retain the Git authors on cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>if folding this resolution into another commit.AI-assisted with OpenAI Codex.
Imported from Marvisak/VIctory. Originally posted by ChenmouXu on 2026-11-28T05:23:19Z.
compute runson the two hotspots: 124,224 and 6,464 shader invocations, and the coverage line is presentSame stack with
9f64e98on top (main63bcca4+ #2626 + #2098 + #2178 +76f8792+ the #3594/#3598 counters +889bf90timing), diagnostics,VICTORY_LOG=info,VICTORY_GPU_TIMING=1, Series X, Quality/1440, same save. Draw count in this window was 3,978/frame (the frame-rate sample below).The two rows you asked about:
Both are compute-only as reported (0 primitives, 0 rasterized, 0 pixel runs),
kind 2 max 1, arguments 0x40 apart in the same heap -- and the pairing is lopsided: 124,224 runs forbbaa…against 6,464 for919b…, a 19:1 ratio, at nearly the same duration (50.4 vs 48.4 ms). So the second one does one nineteenth of the invocations in the same time: either its shader is ~19x more expensive per invocation, or it is waiting on the first. Worth knowing before anyone assumes the big count is the expensive part -- the duration is almost identical.For reference, the largest
compute runsin that window is a directdispatch 320x180x1of348e1e8c414c7ecaat 3,686,400 runs, which takes 0.1-0.2 ms. That is 30x the invocations ofbbaa…in 1/250th the time, so invocation count alone does not explain the 50 ms here; it is what the shader does, or a dependency.Coverage line from the same run:
Frame line with timing off for the control, same save and roughly the same draw range:
Peak report from the same run for completeness: the aggregate was
GPU timing: lists ... ms/frame of wall time, their commands ... ms/frame, and both tags still rank first and second by cumulative time.Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T05:27:21Z.
Thanks for the hardware follow-up. The two rows span 50.4 and 48.4 ms, while their compute invocation counts differ by 19.2x. The direct-dispatch control had far more invocations in a much shorter interval, so invocation count alone is a poor ranking signal for these hotspots.
The relevant quantities come from different queries. D3D12 pipeline statistics count invocations between the two query boundaries. D3D12 timestamps mark completion of preceding GPU work. The durations describe the noted intervals in this build. A dependency or additional work between notes can affect the interval, so there is still no measurement of either shader's isolated cost. The 5,497 over-budget notes also mean the ranked summary covers a subset of the submitted notes.
The useful next check for a renderer maintainer is a short GPU timing capture around those two dispatches on the same build, to correlate their intervals with intervening work and waits. The timing-off 932.4 ms/frame sample is the separate throughput control.
Please retain the Git authors if reusing the diagnostic code on cherry-pick or rebase, or add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>if folding it into another commit.AI-assisted with OpenAI Codex.