D3D12.X: XCL_UMA_UPLOAD_PRIORITY=1 keeps a mixed window's GPU_UPLOAD segment resident (nvidia-dev) #3007
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!3007
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3007"
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?
@Kalmarv on GitHub · 2026-11-27 11:54 UTC · original
Kalmarv:nvd-p4-upload-priority→nvidia-dev· +1075 −16 · 9 files · 7 commits · draftStacked on #3006; only the top commit (
da9c69f7) belongs here. Part of #2688.With
XCL_UMA_DRIVER=mixed:<start_mb>:<size_mb>one range of the coherent window lives in aGPU_UPLOADheap: video memory the CPU writes through the BAR, which every console program reads its buffers from. When the process is over its video memory budget, Windows demotes heaps to system memory, and it can pick that one. Then every read of the window's hot range goes over PCIe. This switch gives theGPU_UPLOADsegmentD3D12_RESIDENCY_PRIORITY_MAXIMUM, so Windows demotes other heaps first. It is opt-in and does nothing withoutmixed.Why
On a 16 GB card in a retail title's world (title: ea3b5e4d, Series X profile; the nvidia-dev port with the mixed window), the process ran about 1.9 GB over its budget. A live ETW timeline of the run (locum
mem timeline) showed exactly one demoted heap of 1,792 MiB, the size of window 3'sGPU_UPLOADsegment (mixed:1536:1792). The same run with this switch, everything else equal (the env differs by this switch only up to the measured frames):The process stays over budget: Windows takes other heaps instead (the 64 MiB pool heaps), which cost far less per frame.
What is in it
crates/xcl/src/hle/d3d12x/uma_driver.rs:upload_priority_wanted(the switch, read once);mapped_segmentcallsID3D12Device1::SetResidencyPriority(MAXIMUM)on aGPU_UPLOADsegment's heap and logs it (or the error).Tested
XCL_DXC_DIR.cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4onda9c69f7(withCARGO_PROFILE_DEV_DEBUG=0: no debug info, for disk space): 1832 passed, 9 failed, 48 ignored. The same command onnvidia-deva5e2d851: 1822 passed, 10 failed, 48 ignored.a5e2d851as well:console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly,hle::d3d12x::texture_upload::tests::gpu_parts_of_a_texture_go_up_and_the_rest_stays,hle::d3d12x::texture_upload::tests::pieces_hold_the_texels_of_their_levels,split_compute_prefers_the_offline_whole_pipeline,two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs.hle::d3d12x::vram::tests::gpu_retire_queue_holds_heap_until_blocked_queue_passes_mark.gpu_retire_queue_holds_heap_until_blocked_queue_passes_markalone, 10 times on2fc61b64(cargo test -p xcl --lib gpu_retire_queue_holds_heap_until_blocked_queue_passes_mark): 10 passed, 0 failed.gpu_retire_queue_holds_heap_until_blocked_queue_passes_markalone, 10 times ona5e2d851(cargo test -p xcl --lib gpu_retire_queue_holds_heap_until_blocked_queue_passes_mark): 10 passed, 0 failed.SKIPPED: 8 no wave64; 1 const_mask, wave64: no wave64; 1 f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's)); 1 f16 arithmetic, wave64: no wave64; 1 f32 arithmetic, wave64: no wave64; 1 f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's)); 1 f16 packed, wave64: no wave64; 1 f32 compares, wave64: no wave64; 1 integer arithmetic, wave64: no wave64; 1 mask_ff0_flbit, wave64: no wave64; 1 f64, wave64: no wave64; 1 f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's)); 1 f32 conversions, wave64: no wave64; 1 integer carries, wave64: no wave64; 1 f32 rounding, wave64: no wave64; 1 f32 transcendentals, wave64: no wave64; 1 f32 three-source, wave64: no wave64; 1 no heap windows (opt-in: XCL_HEAP_WINDOWS=1); 1 no heap windows.Regression run
150 s runs, same title, same env (
XCL_HEAP_WINDOWS=1 XCL_DIRECT_DXIL=all XCL_DIRECT_SPLIT_INSTRUCTIONS=0 XCL_PSO_JOURNAL=0 XCL_DRED=1 XCL_GPU_WAIT_TIMEOUT_MS=120000, DXC 1.9), no switch of this PR set. Themainrun from a hard-link copy of our team branch's DXIL cache; the base and head runs from hard-link copies of one cache warmed onnvidia-deva5e2d851(on this branch the title starts after about 75-90 s of startup shader preparation, so 60 s would end inside it).A commit of
main(b49be183, the last one before the shader preparation screen of #2555):The base,
nvidia-deva5e2d851:This PR's head:
Not tested
GPU_UPLOADsegment in run NS8.mixed), so it shows the default path is unchanged; the switch itself ran only in NS8.GPU_UPLOADheap there may already be placed differently), cards with other budgets, titles other than ea3b5e4d, layouts other thanmixed:1536:1792.mixed: left opt-in.AI use
Claude Code: the change was written with Claude Fable 5; Claude Code (Claude Opus 5.5) ran the suite and the regression runs on the hardware above and wrote this description.
🤖 Generated with Claude Code
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.