GPU memory: which copies are redundant, what the placement ledger measures, and where the GPU can use the title's own bytes #2540
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#2540
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:59 UTC · original
GPU memory: which copies are redundant, what the placement ledger measures, and where the GPU can use the title's own bytes
The work is in #2538 (three commits on
feat/gpu-memory-copy-bridges): the rebased successorof the old #916, re-derived on the current main. This issue is about the problems those commits
solve and the design choices - comments are welcome.
PR: #2538
Problem 1: nobody could tell where the copies went
A title buffer's or window's host copy is either given a device-local side on the card or left in
system memory. That decision was made inside the allocation (
shadow::card_for/window_card_for): a refused copy was not recorded, a single-sided copy was silent, and acopy back into system memory was indistinguishable in the log from one on the card. The DXGI
budget, the card limits, the path's byte cap and the host's readiness all decided it, but nothing
counted the outcome.
Commit 1 splits the decision from the allocation:
card_admission/window_admissionrunexactly the checks
card_for/window_card_forran, before any buffer is allocated, and returnresidency::Fallbackas the reason for a refusal. The placement ledger then counts:GetHeapProperties);The line is printed every 5 s while a fallback copy lives, or when
VICTORY_MEMORY_REPORT=1. Thisis the measurement used to decide whether the direct path is worth anything: run a save with the
switches off, then on, and compare what moved.
Also in commit 1, a defect the audit found: a window's second system-memory side
(
VICTORY_WINDOWS_OWN) was charged to the window device-local budget, so a fallback couldconsume VRAM budget and refuse later windows their card side. A second side is system memory; it is
in the ledger now, and only a device-local side is charged and given back.
Problem 2: copies that are redundant because the GPU can reach the title's bytes
The title's memory is pagefile-backed sections mapped as views, plus private allocations. Part of it
is openable as a host heap: one contiguous run of one section (through our own view of that run) or
a committed part of a private allocation. For a copy that stays in system memory anyway (no
device-local side), giving the GPU the title's own bytes is the same memory class with strictly
fewer copies: no mirror, no refresh, no send, no compare, no copy-back. For a copy with a
device-local side it is not the same class, so the policy must not touch those.
Commit 2 adds that path, behind switches that are off by default:
inplace::openabilityclassifies a range: private committed memory, one run of one section, or arefusal (unmapped/scattered/holes). A refcounted
SectionViewmaps our own view of the run andkeeps the section's pages alive after the title unmaps its view and closes its handle; one view
and one heap are shared per run, up to 512 MiB.
inplace::place_fallbackis asked exactly where admission refused:VICTORY_INPLACE_VIEW=1places page-pool windows,
=2title buffers too,VICTORY_INPLACE=3private memory. A placedcopy makes no staging/mirror, no card side, no hash twin, no send/fetch/compare/copy-back, and
the mirror stays the fallback for every refusal.
defer_gpu_write) so the late waits order a CPUreader behind the flight; the title's
VirtualFree/decommit/release, itsVirtualProtectandXMemFreeDefault's 32-bit path let placed copies go before the kernel call; a mapping changelets go of exactly the copies over the range through an exact registry.
portuses the same sharedSectionView, so there is one owner/lifetime for a section view.Problem 3: the record of what remains
Commit 3 is the write-up: the copy-bridge inventory and classification (title buffers,
windows, view-byte copies, by-address arenas, textures, targets/depth/read-backs, D3D12
infrastructure, the title's own CPU steps, the experiment switches), what this work removed, what
remains and why, what only a real NVIDIA run can establish, and the verification record.
What is deliberately not done
downgrade; only a measured PCIe-vs-VRAM study could justify it, and nothing here does it.
shadow::exact) would need the new exact pool to hold a placed form; they stayon the copy path for now.
census + driver probe), a device-local by-address arena, and overlapping placed resources are
listed as unresolved.
VICTORY_INPLACE=1/2andVICTORY_PORT_CONSTANTSbehaviour is unchanged.Evidence so far
cargo check --workspace --all-targets --lockedPASS after each commit (local and CI).829188e(diagnostics feature:copystat'smband atiminglocal shadowing the function) - inherited, reported in the PR, not caused here.cargo test --workspacein CI on Windows/WARP, compared against a baseline run of plain829188ewith the same workflow: the branch adds ten passing tests to thevictory-gpulib (924against 914) and introduces no failure; the nine failures are identical on the baseline, in files
this work does not touch (three
bcpack::oracle_parity_*in victory-formats, fiveemittestsin victory-shader, and
xtask's asset-policyrepository_passes_policy). The build check withdefault features passes; the all-features build fails identically at
829188e(diagnosticsfeature, untouched here).
or physical residency.
Questions for discussion
should some device-local copies be offered a direct option too (a measurement question)?
VICTORY_MEMORY_REPORTthe right place, or should itbe diagnostics-build only?
views (multi-run), or the layout-equal texture subset?
card_late): should a window that is late be offered thedirect path in the meantime, or is copying it for its first frames the cheaper choice?
@github-actions[bot] on GitHub · 2026-11-29 13:59 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)
github-bot referenced this issue2026-11-30 20:41:23 +00:00