RX 7900 XT (RDNA 3) / RADV: a port of VICTORY_WC_NO_BACK takes ~11 ms off a CPU-bound frame (measurements on 88abc53) #19
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 Slaktarn700/SlaktarnVI. Originally posted by GreemSC on 2026-11-29T14:50:45Z.
Thank you for SlaktarnVI. These are measurements on an RDNA 3 card, where the frame is bound by the CPU's memory work like in #18 and #4, and a port of
VICTORY_WC_NO_BACKthat took about 11 ms off the frame here. All numbers are from one machine; please treat them as such.Setup: RX 7900 XT 20 GB (RDNA 3), i7-12700K, 24 GB RAM, Arch-based distro, kernel 7.2, Mesa 26.2.5 RADV, Proton-CachyOS with a view-tree wineserver. SlaktarnVI
88abc53,linux/run-7900.shdefaults plusCONSOLE=series-s, 1920x1080, 30 fps pacing,VICTORY_CARD_BUFFERS_MIN_KB=64, no FSR, no ray tracing. Each run: 200 s from the start of the title, intro skipped withVICTORY_KEYS, then the opening cutscene and the start of the prologue, no input. The figure is the median of thevictory_gpu::hostmeter lines with at least 2,000 draws a frame. Run-to-run noise here is about ±4 ms.Results
VICTORY_FILL_TITLEalternating in-run, no difference)VICTORY_PORT_CONSTANTS=0 VICTORY_REFRESH_DIRTY=1VICTORY_WC_NO_BACK=1VICTORY_WC_NO_BACK=1butVICTORY_PORT_CONSTANTS=1VICTORY_WC_NO_BACK(diag,VICTORY_AB=12,VICTORY_WC_NO_BACK): 67.5 ms on against 78.8 ms off. All 6 pairs of phases go the same way (on/off: 66.5/79.8, 62.6/74.2, 69.2/79.2, 82.5/89.2, 63.3/78.8, 64.2/73.3). The copy back went from about 44 MB / 30 ms to 22 MB / 15 ms a frame.VICTORY_CAPTURE. Frames on either side of each switch compared by SSIM, plus a look by eye: no difference found in exposure, faces or lighting, and no darkening. Only the opening cutscene and the first minutes of the prologue were checked, not driving or daytime outdoors.VICTORY_PORT_CONSTANTS=0confirms #12 on RDNA 3: with it on, the per-submission userptr cost comes back even with fewer copies (82.2 ms against 61.7–63.2).No effect here:
VICTORY_FILL_TITLE(A/B: 81.1 on / 81.5 off)VICTORY_CARD_BUFFERS_MB=4096(the 20 GB card reportsvram_budget_mb=16861, so it lands in the 16 GB bucket)lto = "fat"withcodegen-units = 1VKD3D_CONFIG=force_host_cachedWINE_CPU_TOPOLOGY=pMeasurement note:
VICTORY_CAPTUREplus per-framevictory_gpu::frame=debuglogging cost about 25 ms a frame here, so the speed runs above have neither.The port
This is
VICTORY_WC_NO_BACKandVICTORY_WC_NO_BACK_MIN_KBfrom readmet3xt-lab/foxhound50c15a1and2f81d0c(also in trustno1-coder/VIctory-NVIDIA), by readmet3xt-lab, GPL-3.0-or-later.XMemVirtualAllocnotes the regions the title asks for write-combined (0x400).MIN_KB(default 1024),Shadow::gpu_writesno longer declares the shader write. There is then no snapshot, compare, fetch or merge for it.ab::pickswitch in diag builds.VICTORY_WC_BARis not ported.Risks are listed in the doc comment of
wc_no_back().Tested:
88abc53and builds there (release and diag,--locked, no warnings).Not tested:
The port was written with Claude (Fable) and reviewed and measured by me with Claude (Opus).
wc-no-back.diff (against
88abc53)Imported from Slaktarn700/SlaktarnVI. Originally posted by GreemSC on 2026-11-29T20:40:48Z.
Follow-up: 60 → 45–48 ms/frame on the RX 7900 XT, by keeping two buffers' memory away from the copy and userptr paths
Same machine as above (RX 7900 XT, i7-12700K, 24 GB, Mesa 26.2.5 RADV, Proton-CachyOS). Two things changed since my first post, both for every number below: kernel 7.3.6 (CachyOS), and the GC 11.0.0 firmware from before AMD's revert (linux-firmware 9a7c283fa003, drm/amd#5711). Same 200 s scenario (opening cutscene, then the start of the prologue), release builds, median of the meter lines with ≥ 2,000 draws. Run-to-run noise with one setting is about ±2 ms (59.8 / 61.7 / 63.2).
Base for this post:
88abc53+VICTORY_WC_NO_BACK(above),VICTORY_PORT_CONSTANTS=0 VICTORY_REFRESH_DIRTY=1: 59.8–61.8 ms.What the diag log showed
One 20 MB buffer (allocation
0x1420000, length0x1412200, a committed resource whose memoryXMemAllocDefaulttakes from the host heap, so it is not write-watched) is rewritten whole by shaders every frame. Each frame it was copied whole twice by refreshes (≈ 41 MB, 4.6 ms), sent up again (20 of 48 MB), compared and fetched back (21 of the 22 MB "copying back"): the card received the bytes it had just written.Results
VICTORY_OWN_WATCH=1(that memory in a write-watched allocation of its own, kept above 4 GiB)VICTORY_WC_COMMITTED=1(shader writes to write-combined committed resources stay on the card), all such allocationsVICTORY_WC_COMMITTED_ONLY=0x1420000(only that buffer)VICTORY_PORT_CONSTANTS=1 VICTORY_PORT_PRIVATE=1 VICTORY_PORT_OWNED=1 VICTORY_PORT_OWNED_ONLY=1alone (port 1's heap is driver-owned memory mapped at the title's addresses, no userptr)VICTORY_PORT_OWNED_VRAM=1(that heap in BAR VRAM instead of cached GTT)With everything on: copies 108 → 64 MB/frame, copy-back 22 → 0.8 MB/frame, the submitting thread's preparing 40 → 31 ms, card ~22 % busy. Picture: captures of the opening cutscene and prologue compared by eye with the base runs (faces, lighting, buildings, title card, credits): no difference found; driving and daytime exteriors not checked.
The code
7 patches on
88abc53(git amapplies them; release and diag build with--locked, no warnings): in the next comment (onegit am-able file)VICTORY_WC_NO_BACK: the port posted above.VICTORY_OWN_WATCH: written here.VICTORY_WC_COMMITTED: written here.7cd552bd64(shreezzz). Without it, the blocks landed at 0x178d0000 / 0x7b700100 and the title hung or crashed.VICTORY_PORT_OWNED: port of cairodavila/SlaktarnVIgtaboxde9be80+16b722e, plus the=2bisection mode of34b39f8. I added_ONLY(no other private memory imported as a host pointer) and_VRAM. The rawmmapgoes through Wine's syscall-user-dispatch selector byte atTEB+0x340, checked only in wine-cachyoscd14106e, and the code gives up unless the byte reads 1.VICTORY_WC_COMMITTED_ONLY: written here.All of it is off by default.
Settings as run:
VICTORY_PORT_CONSTANTS=1 VICTORY_PORT_PRIVATE=1 VICTORY_PORT_OWNED=1 VICTORY_PORT_OWNED_ONLY=1 VICTORY_OWN_WATCH=1 VICTORY_WC_COMMITTED=1 VICTORY_WC_COMMITTED_ONLY=0x1420000 VICTORY_REFRESH_DIRTY=1 VICTORY_WC_NO_BACK=1.Tested: the runs above, all on this one machine. The exact series above (diag build of these 7 patches on
88abc53, all switches on): one run, 51.0 ms in diag (diag runs ~4 ms slower than release here), no crash, both mechanisms reported active in the log.Not tested:
TEB+0x340offset).0x1420000is a size seen in this build of the title; another build may need another value (the diag log linememory for a committed resource in a watched allocation of its ownlists the candidates).Written with Claude (Opus and Fable); measured and checked on my PC.
Imported from Slaktarn700/SlaktarnVI. Originally posted by GreemSC on 2026-11-29T20:40:56Z.
slaktarnvi-7900xt-series.patch (7 patches on
88abc53,git am)Imported from Slaktarn700/SlaktarnVI. Originally posted by Slaktarn700 on 2026-11-29T22:01:06Z.
Thank you for the careful measurements, the in-run A/B and the follow-up with the crash counts, they are very useful. I have kept your series to read against my current tree; several parts of it have moved since
88abc53, and my tree uses the same write notes in other places. I have not run any of it, and I will not merge it as it is: three of the four runs with all allocations crashed, as you say. If an idea holds up here I will test it on its own, off by default, with credit. I have not yet checked whether my frame has the same cost as yours.