Copy-back of 27.8 MB costs 100 ms of a 210 ms frame (RTX 5070 Ti) #3590

Open
opened 2026-11-27 19:40:38 +00:00 by github-bot · 6 comments
Owner

@⁠ChenmouXu on GitHub · 2026-11-27 19:34 UTC · original

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: main 63bcca4 + #2626 + #2098 + #2178 + the packed target format diagnostic commit.

The frame line:

4.8 fps, 210.0 ms/frame (125.5 preparing: copies 39.8 ms 68.5 MB,
textures 8.3 ms 7.8 MB; 76.2 on the GPU; 100.0 copying back 27.8 MB),
4611 draws/frame, dropped 271 without a host pipeline (0 being made) and 591 indirect

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:

  • the same frame with VICTORY_LOG=info across two or three frames, to see whether the 100 ms is stable or spiky;
  • the range count per copy-back, if there is a line that reports it, to separate "many small ranges" from "few large ones";
  • the same scene at --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.

**@⁠ChenmouXu** on GitHub · 2026-11-27 19:34 UTC · [original](https://github.com/Marvisak/VIctory/issues/3590) **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: `main` `63bcca4` + #2626 + #2098 + #2178 + the `packed target format` diagnostic commit. **The frame line:** ``` 4.8 fps, 210.0 ms/frame (125.5 preparing: copies 39.8 ms 68.5 MB, textures 8.3 ms 7.8 MB; 76.2 on the GPU; 100.0 copying back 27.8 MB), 4611 draws/frame, dropped 271 without a host pipeline (0 being made) and 591 indirect ``` **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:** - the same frame with `VICTORY_LOG=info` across two or three frames, to see whether the 100 ms is stable or spiky; - the range count per copy-back, if there is a line that reports it, to separate "many small ranges" from "few large ones"; - the same scene at `--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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 19:40:39 +00:00
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-27 19:54 UTC · original

@⁠ChenmouXu, #3594 adds the range measurement. In a build with diagnostics and VICTORY_LOG=info, look for copy-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 pages counters 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 pages figures from copies per frame. The synthetic Windows verification is linked below.

Verification

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-27 19:54 UTC · [original](https://github.com/Marvisak/VIctory/issues/3590#issuecomment-7226989607) @⁠ChenmouXu, #3594 adds the range measurement. In a build with `diagnostics` and `VICTORY_LOG=info`, look for `copy-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 pages` counters 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 pages` figures from `copies per frame`. The synthetic Windows verification is linked below. [Verification](https://git.gtahub.st/github/Marvisak--VIctory/pulls/3594)
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-27 20:13 UTC · original

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 pages line 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

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-27 20:13 UTC · [original](https://github.com/Marvisak/VIctory/issues/3590#issuecomment-7227302364) The [paired branch](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/e7fc3fba4066f4306537fd7ccc45d17b532455d3) 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 pages` line 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](https://git.gtahub.st/github/Marvisak--VIctory/pulls/3594)
Author
Owner

@⁠ChenmouXu on GitHub · 2026-11-27 20:27 UTC · original

Measured with the fields from #3594 -- and the copy-back is not the problem I reported; the GPU time is

Build: main 63bcca4 + #2626 + #2098 + #2178 + the packed-format diagnostic 76f8792 + 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:

copy-back ranges per frame: eligible=4 written=0 withheld=0
copy-back ranges per frame: eligible=7 written=0 withheld=0
copy-back ranges per frame: eligible=6 written=0 withheld=0

1.4 fps, 711.5 ms/frame (126.6 preparing: copies 56.5 ms 223.3 MB,
  textures 6.9 ms 8.6 MB; 543.9 on the GPU; 38.9 copying back 37.4 MB), 3366 draws/frame
1.3 fps, 774.5 ms/frame (120.3 preparing: copies 55.8 ms 217.0 MB,
  textures 6.3 ms 7.7 MB; 612.7 on the GPU; 39.3 copying back 37.7 MB), 3718 draws/frame

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=ultraperformance with VICTORY_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=1 on this save.

**@⁠ChenmouXu** on GitHub · 2026-11-27 20:27 UTC · [original](https://github.com/Marvisak/VIctory/issues/3590#issuecomment-7227526654) Measured with the fields from #3594 -- and the copy-back is not the problem I reported; the GPU time is Build: `main` `63bcca4` + #2626 + #2098 + #2178 + the packed-format diagnostic `76f8792` + `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: ``` copy-back ranges per frame: eligible=4 written=0 withheld=0 copy-back ranges per frame: eligible=7 written=0 withheld=0 copy-back ranges per frame: eligible=6 written=0 withheld=0 1.4 fps, 711.5 ms/frame (126.6 preparing: copies 56.5 ms 223.3 MB, textures 6.9 ms 8.6 MB; 543.9 on the GPU; 38.9 copying back 37.4 MB), 3366 draws/frame 1.3 fps, 774.5 ms/frame (120.3 preparing: copies 55.8 ms 217.0 MB, textures 6.3 ms 7.7 MB; 612.7 on the GPU; 39.3 copying back 37.7 MB), 3718 draws/frame ``` 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=ultraperformance` with `VICTORY_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=1` on this save.
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-27 20:31 UTC · original

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 63bcca4 can 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 verification

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-27 20:31 UTC · [original](https://github.com/Marvisak/VIctory/issues/3590#issuecomment-7227580431) 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 `63bcca4` can 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 verification](https://git.gtahub.st/github/Marvisak--VIctory/pulls/3534)
Author
Owner

@⁠ChenmouXu on GitHub · 2026-11-27 20:36 UTC · original

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: main 63bcca4 + #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.

GPU timing: lists 526.8 ms/frame of wall time, their commands 485.8 ms/frame

The slow list command lines, grouped (306 in total):

command count
dispatch 144
indirect kind 10 55
indirect kind 2 49
draw 1

The largest single one is 3.7 ms:

slow list command, 3.7 ms: indirect kind 10 max 1 at 0xd49401e00
  [mesh 5bd95fdec765c0d6, pixel 398971d1222d8f95] ...

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:

0.4 fps, 2528.5 ms/frame (1137.8 preparing ...; 760.5 on the GPU; 625.0 copying back 84.7 MB),
4121 draws/frame, dropped 4266 ...

VICTORY_GPU_TIMING runs 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.

**@⁠ChenmouXu** on GitHub · 2026-11-27 20:36 UTC · [original](https://github.com/Marvisak/VIctory/issues/3590#issuecomment-7227672937) 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: `main` `63bcca4` + #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. ``` GPU timing: lists 526.8 ms/frame of wall time, their commands 485.8 ms/frame ``` The `slow list command` lines, grouped (306 in total): | command | count | |---|---| | dispatch | 144 | | indirect kind 10 | 55 | | indirect kind 2 | 49 | | draw | 1 | The largest single one is 3.7 ms: ``` slow list command, 3.7 ms: indirect kind 10 max 1 at 0xd49401e00 [mesh 5bd95fdec765c0d6, pixel 398971d1222d8f95] ... ``` 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: ``` 0.4 fps, 2528.5 ms/frame (1137.8 preparing ...; 760.5 on the GPU; 625.0 copying back 84.7 MB), 4121 draws/frame, dropped 4266 ... ``` `VICTORY_GPU_TIMING` runs 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.
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-27 20:46 UTC · original

@⁠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 command lines 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.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-27 20:46 UTC · [original](https://github.com/Marvisak/VIctory/issues/3590#issuecomment-7227832963) @⁠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 command` lines 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.
This discussion has been locked. Commenting is limited to contributors.
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/Marvisak--VIctory#3590
No description provided.