GPU memory: separate RAM from VRAM and use the title's own backing where it can be opened #1517
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1517"
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 fxceless/victory-fork. Originally posted by CwWwWwW on 2026-11-28T17:18:56Z.
What this is
This is the GPU-memory project from trustno1-coder/VIctory-NVIDIA#916, ported onto this fork's
main(368967f, the VIctory-NVIDIA959dcaftree plus this fork's work). One commit, 11 files,+3605/-243.
It has two halves:
accounting fixes, the window/texture budget audit and the verification record
(
docs/memory-separation.md,docs/memory-separation-window-budget.md).(
docs/copy-bridges.md), the backing/admission invariants, the page-pool direct-accessprototype, the migration of the copies the policy refuses, the coherence/lifetime wiring, and
the removal plus the record of what remains.
The title is an Xbox Series title whose GPU memory is console unified memory, so a title GPU
address is a CPU address. The layer keeps host mirrors of title memory for the host GPU and copies
between them; this change makes that boundary explicit, removes the copies that are redundant
because the GPU can reach the title's own bytes, and documents every copy that remains and why.
No default changes: every direct-access switch is off, and with them unset the product path is
exactly this fork's base behaviour.
What it does
(so a carded copy is never replaced by a memory-class downgrade):
inplace::place_fallbackisasked exactly where the device-local admission refused the copy, and opens the title's own
memory as a host heap - our own view of one committed section run
(
OpenExistingHeapFromAddress1, one view and one heap per run, shared) or a part of thetitle's private allocation. A placed copy has no staging/mirror, no card side, no hash twin, no
send/fetch state, no refresh, no snapshot and no copy-back; the GPU reads and writes the title's
pages.
VICTORY_INPLACE_VIEW1/2 (page-pool windows, then titlebuffers and view bytes),
VICTORY_INPLACE3+ (the refused-copy substitution for privatememory),
VICTORY_INPLACE_MB4096 (in-place byte cap),VICTORY_INPLACE_PROBE(census).Every refusal is counted with its reason in the placement ledger and falls back to the old copy
path.
HostList::defer_gpu_writepath so late waits order CPU readers behind the flight; the title'sfree/decommit/release,
VirtualProtect(now intercepted unconditionally) andXMemFreeDefault's rawVirtualFreelet placed copies go before the kernel call; thesection view is refcounted and keeps a section's pages alive after the title unmaps its view and
closes the handle;
ID3D12Device13is probed once and a run without it refuses placements asHostUnavailable.copies that exist for layout/format reasons, and the D3D12 infrastructure. The audit records
each one and why.
Port notes (this fork is based on
959dcaf, not #916's63b902f)The patch applied with four conflicts and three small helpers, all resolved without dropping
either side:
host.rs: kept this tree'sfn create() -> windows::core::Result<Host>(the anyhow conversionis newer than this base) and kept the in-place/separation startup notes added by the change;
added the checked device-removal wait helpers (
fence_reached,wait_host_fence,wait_event_for_fence).shadow.rs:card_allocatekeeps this tree's allocation path (there is nocrate::aheadpre-made buffer on this base).
host_made(),Host::shared_buffer_now()(a shared buffer made now) and theWAIT_OBJECT_0import.crate::upload::reserve_earlystartup calland the
crate::ahead::want_card()admission hint.Validation
Local (Windows, Rust 1.98.1 x86_64-pc-windows-gnu, this port's tree):
cargo check --workspace --all-targets --lockedGitHub Actions on this fork (Windows
windows-latest, WARP), from temporaryci/**validationbranches (the workflow file is the only extra file; it is not part of this branch). The fork's
own main was run through the same workflow so the port is compared against its real base:
368967f(baseline)The 3 failures are identical at the fork's base and with this change (same tests, same panic
sites):
indirect::tests::host_list_budget_starts_empty_at_each_submission,indirect::tests::warp_batch_charges_every_executionandpipeline::host::tests::depth_bounds_pipeline_loads_and_filters_draws(the last is the WARPdepth-bounds limitation). The port adds 19 passing tests and introduces no new failure.
The fork's own CI gate is already red at this base. The PR's
checkrun(46169810785) fails in its Clippy step on pre-existing lints in files this change does not touch
(
clippy::precedenceinvictory-formats/src/texture.rs:1346; the same base also failsmanual_is_multiple_ofinvictory-shader/src/emit/water_tile_slots.rs:87and thetransmuteannotations invictory-loader/src/write_sites.rs:349,425, identical on thebaseline tree). The diagnostics build and Tests steps are therefore skipped on the PR, as they are
on the fork's base; the full-test evidence above comes from the temporary workflow run.
What is not claimed (needs real NVIDIA hardware)
WARP and
GetHeapPropertiesprove the creation heap class the API reports, not physicalresidency. Not established here: that
OpenExistingHeapFromAddress1is accepted by the targetNVIDIA driver on private allocations and section views (and what it pins), the openable share of
the real title memory, coherency of GPU access to title system memory under the real relay, PCIe
cost against the copies replaced, WDDM residency/paging, and device-removal/TDR behaviour.
How to proceed after this PR
submission; this fork's PR exists because this fork's base (959dcaf-based) needs its own port
and validation. Keep the two in sync.
behaviour changes with the switches off; the 3 test failures are inherited from this fork's
base.
VICTORY_MEMORY_REPORT=1baseline ledger ->VICTORY_INPLACE_PROBE=1census -> same save withVICTORY_INPLACE_VIEW=2/VICTORY_INPLACE=3-> coherency under the real relay -> PCIe A/B with GPUView/ETW -> titlefree/decommit/protect and a device-removal/TDR run. If a defect shows, keep the switches off
and report it.
registry (no hardware needed); legacy in-place levels 1/2 and the write-combined/second-side
experiments (after the hardware A/B); per-class default enablement (then the mirror branches
for those classes become unreachable); multi-run composition for scattered memory; the
texture/target/depth subset after a layout census. Carded copies stay - replacing them is a
memory-class downgrade.
The full audit, per-phase implementation records, remaining-copy record and the hardware checklist
are in
docs/copy-bridges.md(§10, §11, §16, §17) anddocs/memory-separation.md.Imported from fxceless/victory-fork. Originally posted by Filip722 on 2026-11-28T19:06:49Z.
Tested
791c8582on a physical RTX 5060 Laptop GPU (8 GB) under Bazzite 44.20261011.0, NVIDIA 615.78.08, GE-Proton11-14 and vkd3d-protoncae8353ed7959c4+. The locked MSVC release and seven focused tests passed.I reran the existing placement fixtures with a local test-only change to select the physical adapter and require
ID3D12Device13. The page-pool fixture passed in both directions across two views of an anonymous section, including protection changes and cleanup. The private-placement fixture passed readback and GPU-copy writes at the requested offset.The broader probe passed committed-section reads, writes and remapping with Wine's built-in compiler. Its private-buffer UAV shader step returned
0x80004005. With the same fixture binary and the native SDK compiler 10.0.28000.2705 it passed all three fixtures, including the UAV write. I also verified three green physical fixtures using Wine's built-in compiler with the existing DXC fallback from #1489 applied to this probe.I also tested the page-pool switch on a private integration of this branch and the already validated Proton compatibility fixes. Both replays used the same binary, Series S settings, checkpoint and initial caches. Only
VICTORY_INPLACE_VIEWchanged from 0 to 1, with the private-placement switch unset. The enabled run created 9 direct placements totaling 44 MiB during startup and had zero live placements by the boat checkpoint. The stable control view was 5.70 rendered FPS (170.1 ms median). The enabled run ended at the desktop-response cutoff during the checkpoint retry, before the equivalent rendered sample. Both scopes cleaned up. This confirms that the page-pool placement can be exercised in the title under Proton. A frame-time improvement remains unverified.Assisted by Codex (GPT-6.2-Sol High).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.