RDNA3 (RX 7800 XT): what the frame time is made of, what I ruled out, and what I expect is left #85

Open
opened 2026-12-01 17:58:50 +00:00 by github-bot · 0 comments
Owner

@⁠Aruku448 on GitHub · 2026-12-01 17:57 UTC · original

RDNA3 (RX 7800 XT): what the frame time is made of, what I could rule out, and what I expect is left

Two weeks on one machine with 37bb30f, mostly measuring rather than fixing. This is the summary I wish I had had at the start: which directions are worth anyone's time on this title, which are not, and how I convinced myself. Everything below is measured on this machine unless it says prediction.

Environment and operations

  • RX 7800 XT (NAVI32, gfx1101, 16 GB, BAR0 16 GB), Ryzen 7 5700X3D, 32 GB, Arch (kernel 7.3.6-cachyos), KDE Wayland
  • wine-staging 11.22-1.1, patches/wine.patch wineserver built from the wine-11.22 tag (protocol 979, which is what the distro client speaks)
  • Mesa 26.3.1 + patches/mesa.patch, vkd3d-proton 71cae09 + patches, DXC v1.9.2609, as pinned by setup.sh
  • Series X profile, default output (VICTORY_OUTPUT unset → 2560×1440) with the title's own 2/3 render scale → 1707×960 internal, ray tracing off
  • All 94 215 pipelines warmed (./run.sh warm, 195 s, cache 3.1 → 9.0 GiB); native pipeline missed at first use 1 724 → 0

Measurements

Frame split (936 reported frames, one session): median 35 ms. T = 18.2 ms + 8.16 ms/Mpx fits two points exactly — default 2/3 render (1.64 Mpx) → 31.6 fps, VICTORY_RENDER_SCALE=1.0 (3.69 Mpx) → 20.7 fps. So ~58 % of the frame is per-dispatch work and ~42 % is pixels.

Dispatch composition (diagnostics counters, in the world):

graphics  250 dispatches on  71 pipelines  (≈4 each)
mesh      242–1465 on  79–152 pipelines    (≈3–11 each)
compute  1726–1767 on 423–447 pipelines    (≈4 each)

i.e. the dispatch count is ≈ 4 × (number of distinct pipelines used that frame), which against the 94 215 known pipeline states means the workload is shader-variant bound, not object bound.

Mergeability. Consecutive draws share a pipeline 65–78 % of the time, but the full draw state (same vertex/index views, same root parameter addresses, same targets, viewports, blend/stencil) matches 0–1 % of the time. So VK_EXT_multi_draw cannot help: the binds differ per draw even when the pipeline repeats.

Memory is not the bottleneck. Measured with the IOMMU PMU (perf stat -a -e amd_iommu/mem_trans_total/,amd_iommu/mem_iommu_tlb_pte_mis/,amd_iommu/mem_iommu_tlb_pte_hit/,amd_iommu/page_tbl_read_tot/ -- sleep 60) over 60 s at 28.1 fps / 6 461 draws a frame:

904,416,813  mem_trans_total        → 529,721 per frame, 82 per draw
754,310,926  pte_hit                150,105,301  pte_mis   (16.6 %)
    132,499  page_tbl_read_tot      → 2,208 page-table reads a second

At 128–256 B per transaction that is 1.9–3.9 GB/s against a 27 GB/s PCIe 4.0 x16 ceiling: 7–14 %. The alias/PTE machinery costs ~2 200 page-table reads a second, i.e. nothing. Whatever the unified-memory design does for correctness, it is not where this title's frames go at this resolution.

The barrier storm is smaller than it looks. The title issues ~3 400 barriers a frame in 790 group calls (611 of them waiting on draws), but waits::after() collapses each group into one D3D12_GLOBAL_BARRIER (UAV → UAV, VS/PS/compute → ALL_SHADING) and already drops the groups whose stages are 0. The host sees ~790 global UAV barriers a frame — a 1–2 ms ceiling, not the 18 ms.

One thing that was worth changing. The lane blocked ~6 ms a frame on LATE_MOST (256 host lists in the air). With VICTORY_LATE_MOST=1024 the wait goes 6.0 → 0.0 ms and gpu_wait_ms 7.14 → 0.00, with no descriptor starvation. Frame rate did not change — which is itself the useful result: from that point on the frame is GPU-bound, so every CPU-side idea (refreshes batching, the submission lock, bypassing D3D12) buys nothing.

What I ruled out, and how

Direction Why I stopped
Prefetch / page grain / residency policy in the unified memory 7–14 % of PCIe, 2 200 page-table reads/s
Coalescing the title's barriers the host already sees synthesised, de-duplicated global barriers; 1–2 ms ceiling
Multi-draw / draw fusion full draw state differs on essentially every draw
Bypassing D3D12 with an own Vulkan backend saves CPU at 2.3 µs/draw, and the frame is GPU-bound
RADV_LAZY_L2_WRITEBACK=0, VKD3D_CONFIG=no_upload_hvv three interleaved rounds each, all inside a ±12 fps confidence interval — no signal either way at 1440p

Predictions (mine, not measured)

  1. Title settings that cut pipeline × view count will move the frame almost 1:1. Dropping shadow cascades, crowd density or draw distance should reduce the dispatch count proportionally, and the 18.2 ms with it. This is the only "free" lever I did not get to, and it is where I would look first.
  2. The same build on an RX 9070 XT should be ~1.25–1.4× this. The README's 44 fps at 1080p against our ~39 fps equivalent at the same output fits that, and it is front-end/dispatch throughput, not memory.
  3. Frame generation, not the compatibility layer, is what will make this feel smooth on RDNA3. LSFG-VK is the pragmatic path (run.sh currently sets DISABLE_LSFGVK=1); AMD's FG is still refused in fidelityfx.rs.
  4. Layer-side work that still pays (small, but positive): keeping the pipeline cache warm, VICTORY_LATE_MOST raised, and any further reduction of CPU time in submit() — not because it lifts the frame rate today, but because it is what keeps the CPU off the critical path on faster cards.

If anyone wants to reproduce the numbers

The three counters I added are diagnostics-only (zero cost in a release build) and live where the draws are recorded:

  • crates/victory-gpu/src/draw.rs: note_draw(kind, pipeline, key) called at the top of draw, draw_indexed, dispatch_mesh, dispatch; fusion_key() hashes the state a merge would have to match; pipe_line(frames) prints both lines per report.
  • IOMMU traffic needs no code: sudo perf stat -a -e amd_iommu/mem_trans_total/,amd_iommu/mem_iommu_tlb_pte_mis/ -- sleep 60 while the game is in the world.

Happy to hand over the patch as a PR if it is wanted; it is about 120 lines, all behind #[cfg(feature = "diagnostics")].

**@⁠Aruku448** on GitHub · 2026-12-01 17:57 UTC · [original](https://github.com/lobomfz/VIctory-xmem/issues/85) ## RDNA3 (RX 7800 XT): what the frame time is made of, what I could rule out, and what I expect is left Two weeks on one machine with `37bb30f`, mostly measuring rather than fixing. This is the summary I wish I had had at the start: which directions are worth anyone's time on this title, which are not, and how I convinced myself. Everything below is measured on this machine unless it says *prediction*. ### Environment and operations - RX 7800 XT (NAVI32, gfx1101, 16 GB, BAR0 16 GB), Ryzen 7 5700X3D, 32 GB, Arch (kernel 7.3.6-cachyos), KDE Wayland - wine-staging 11.22-1.1, `patches/wine.patch` wineserver built from the `wine-11.22` tag (protocol 979, which is what the distro client speaks) - Mesa 26.3.1 + `patches/mesa.patch`, vkd3d-proton `71cae09` + patches, DXC v1.9.2609, as pinned by `setup.sh` - Series X profile, default output (`VICTORY_OUTPUT` unset → 2560×1440) with the title's own 2/3 render scale → 1707×960 internal, ray tracing off - All 94 215 pipelines warmed (`./run.sh warm`, 195 s, cache 3.1 → 9.0 GiB); `native pipeline missed at first use` 1 724 → 0 ### Measurements **Frame split** (936 reported frames, one session): median 35 ms. `T = 18.2 ms + 8.16 ms/Mpx` fits two points exactly — default 2/3 render (1.64 Mpx) → 31.6 fps, `VICTORY_RENDER_SCALE=1.0` (3.69 Mpx) → 20.7 fps. So ~58 % of the frame is per-dispatch work and ~42 % is pixels. **Dispatch composition** (diagnostics counters, in the world): ``` graphics 250 dispatches on 71 pipelines (≈4 each) mesh 242–1465 on 79–152 pipelines (≈3–11 each) compute 1726–1767 on 423–447 pipelines (≈4 each) ``` i.e. **the dispatch count is ≈ 4 × (number of distinct pipelines used that frame)**, which against the 94 215 known pipeline states means the workload is shader-variant bound, not object bound. **Mergeability.** Consecutive draws share a pipeline 65–78 % of the time, but the *full* draw state (same vertex/index views, same root parameter addresses, same targets, viewports, blend/stencil) matches **0–1 %** of the time. So `VK_EXT_multi_draw` cannot help: the binds differ per draw even when the pipeline repeats. **Memory is not the bottleneck.** Measured with the IOMMU PMU (`perf stat -a -e amd_iommu/mem_trans_total/,amd_iommu/mem_iommu_tlb_pte_mis/,amd_iommu/mem_iommu_tlb_pte_hit/,amd_iommu/page_tbl_read_tot/ -- sleep 60`) over 60 s at 28.1 fps / 6 461 draws a frame: ``` 904,416,813 mem_trans_total → 529,721 per frame, 82 per draw 754,310,926 pte_hit 150,105,301 pte_mis (16.6 %) 132,499 page_tbl_read_tot → 2,208 page-table reads a second ``` At 128–256 B per transaction that is **1.9–3.9 GB/s against a 27 GB/s PCIe 4.0 x16 ceiling: 7–14 %**. The alias/PTE machinery costs ~2 200 page-table reads a second, i.e. nothing. Whatever the unified-memory design does for correctness, it is not where this title's frames go at this resolution. **The barrier storm is smaller than it looks.** The title issues ~3 400 barriers a frame in 790 group calls (611 of them waiting on draws), but `waits::after()` collapses each group into one `D3D12_GLOBAL_BARRIER` (UAV → UAV, VS/PS/compute → ALL_SHADING) and already drops the groups whose stages are 0. The host sees ~790 global UAV barriers a frame — a 1–2 ms ceiling, not the 18 ms. **One thing that was worth changing.** The lane blocked ~6 ms a frame on `LATE_MOST` (256 host lists in the air). With `VICTORY_LATE_MOST=1024` the wait goes 6.0 → 0.0 ms and `gpu_wait_ms` 7.14 → 0.00, with no descriptor starvation. Frame rate did **not** change — which is itself the useful result: from that point on the frame is GPU-bound, so every CPU-side idea (refreshes batching, the submission lock, bypassing D3D12) buys nothing. ### What I ruled out, and how | Direction | Why I stopped | |---|---| | Prefetch / page grain / residency policy in the unified memory | 7–14 % of PCIe, 2 200 page-table reads/s | | Coalescing the title's barriers | the host already sees synthesised, de-duplicated global barriers; 1–2 ms ceiling | | Multi-draw / draw fusion | full draw state differs on essentially every draw | | Bypassing D3D12 with an own Vulkan backend | saves CPU at 2.3 µs/draw, and the frame is GPU-bound | | `RADV_LAZY_L2_WRITEBACK=0`, `VKD3D_CONFIG=no_upload_hvv` | three interleaved rounds each, all inside a ±12 fps confidence interval — no signal either way at 1440p | ### Predictions (mine, not measured) 1. **Title settings that cut pipeline × view count will move the frame almost 1:1.** Dropping shadow cascades, crowd density or draw distance should reduce the dispatch count proportionally, and the 18.2 ms with it. This is the only "free" lever I did not get to, and it is where I would look first. 2. **The same build on an RX 9070 XT should be ~1.25–1.4× this.** The README's 44 fps at 1080p against our ~39 fps equivalent at the same output fits that, and it is front-end/dispatch throughput, not memory. 3. **Frame generation, not the compatibility layer, is what will make this feel smooth on RDNA3.** LSFG-VK is the pragmatic path (`run.sh` currently sets `DISABLE_LSFGVK=1`); AMD's FG is still refused in `fidelityfx.rs`. 4. **Layer-side work that still pays** (small, but positive): keeping the pipeline cache warm, `VICTORY_LATE_MOST` raised, and any further reduction of CPU time in `submit()` — not because it lifts the frame rate today, but because it is what keeps the CPU off the critical path on faster cards. ### If anyone wants to reproduce the numbers The three counters I added are diagnostics-only (zero cost in a release build) and live where the draws are recorded: - `crates/victory-gpu/src/draw.rs`: `note_draw(kind, pipeline, key)` called at the top of `draw`, `draw_indexed`, `dispatch_mesh`, `dispatch`; `fusion_key()` hashes the state a merge would have to match; `pipe_line(frames)` prints both lines per report. - IOMMU traffic needs no code: `sudo perf stat -a -e amd_iommu/mem_trans_total/,amd_iommu/mem_iommu_tlb_pte_mis/ -- sleep 60` while the game is in the world. Happy to hand over the patch as a PR if it is wanted; it is about 120 lines, all behind `#[cfg(feature = "diagnostics")]`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 17:58:50 +00:00
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/lobomfz--VIctory-xmem#85
No description provided.