RDNA3 (RX 7800 XT): what the frame time is made of, what I ruled out, and what I expect is left #85
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lobomfz--VIctory-xmem#85
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?
@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
patches/wine.patchwineserver built from thewine-11.22tag (protocol 979, which is what the distro client speaks)patches/mesa.patch, vkd3d-proton71cae09+ patches, DXC v1.9.2609, as pinned bysetup.shVICTORY_OUTPUTunset → 2560×1440) with the title's own 2/3 render scale → 1707×960 internal, ray tracing off./run.sh warm, 195 s, cache 3.1 → 9.0 GiB);native pipeline missed at first use1 724 → 0Measurements
Frame split (936 reported frames, one session): median 35 ms.
T = 18.2 ms + 8.16 ms/Mpxfits 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):
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_drawcannot 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: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 oneD3D12_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). WithVICTORY_LATE_MOST=1024the wait goes 6.0 → 0.0 ms andgpu_wait_ms7.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
RADV_LAZY_L2_WRITEBACK=0,VKD3D_CONFIG=no_upload_hvvPredictions (mine, not measured)
run.shcurrently setsDISABLE_LSFGVK=1); AMD's FG is still refused infidelityfx.rs.VICTORY_LATE_MOSTraised, and any further reduction of CPU time insubmit()— 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 ofdraw,draw_indexed,dispatch_mesh,dispatch;fusion_key()hashes the state a merge would have to match;pipe_line(frames)prints both lines per report.sudo perf stat -a -e amd_iommu/mem_trans_total/,amd_iommu/mem_iommu_tlb_pte_mis/ -- sleep 60while 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")].