GPU: the host says whether its GPU shares memory with the CPU #2912
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2912
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2912"
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?
@0xkn0wh3r3 on GitHub · 2026-11-25 23:51 UTC · original
0xkn0wh3r3:gpu/host-memory-unified→main· +163 −0 · 3 files · 2 commits · closed without mergingProblem
The console's GPU reads title memory where it is. VIctory keeps host copies of title memory in system memory and refreshes them at every submission (
shadow,watch). Nothing on main asks what the host's memory is like:The open placement PRs decide without this:
GPUUploadHeapSupportedalone, so a unified host would still copy.What this adds (no behaviour change)
crate::unified::detect, at host creation:D3D12_FEATURE_DATA_ARCHITECTURE1:UMA,CacheCoherentUMA;D3D12_OPTIONS16.GPUUploadHeapSupported;That costs about 0.3 ms on an RTX 5070 Ti. The result goes on one log line (
host GPU memory: ...) and into the GPU failure text. It is kept on the host (Host::memory) for the placements to gate on.Changed after triage:
Measurements (synthetic; benchmark no longer in the tree)
Detection:
its own, the CPU maps part of it (Resizable BAR); budgets 15227 MiB local, 47508 MiB non-local.unified with the CPU's, cache-coherent false.unified with the CPU's, cache-coherent true.The AMD APU reports
CacheCoherentUMA = false, yet write-back memory was coherent both ways there. So a mode should key onUMA.GPU access, 256 MiB buffers, GB/s (GPU timestamps):
The benchmark's source, as it was, is at cdc50faf: uma_bench.rs.
Tests
unified::tests::warp_is_unified.unified::tests::the_host_device_is_described.cargo test -p victory-gpu --release --lib: two failures,descriptor::host::tests::dynamic_slots_are_held_until_releasedandmemory::tests::lists_share_a_table_and_copies_keep_their_views. They fail the same way on clean main on this machine.Related
@kotekompotek on GitHub · 2026-11-25 23:52 UTC · original · reviewed
Scoped review: detection reports what the GPU did (self_test opens title memory as a heap and checks both-direction visibility) rather than trusting reported feature bits — exactly right for translation layers that claim UMA without external-memory-host. Behaviour-neutral (logged once at creation + crash text), and the captured implications (no protect/unmap while the heap lives, write-watch can't see GPU writes, ~0.2-0.75 ms/MiB open cost) are the constraints any future in-place design has to respect. The uma_bench patterns are synthetic shaders, no game data. LGTM.
@fuzeofficlal on GitHub · 2026-11-25 23:59 UTC · original · reviewed
Verified head
cdc50fafcleanly merged ontoorigin/main(63bcca43) on Windows 11 x64 across three adapters (discrete NVIDIA GeForce RTX 5090, integrated AMD Radeon RDNA2 iGPU, and D3D12 WARP) withVICTORY_D3D12_DEBUG=1.Triple-Adapter
uma_probeResults (--ignored --nocapture, zero debug-layer errors)its own, the CPU maps part of it (Resizable BAR); title memory opens in place; budgets 31419 MiB local, 45969 MiB non-local (asked and tested in 29.48 ms)unified with the CPU's, cache-coherent false; title memory opens in place; budgets 47991 MiB local, 0 MiB non-local (asked and tested in 5.24 ms)unified with the CPU's, cache-coherent true; title memory opens in place; budgets 45969 MiB local, 0 MiB non-local (asked and tested in 1.91 ms)Code & Lifetime Review
D3D12_FEATURE_ARCHITECTURE1(UMA/CacheCoherentUMA),D3D12_FEATURE_D3D12_OPTIONS16(GPUUploadHeapSupported), and theOpenExistingHeapFromAddress1bidirectional visibility self-test are logging/diagnostic-only and preserve all existing paths.self_testdropsopenedandheapbeforeBlock::dropfrees theMEM_WRITE_WATCHallocation.Local Verification (
--features diagnostics,VICTORY_D3D12_DEBUG=1)unified::tests+host::tests+shadow::tests+draw::tests(skipping pre-existing 1M descriptor cap baseline on RTX 5090) 48/48 passed on both adapters.cargo clippy --locked -p victory-gpu --all-targets -- -D warnings(default and--features diagnostics) &cargo xtask policy(193 files ok): clean.Looks clean and ready to merge.
@Marvisak on GitHub · 2026-11-26 02:21 UTC · original · edited 2026-11-26 03:24 UTC
Automated triage for the maintainers.
Verdict: merge candidate. Thanks, this is what the last review asked for. At
cdf12e9,unified::detectmakes twoCheckFeatureSupportqueries (ARCHITECTURE1,OPTIONS16) and the DXGI budget query, and nothing more. The result goes on one log line athost.rscreateand into thefailtext.self_testanduma_bench.rsare gone (the self-test now lives in #2945), and no behaviour depends on the result.Two small nits:
Host::memorystill says "and whether title memory opens in place", which this PR no longer does.unified.rsmodule doc is rationale that belongs in #2945 rather than the code.CI: passing (
check). Merges cleanly.Generated by Claude Code
@0xkn0wh3r3 on GitHub · 2026-11-26 02:30 UTC · original
Thanks. Addressed in
cdf12e9e:self_test: moved to draft #2945, where it decides the in-place default. There it runs once, lazily, and only on hosts that report UMA.uma_bench.rs: removed from the tree. The description summarises its results and links its source atcdc50faf.Tests: on the 5070 Ti, only the two heap-cap failures that also happen on
main. On WARP, which reports unified memory, 268 of 269 pass; the one failure is the flaky frame-timing test.victory-hlepasses 154, and clippy is clean with and withoutdiagnostics.@Dukestar69 on GitHub · 2026-11-26 03:34 UTC · original · approved these changes
Tested merged onto
origin/main(63bcca4) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + WARP):cargo test -p victory-gpu --lib unified::tests: 2 passed, 0 failed (warp_is_unifiedandthe_host_device_is_describedon RTX 5090 + WARP).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 192 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@0xkn0wh3r3 on GitHub · 2026-11-26 08:05 UTC · original
Replaced by #3102, which combines this with the rest of the host-memory placement work in one PR, with measurements on a discrete and an integrated GPU. Closing here.
Pull request closed