Linux/RADV: VICTORY_PORT_CONSTANTS=1 in run-7900.sh costs ~15% (kernel re-checks the in-place region on every submission); other RDNA 2 findings #12
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 lyricalfrog3 on 2026-11-28T19:27:06Z.
Setup: RX 6700 XT (RDNA 2, 12 GB, ReBAR on), i5-14600KF, Debian, kernel 7.3.4, Mesa 26.1.6 RADV, GE-Proton11-14. SlaktarnVI
e5b0dc8, launched throughlinux/run-7900.sh, Series S profile, 720p withVICTORY_UPSCALER=6, 30 fps cap, shaders preloaded. All numbers are the median of thevictory_gpu::hostframe line in the prison scene.1. Renderer port 1 makes every submission expensive on Linux
run-7900.shforcesVICTORY_PORT_CONSTANTS=1, which opens one 174 MB region of title memory in place (OpenExistingHeapFromAddress). On RADV that becomes an amdgpu userptr object. Because vkd3d-proton uses buffer device addresses, RADV attaches every allocation to every submission, and amdgpu re-validates userptr objects through HMM (hmm_range_fault) in eachamdgpu_cs_ioctl. That is about 44,000 pages walked per submission, including theVICTORY_CARD_AWAKEjob's ~500 submissions a second.perfover 20 s of gameplay (diag build): the vkd3d queue threads use about one full core, ~95% of it in the kernel. The biggest parts arehmm_range_need_fault+hmm_vma_walk_pmd(~40% of those threads),amdgpu_cs_ioctlitself andclear_highpages.VICTORY_PORT_CONSTANTS=0VICTORY_PORT_CONSTANTS=0Copies stayed about the same with port 1 off (87 → 83 MB/frame), and no visual problems were seen in a short session. Suggestion: default port 1 (and any in-place host import) to off on Linux/RADV, or make the script's value overridable (
${VICTORY_PORT_CONSTANTS:-1}). Windows drivers may not pay this per-submission cost.VICTORY_CARD_AWAKE=0was slightly worse (wall ~14 fps vs ~16), so the awake job is worth keeping.2. Release build stability depends on it
With port 1 on, the release build crashed in title code about 40 s in (0xc0000005, read 0x0). The diag build with the awake job off crashed the same way once while loading (read 0x38), then ran fine on the next try. With port 1 off, the release build ran without crashing. It looks like a timing race during loading, not proven.
3.
VICTORY_FILL_TITLE=1is a clear win hereSkipping the wait for small fills of title-written memory: 175 → 129–131 ms in the same scene, no visible glitches. Worth considering as a default.
4. Card buffer cap on 12 GB cards
shadow.rsdefault_card_limits_mbcaps 12 GB cards at 512 MB. WithVICTORY_CARD_BUFFERS_MB=1536the card held 801 MB of copies (591 MB before) and snapshot time went from 11.4 to 0 ms. The 12 GB boundary may be too strict.5. Wineserver view-tree patch on GE-Proton
linux/wineserver-view-tree.patchapplied to GE-Proton11-14 crashed the title (access violation reading 0x5c), because GE adds views without an overlap check, so views sharing a base or overlapping were lost from the tree. Counting such views per process and falling back to the original list scans while any exist made it stable: 381 → 109 ms at 1080p. I can share the modified patch.Not helpful here
VICTORY_THIN_THREADS=14: per-call time 19 → 35 µs, frames slower.VICTORY_INPLACE=2: 520 ms (guards thrash).71cae091): 145 ms vs 117 ms, dropped draws unchanged.What limits it next (from the profile)
The list translation threads are only ~43% busy each, so they mostly wait. Their own top costs are the
BTreeMaprange iteration in the shadow lookup (btree::map::...::nextover(u64,u64) -> (Arc<Shadow>, u64)),descriptor::view_atanddraw::State::bind.Imported from Slaktarn700/SlaktarnVI. Originally posted by Slaktarn700 on 2026-11-29T11:17:41Z.
Thank you, the profile is very useful.
VICTORY_PORT_CONSTANTSis now overridable in my working copy. On my RX 9070 XT, one pair of runs gave 47.9 ms off against 50.4 on, which is too close to call, and one run with it off hung, so I keep it on.VICTORY_FILL_TITLE=1I have not tried yet. I would like to see the modified wineserver patch if you can share it as text.Imported from Slaktarn700/SlaktarnVI. Originally posted by lyricalfrog3 on 2026-11-29T12:00:33Z.
Here's the patch, against GE-Proton11-14 with GE's own patches applied. It only touches
server/mapping.c,process.c,process.handfile.h.The one functional change from your version is about views that share a base address or overlap the view below them. In the original,
rb_putfailing on a duplicate base just leaves the view out of the tree, sofind_mapped_view/find_mapped_addrcan miss it. I count those views per process (odd_views), and while any exist, lookups and the free-range check use the old linear list, which still has every view. When they're unmapped, lookups go back to the tree. The first 20 times a view goes on the list path, a line is printed to stderr (wineserver: view ... shares a base or overlaps another), if you want to check how often it happens on your side.Results on RX 6700 XT / 32 GB: 2.6 → 8–9 fps in the same scene, and wineserver went from about 70% of a core to a minor part of the profile.
Thanks for making
VICTORY_PORT_CONSTANTSoverridable. 47.9 vs 50.4 ms does look like noise, and I'll keep it on too. I'll tryVICTORY_FILL_TITLE=1and report back.wineserver-view-tree-on-ge.patch
Imported from Slaktarn700/SlaktarnVI. Originally posted by Slaktarn700 on 2026-11-29T22:01:04Z.
Thank you, I read the whole patch and found nothing unsafe. One case: wide view A, then B inside it, then C inside A above B: C is not counted, so after B is unmapped the tree can miss A. Deciding overlap by the list while odd_views is above 0 would fix that. In the Proton Experimental I use, the callers check for overlap first, so I do not expect it there. Do you see the stderr line in your runs, and do you know which call in GE adds the overlapping view?
Imported from Slaktarn700/SlaktarnVI. Originally posted by Slaktarn700 on 2026-12-01T02:18:07Z.
You were right about the cost: in 12 alternating starts each wait for card memory took 0.3 to 2.8 ms with port 1 on and 0.11 to 0.15 ms with it off. In play on this PC it is still the other way round (21 to 22 fps on, 18 off), so it stays on by default and overridable. The zero-page reads are fixed by the ntdll patch the new Set up Proton builds.