GPU memory: rebasing the closed #916 onto current main, split into three commits (plan for discussion) #2463
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#2463
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?
@CwWwWwW on GitHub · 2026-11-29 13:17 UTC · original
Rebasing the closed #916, split into three commits
PR #916 was closed without merging; the maintainer's comment asked for a rebase on the current
main, ideally in smaller steps, and a new pull request. This issue is the plan and the record for
that rebase, so its shape can be discussed before the new PR.
Work branch on my fork:
https://github.com/CwWwWwW/VIctory-NVIDIA/tree/feat/gpu-memory-rebased
(compare: https://github.com/trustno1-coder/VIctory-NVIDIA/compare/main...CwWwWwW:VIctory-NVIDIA:feat/gpu-memory-rebased)
Approach: re-derive on main, not apply the old diff
mainmoved from63b902f(the base of #916) to829188e: 1,687 commits, +140k/-10k, and thememory code changed a lot through merged forks:
CardCpu,buffer_sides,card_latewindows,the
ARENA_CARD_BYTES/VICTORY_MEMORY_CARD_MBby-address cap,window_card_percent/window_line,card_copy_fits, the checked device-removal fence waits, and inplace/port'snative_stretch/beside/ probe / census. A blind apply of the old 3,500-line diff to maingives 49 conflicting hunks AND would re-introduce fixes main already has (the by-address cap, the
checked waits, the window/arena budget separation, the room-line logging). So the still-new work is
re-implemented on main's current code; the parts of the old audit that main already fixed from
other forks are recorded as such in the docs instead of being re-applied.
The commits (three, in order)
1.
c9887c4bGPU memory: split the copy admission from its allocation and add the placement ledger3 files, +526/-7
shadow::card_admission/window_admission: exactly the checkscard_for/window_card_formake (switch, size limits, host ready, DXGI budget line, the path's cap)before any allocation, so the copy paths can ask "would this copy have a device-local side?"
before a mirror is made. A refused copy is recorded with why.
residency: the placement ledger.HeapClass/class_ofask the API (GetHeapProperties)what heap class a host buffer has;
Fallbacknames why a copy stayed in system memory;fallback_add/fallback_freedcount live and total bytes by reason;placement_lineprintsthem every 5 s while a fallback copy lives (or when
VICTORY_MEMORY_REPORTis set). host.rscounts every buffer the copy and transfer machinery makes.
VICTORY_WINDOWS_OWN) is system memory and is no longer charged tothe window device-local budget; it is in the ledger instead.
host::say_separation_switchesnames the separation switches at startup and warns for thedocumented combinations; tests for the heap classes, the MB line and the counter balance.
2.
3adec350GPU memory: use the title's own backing where it can be opened6 files, +973/-83
inplace: openability (private committed memory, one contiguous run of one section through ourown refcounted
SectionView, or a refusal reason), one shared region per section run,place_view_part, andplace_fallback: page-pool view memory first (VICTORY_INPLACE_VIEW=1windows,
=2title buffers), then private memory (VICTORY_INPLACE=3), only where admissionalready refused a device-local side. The mirror stays the fallback; every refusal is counted
with its reason.
shadow:place_fallbackat exactly those refused points (lookup,loose). A placed copymakes no staging/mirror, no card side, no hash twin, no send/fetch state, no refresh, snapshot,
compare or copy-back. An exact placed-copy registry lets a mapping change let go of exactly the
copies over the range instead of a bounded scan.
gpu_writesdeclares a placed copy's shaderwrites to the copy machinery, so the late waits order a CPU reader behind the flight.
xmem:VirtualProtectis intercepted unconditionally andXMemFreeDefault's rawVirtualFreefor 32-bit allocations lets placed copies go before the kernel call;watchalready calls
inplace::title_memory_freeingbefore the title's own free/decommit/release.port: uses the sharedSectionView(one owner, one lifetime); a section close forgets itsregions.
residency: directly backed copies and refused direct asks are counted in the ledger.invalidation and the counters.
3. docs commit (pending)
The audit documents re-checked against
829188e:docs/memory-separation.md,docs/memory-separation-window-budget.md,docs/copy-bridges.md— the copy inventory andclassification, what main already fixes via other forks, what the ledger now makes visible, the
remaining copies and why, what a real NVIDIA GPU run must establish before any switch becomes a
default, and the verification record (checks, CI runs).
What does not change
829188e(no policy, threshold, budget, launcher default or rendering change).textures/targets/depth, and the D3D12 infrastructure.
placed copies are let go before them.
Validation so far
cargo check --workspace --all-targets --locked: PASS after each commit, no new warnings in thechanged files.
cargo test --workspace --lockedand the all-features build check are running on GitHubActions (Windows, WARP) from a temporary
ci/memory-rebasebranch (test workflow only, not partof the PR): https://github.com/CwWwWwW/VIctory-NVIDIA/actions/runs/46266652500 — results will be
added here when done.
cargo testcannot link on this machine (GNU raw-dylib/dlltool), so the test evidence isthe Windows CI run.
cost or physical residency.
For discussion
ledger separate, or the docs first)?
VICTORY_MEMORY_REPORT, acceptable in the productlog, or would you rather it be diagnostics-build only?
exact()) would need deeper changes in the new exact pool, so they stayon the copy path for now; is that acceptable for a first PR?
VICTORY_INPLACE1/2 behaviour)?The new PR will be opened from the branch above once the docs commit and the CI results are in, so
it can be reviewed commit by commit.
@github-actions[bot] on GitHub · 2026-11-29 13:18 UTC · original
Please attach both logs from the run that went wrong. Without them we can only guess. Paste
%LOCALAPPDATA%into the address bar of File Explorer to get there.%LOCALAPPDATA%\victory\logs\: the newestvictory-nvidia-play-<date>-<time>-<number>.log(fromvictory.exe) orvictory-nvidia-<date>-<time>.log(from the script launcher). The window shows its path at the start, on the lineLog: ....%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log, and, if there is one from that run, the newestvictory-<date>-<time>-<number>.crash.login%LOCALAPPDATA%\VIctory\data\7952987A\temp\.Also say which GPU, Windows version (10 or 11)
@CwWwWwW on GitHub · 2026-11-29 13:22 UTC · original
Closing this: it was opened before the work was finished, and it is about the rebase rather than about the problems the commits solve. A proper write-up of the problems the commits address will follow once the work is complete.