Renderer port 1: on in both halves by default (the 174 MB heap was "Scattered" and stayed a copy in every default run) #3399
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!3399
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3399"
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?
@Revono on GitHub · 2026-11-29 22:47 UTC · original
Revono:fix/renderer-port-on-in-both-halves→main· +62 −14 · 4 files · 1 commits · closed without mergingNo issue filed for this; found while asking why the submitting thread still refreshed the title's 174 MB buffer 17 times a frame.
What it changes
Renderer port 1 has two halves.
victory-gpu'sportopens the title's 32-bit graphics heap as a host heap and uses it in place.victory-hle'sxmem::arrangefirst gives that heap's pages their section's slices in address order, because the title maps its five pieces in another order than their addresses and a heap can only be opened on one stretch of a section.Since
e4860ebc(#1223) the GPU half is on by default except on Ampere cards.xmemwent on reading the switch itself and was on only forVICTORY_PORT_CONSTANTS=1, which no launcher sets. So in a default run on any card but an RTX 30 the pages stayed as the title maps them, the GPU half found the heapnot one native-import-eligible stretch of a section: Scatteredand left it a copy, with one warning and nothing else to show for it.victory_gpu::title_graphics_heap_in_place(): the port's one answer, public.xmem::port_onasks it, and its own parsing of the switch is gone, so the two halves cannot differ.VICTORY_PORT_CONSTANTS=0and=1and the Ampere default behave as the GPU half already had them.inplace::scatter):3 views of 1 sections in 2 runs, the longest 150528 KiB: [0x10e20000+0x1b00000 section 0x13c4@0x9e00000, 0x12920000+0x9300000 section 0x13c4@0x0]. That line is what named the cause.How it was tested
renderer port 1: title memory not in place, a copy as before ... Scatteredand0 regions of the title's graphics memory in place (0 MB). Submitting thread 33.8 ms in its submissions, the card idle 10.9 ms behind it (76 % busy), 45 ms a frame. A diagnostics run of the same build shows the buffercopied from 0x165d0000+0xae00000: 17.4x/frame, 3173.91 MB/frame.VICTORY_PORT_CONSTANTS=1set by hand on the same build, which is the state the default now has):the title's 32-bit graphics pages given their section's slices in address orderfor all five pieces (not_fresh=0),a stretch of the title's graphics memory opened as a host heap through a view of ours ... bytes=193986560,1 regions ... in place (185 MB). Submitting thread 25.7 ms in its submissions, the card idle 2.7 ms (93 % busy), 43 ms a frame. The card is the limit there now, so the frame gains 2 ms on this PC; a PC whose card has room should gain more.cargo testpassed for the crates it touches:cargo test -p victory-gpu --locked --lib port::(4 passed) andinplace::(9 passed).cargo test -p victory-hle --locked --lib xmem: 45 passed, 1 failed, and it is the same one that fails onmainwithout this change when the module's tests run together (a_read_by_range_waits_only_for_a_remapping_that_meets_it; it passes alone).cargo xtask policy --staged:asset policy: 4 files ok.cargo clippy ... -D warningsstops invictory-shaderonmainas it is; without-D warningsthis change adds no warning.Checked for overlap
VICTORY_PORT_HOME) and #3109 (15 lines inport.rsfor the submit steps) touch the port without changing which half is on; #3396 is the other port (VICTORY_PORT_CBV). No open pull request namesVICTORY_PORT_CONSTANTSorarrange.@Revono on GitHub · 2026-11-29 23:01 UTC · original
Closing this myself: a controlled comparison shows the change would be a loss on this card, and the gain in the description came from one favourable moment, not from a like-for-like run.
Same build, same save, standing still by day, RTX 4070 Ti SUPER 16 GB, Series X, 2560x1440, DLSS performance, frame generation 2x, 25 one-second windows each:
VICTORY_PORT_CONSTANTS=1(port really on)VICTORY_PORT_CONSTANTS=0So with the heap in place the submitting thread saves a few ms and the card loses about 20: the heap is the PC's memory then, and the shaders' reads of it cross the bus (what
docs/unified-memory-audit.md3.3 says of discrete cards).What still stands from the description, and may be worth a look on its own:
xmem's half is off, soarrangenever runs, the heap is foundScatteredand stays a copy. The port does not take by default, whatever the default was meant to be since #1223.xmem's half on, as this did, would turn the port on for every such card.If the two halves should agree, the numbers above argue for agreeing on off for discrete cards with their own memory, or for deciding it from a measurement per host, not for this change. The
inplace::scatterline that says how the views lie could go in separately if it is wanted.Pull request closed