Frame time breakdown on a 6 GB card (RTX 2060): relay fetches and remap waits dominate #431

Open
opened 2026-11-26 03:43:09 +00:00 by github-bot · 3 comments
Owner

@⁠CIS-C0 on GitHub · 2026-11-25 00:46 UTC · original

Measurements from a smaller card, in case they help. Nothing crashes; this is about where the frame time goes.

Setup

  • RTX 2060 6 GB (VIctory reports vram_budget_mb=5187), Windows 11, about 80 GB RAM
  • main at a803c87c, release build
  • In the world, VICTORY_DISPLAY_MODE=854x480
  • VICTORY_RELAY=2 VICTORY_PIPELINE_WAIT_MS=24 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024
  • The pipeline library was warm (about 2,300 pipelines loaded).

What the switches did

Defaults With the switches
Card busy (card's clock line) 17–47% up to 80%
CPU compares of title buffers' copies about 430 MB per frame about 35 MB per frame
Typical frame 1–2 fps about 500 ms
Best frame — 172 ms

Resolution made no difference: 4K, 720p and 480p gave the same frame times.

Where the time goes now (per frame)

  • Relay thread, waiting for fetches of card copies' pieces: 225–450 ms. The fetch goes to the same queue, so each one waits behind every list sent ahead. Landing in all takes 275–540 ms.
  • Settles, "lists in the air": 140–340 ms. The submitting thread waits for the relay.
  • Settles, "title memory read": 74–200 ms, mostly fills of upload memory.
  • Texture refreshes, "waiting for title memory to hold still (the runtime remapping it)": often 75–500 ms. This is the largest single item in some frames.

VICTORY_LATE_WAIT_LISTS

128 (default) 64
Typical frame 496 ms 500 ms
Best frame 207 ms 172 ms
Waiting for fetches 287 ms 226 ms
"lists in the air" 140 ms 224 ms
"a draw whose descriptor table found no free slots is dropped" once never

So 64 may be the safer default on cards with less memory.

The fetch's place in the queue looks deliberate: its QUEUE_ORDER position is what lets card_merge_relay tell bytes the card had not received from shader writes. That's why I'm reporting numbers rather than proposing a separate copy queue. I'm happy to run builds or switches on this card and post the lines.

**@⁠CIS-C0** on GitHub · 2026-11-25 00:46 UTC · [original](https://github.com/fxceless/victory-fork/issues/431) Measurements from a smaller card, in case they help. Nothing crashes; this is about where the frame time goes. **Setup** - RTX 2060 6 GB (VIctory reports `vram_budget_mb=5187`), Windows 11, about 80 GB RAM - main at a803c87c, release build - In the world, `VICTORY_DISPLAY_MODE=854x480` - `VICTORY_RELAY=2 VICTORY_PIPELINE_WAIT_MS=24 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024` - The pipeline library was warm (about 2,300 pipelines loaded). **What the switches did** | | Defaults | With the switches | |---|---|---| | Card busy (card's clock line) | 17–47% | up to 80% | | CPU compares of title buffers' copies | about 430 MB per frame | about 35 MB per frame | | Typical frame | 1–2 fps | about 500 ms | | Best frame | — | 172 ms | Resolution made no difference: 4K, 720p and 480p gave the same frame times. **Where the time goes now (per frame)** - **Relay thread, waiting for fetches of card copies' pieces:** 225–450 ms. The fetch goes to the same queue, so each one waits behind every list sent ahead. Landing in all takes 275–540 ms. - **Settles, "lists in the air":** 140–340 ms. The submitting thread waits for the relay. - **Settles, "title memory read":** 74–200 ms, mostly fills of upload memory. - **Texture refreshes, "waiting for title memory to hold still (the runtime remapping it)":** often 75–500 ms. This is the largest single item in some frames. **`VICTORY_LATE_WAIT_LISTS`** | | 128 (default) | 64 | |---|---|---| | Typical frame | 496 ms | 500 ms | | Best frame | 207 ms | 172 ms | | Waiting for fetches | 287 ms | 226 ms | | "lists in the air" | 140 ms | 224 ms | | "a draw whose descriptor table found no free slots is dropped" | once | never | So 64 may be the safer default on cards with less memory. The fetch's place in the queue looks deliberate: its `QUEUE_ORDER` position is what lets `card_merge_relay` tell bytes the card had not received from shader writes. That's why I'm reporting numbers rather than proposing a separate copy queue. I'm happy to run builds or switches on this card and post the lines.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:43:09 +00:00
Author
Owner

@⁠Peppacodes on GitHub · 2026-11-25 03:14 UTC · original

Where the "title memory read: a fill of upload memory" settles come from, measured on an RTX 5080 (driver 621.24, Ryzen 7 5700X3D).

Setup:

  • Fork main c96b4f2 + #220, plus #28's watchdog hook and 64 MB pipeline-worker stacks.
  • The new defaults, plus VICTORY_INDIRECT_WINDOW=1.

About one settle a frame waits 23–32 ms for the card, nearly all for a fill of upload memory. On this machine that sits on the frame's critical path: the submitting thread spends ~110–125 ms preparing plus this wait.

I tagged each Step::Fill with the place that recorded it: root view, table constant buffer, or texture upload. Then I logged the first 80 fills that blocked_by held back, with the declared write range they overlapped.

  • All 80 were descriptor-table constant buffer views. These come from the View::Constant arm in draw.rs, which calls defer_fill. They are 48–480 bytes each.
  • All 80 lay inside one declared range: a 182,452,224-byte (174 MB) title buffer, the one kept on the card with VICTORY_CARD_BUFFERS_MIN_MB=1. So each frame the CPU waits for flights whose shaders may write somewhere in that buffer, in order to copy a few hundred bytes of constants out of it.
  • In the first run most of them were 256-byte aligned. Branch gpu/table-constants-in-copy on my fork (fa6afac, +31 lines, one function) reads those from the buffer's host copy instead, refreshed at submission the way an aligned root view already is. VICTORY_TABLE_CB_IN_COPY=0 turns it off.
    • With it, every held-back fill left is unaligned (offsets 48–224 mod 256; the console only needs 16-byte alignment).
    • Settles per frame went from 1.0–1.1 to 0.6–0.9, and their wait from 23–32 ms to 19–22 ms.
    • That's one run each, and the frame time was within noise (147 vs 154 ms), so I'm not claiming a speed-up.
  • The unaligned ones can't be a constant buffer view into the copy. Copying them on the card would remove the rest: a copy from the host copy into the list's own memory, recorded in the list so it runs after the flights in queue order, instead of the CPU fill. I haven't tried that.

AI-assisted (Claude Code). Runs on my own machine with my own copy; counts only.

**@⁠Peppacodes** on GitHub · 2026-11-25 03:14 UTC · [original](https://github.com/fxceless/victory-fork/issues/431#issuecomment-7151733239) Where the "title memory read: a fill of upload memory" settles come from, measured on an **RTX 5080** (driver 621.24, Ryzen 7 5700X3D). Setup: - Fork main `c96b4f2` + #220, plus #28's watchdog hook and 64 MB pipeline-worker stacks. - The new defaults, plus `VICTORY_INDIRECT_WINDOW=1`. About one settle a frame waits 23–32 ms for the card, nearly all for a fill of upload memory. On this machine that sits on the frame's critical path: the submitting thread spends ~110–125 ms preparing plus this wait. I tagged each `Step::Fill` with the place that recorded it: root view, table constant buffer, or texture upload. Then I logged the first 80 fills that `blocked_by` held back, with the declared write range they overlapped. - **All 80 were descriptor-table constant buffer views.** These come from the `View::Constant` arm in `draw.rs`, which calls `defer_fill`. They are 48–480 bytes each. - **All 80 lay inside one declared range:** a 182,452,224-byte (174 MB) title buffer, the one kept on the card with `VICTORY_CARD_BUFFERS_MIN_MB=1`. So each frame the CPU waits for flights whose shaders may write somewhere in that buffer, in order to copy a few hundred bytes of constants out of it. - **In the first run most of them were 256-byte aligned.** Branch `gpu/table-constants-in-copy` on my fork (`fa6afac`, +31 lines, one function) reads those from the buffer's host copy instead, refreshed at submission the way an aligned root view already is. `VICTORY_TABLE_CB_IN_COPY=0` turns it off. - With it, every held-back fill left is unaligned (offsets 48–224 mod 256; the console only needs 16-byte alignment). - Settles per frame went from 1.0–1.1 to 0.6–0.9, and their wait from 23–32 ms to 19–22 ms. - That's one run each, and the frame time was within noise (147 vs 154 ms), so I'm not claiming a speed-up. - **The unaligned ones can't be a constant buffer view into the copy.** Copying them on the card would remove the rest: a copy from the host copy into the list's own memory, recorded in the list so it runs after the flights in queue order, instead of the CPU fill. I haven't tried that. AI-assisted (Claude Code). Runs on my own machine with my own copy; counts only.
Author
Owner

@⁠Peppacodes on GitHub · 2026-11-25 03:30 UTC · original

Update: this was already found and fixed before my comment above, so please use the existing work, not my branch:

  • dkdknight diagnosed the same wait on an RTX 5080 in #107 (#107). That includes the finding that once fills stop waiting, the settle moves on to the next reason.
  • #144 (MartinIndra02) is the same change as my aligned-only branch, and it was opened earlier.
  • #462 / #522 (iurysf) copy the table constant buffers that flights write on the card, aligned or not (−35 ms/frame on an RTX 4070).

I'll test #462 on the 5080 and post the numbers there.

AI-assisted (Claude Code).

**@⁠Peppacodes** on GitHub · 2026-11-25 03:30 UTC · [original](https://github.com/fxceless/victory-fork/issues/431#issuecomment-7151983321) **Update:** this was already found and fixed before my comment above, so please use the existing work, not my branch: - dkdknight diagnosed the same wait on an RTX 5080 in #107 (https://git.gtahub.st/github/fxceless--victory-fork/issues/107). That includes the finding that once fills stop waiting, the settle moves on to the next reason. - #144 (MartinIndra02) is the same change as my aligned-only branch, and it was opened earlier. - #462 / #522 (iurysf) copy the table constant buffers that flights write on the card, aligned or not (−35 ms/frame on an RTX 4070). I'll test #462 on the 5080 and post the numbers there. AI-assisted (Claude Code).
Author
Owner

@⁠HLVM04 on GitHub · 2026-11-25 08:21 UTC · original

A data point on the fetch wait from a newer tree. At 9376fd6 there is VICTORY_CARD_FETCH_INFLIGHT=1, which puts the card fetches inside their flights. On an RTX 5070 Ti 16 GB (Series X profile, VICTORY_CARD_WINDOWS_MB=4096, otherwise defaults):

  • the relay thread's fetch wait went to 0 ms;
  • but the relay thread then waited about 189 ms a frame for the card instead;
  • the median frame was 582 ms in that run, against 257 ms without the switch.

So on this card the wait moved rather than went away, and there was no gain. One run per setting and the scene was not identical, so the size of the slowdown may be partly scene variance. The other switches measured on the same tree are in #696.

**@⁠HLVM04** on GitHub · 2026-11-25 08:21 UTC · [original](https://github.com/fxceless/victory-fork/issues/431#issuecomment-7156927578) A data point on the fetch wait from a newer tree. At `9376fd6` there is `VICTORY_CARD_FETCH_INFLIGHT=1`, which puts the card fetches inside their flights. On an RTX 5070 Ti 16 GB (Series X profile, `VICTORY_CARD_WINDOWS_MB=4096`, otherwise defaults): - the relay thread's fetch wait went to 0 ms; - but the relay thread then waited about 189 ms a frame for the card instead; - the median frame was 582 ms in that run, against 257 ms without the switch. So on this card the wait moved rather than went away, and there was no gain. One run per setting and the scene was not identical, so the size of the slowdown may be partly scene variance. The other switches measured on the same tree are in #696.
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/fxceless--victory-fork#431
No description provided.