Repository navigation
Conversation
… on NVIDIA The title's GPU code reads and writes the coherent window (4 GiB of host memory) through a heap opened with OpenExistingHeapFromAddress. On an RTX 5070 Ti, GPU loads from such imported pages ran 8-24x and atomics 13-22x slower than from a driver CUSTOM write-back L0 heap in host memory, at the same CPU caching. A whole-frame replay of a captured title frame took 172 ms of GPU time with the window in a CUSTOM L0 heap and 1,427 ms with it imported as XCL does, the hot compute programs 18-39x slower each. At open_uma the window's written pages are copied out, the window is released, every other free stretch of 1 GiB or more is reserved for a moment so that the driver's CPU mapping of a new CUSTOM L0 heap can only land in the hole the window left, and the pages are copied back. The title keeps its pointers. If the mapping lands anywhere else, or a step fails, the window is made again at its address with its pages and imported as before; if the snapshot of its written pages fails, the window is not released at all (found in review by thehollowedone, with the test failed_write_watch_does_not_release_the_original_window). Buffers placed in it drop ALLOW_CROSS_ADAPTER. The heap is made with D3D12_HEAP_FLAG_ALLOW_WRITE_WATCH, and GetWriteWatch reads the mapped window on an RTX 5070 Ti (driver 610.74), so the window stays in the write-watched regions and the title's CPU writes reach its textures as with the import; a driver that refuses the flag, or whose mapping GetWriteWatch cannot read, keeps the import. On by default for an NVIDIA adapter outside Wine; XCL_UMA_DRIVER=0 turns it off, XCL_UMA_DRIVER=1 (or custom) turns it on elsewhere. Ported to nvidia-dev (joeypercia): the driver heap is tried in open_uma's per-window loop before nvidia-dev's import / video-memory shadow, and not with XCL_UMA_SHADOW=1; a shadowed or driver-heap window gets no ALLOW_CROSS_ADAPTER.
Kalmarv
marked this pull request as ready for review
November 27, 2026 15:13
This was referenced Nov 27, 2026
Contributor
|
Independent desktop NVIDIA verification of PR #3003 at head Environment
Targeted tests & build (
|
| Command | Result |
|---|---|
cargo test --release -p xcl --lib -- --nocapture hle::d3d12x::uma_driver:: (3 consecutive runs) |
2 passed; 0 failed; 0 ignored; 1727 filtered out × 3 (0.20s, 0.19s, 0.19s, 0 skipped; live RTX 4060 D3D12 device exercised failed_write_watch_does_not_release_the_original_window) |
cargo test --release -p xcl --lib -- --nocapture gpu::uma:: hle::d3d12x::real::readback_routing_tests:: (3 consecutive runs) |
23 passed; 0 failed; 0 ignored; 1706 filtered out × 3 (0.20s, 0.21s, 0.21s, 0 skipped) |
cargo build --release -p xcl |
Clean build (2m 01s, exit 0, 0 new warnings in uma_driver.rs, uma.rs, or PR-touched lines of real.rs) |
Paired quiet 60 s retail smoke (title: 29640639, XCL_PREPARE=0, XCL_NETWORK=0)
Exact parent & merge-base (a5e2d851a503fc0e04609f773ea53f2d2c4e3269, nvidia-dev ancestor):
xcl-smoke v1
commit: a5e2d851a503fc0e04609f773ea53f2d2c4e3269
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1513 (PresentX 1513)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14868 MB
PR #3003 (8d36887d0545c1d2927302287a80e072e785d087, default on NVIDIA — XCL_UMA_DRIVER unset):
xcl-smoke v1
commit: 8d36887d0545c1d2927302287a80e072e785d087
gpu: NVIDIA GeForce RTX 4060
title: 29640639
seconds: 60
exit: 0x0
frames shown: 1572 (PresentX 1572)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14777 MB
Runtime telemetry observed in xcl.log on RTX 4060 (621.14)
- Driver CUSTOM L0 heap remapping succeeded on RTX 4060 (Ada, driver
621.14) without fallback:D3D12.X: the coherent window at 0x700000000 (4095 MB) is a driver CUSTOM write-back L0 heap mapped at its address, write-watched (132 reservations, 0 pages kept, 0 KB, 371 ms)0stays importedfallback warnings;UMA import check: ok, 1 window(s), 26516 µs;console buffers in UMA: Map = console address (0x7d2b10000).
- Memory readings at ~58 s steady state (last
memory:log line):- Base
a5e2d851:14823 MBcommitted (peak commit: 14868 MB),6115 MB local,4781 MB non-local(budget6899 MB). - PR
#3003(8d36887d):14712 MBcommitted (peak commit: 14777 MB),6116 MB local,4704 MB non-local(budget6901 MB).
- Base
Limits of coverage
- Both
hle::d3d12x::uma_driver::tests (driver_windows_by_default_on_nvidia_outside_wineand live-D3D12failed_write_watch_does_not_release_the_original_window) andgpu::uma::+readback_routing_tests::(23/23,0skipped) passed3/3, and the 60 s retail smoke confirmed liveuma_driver::remake+GetWriteWatchoperation on RTX 4060 (621.14, Windows 1126200) with0device removals,0crashes, and steady 60 Hz pacing. - Both smokes were run with
XCL_PREPARE=0andXCL_NETWORK=0on a single 60 s startup window (capped at 60 Hz vsync), so GPU-bound frame-time gains beyond startup and explicitXCL_UMA_DRIVER=0/XCL_UMA_SHADOW=1interaction runs were not separately measured.
AI disclosure: test execution and report drafting assisted by Google Antigravity (Gemini 4 Neon).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port of #2844 (merged on
main) tonvidia-dev; the commit is #2844's change cherry-picked ontonvidia-deva5e2d851without conflicts. Part of #2688.On NVIDIA the title's GPU code reads and writes the coherent UMA window through a heap opened with
OpenExistingHeapFromAddress, and the GPU's loads and atomics on those imported pages are an order of magnitude slower than on a driver heap in the same host memory. The window becomes a driverCUSTOMwrite-back L0 heap mapped at its own address, so the title keeps its pointers. The measurements and the review are on #2844 (main: 0.62 -> 3.03 fps in the world on an RTX 5070 Ti, a replayed world frame 1,427 ms -> 165 ms of GPU time). Everything our team measured onnvidia-devsince (the first world picture on this branch, and every run after it) was on top of this change.What is in it
hle/d3d12x/uma_driver.rs(new), withmod.rs,real.rs,host.rs,gpu/uma.rs: as in D3D12.X: UMA windows in a driver heap on NVIDIA, 4.9x FPS (0.62 -> 3.03) #2844. On by default for an NVIDIA adapter outside Wine;XCL_UMA_DRIVER=0turns it off. Unit testsdriver_windows_by_default_on_nvidia_outside_wine,failed_write_watch_does_not_release_the_original_window,failed_restore_stops_before_importing_an_unbacked_window.Tested
XCL_DXC_DIR.cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4on 8d36887: 1825 passed, 9 failed, 48 ignored. The same command onnvidia-deva5e2d851: 1822 passed, 10 failed, 48 ignored.a5e2d851as well:async_compute_pso_registers_real_pso_and_not_standin,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::sparse::tests::a_tile_decommitted_and_committed_again_keeps_its_video_memory.a_tile_decommitted_and_committed_again_keeps_its_video_memoryalone, 10 times on8d36887d(cargo test -p xcl --lib a_tile_decommitted_and_committed_again_keeps_its_video_memory): 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 gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #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 gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's)); 1 f16 packed, wave64: no wave64; 1 f32 compares, 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 gpu: direct RDNA2 -> DXIL backend (no HLSL / DXC), behind XCL_DIRECT_DXIL #1426 semantics differ from the console's)); 1 f32 conversions, wave64: no wave64; 1 integer arithmetic, wave64: no wave64; 1 f32 rounding, wave64: no wave64; 1 integer carries, 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.Build and test (Windows, no GPU)is red onnvidia-devitself and on every PR into it, this one included: the lib test process ends with0x887a0020in a sparse test on the runner's software adapter, with no test reported failed. Tests: sparse tests take CI's Basic Render Driver for a software device #2837 fixes that test; nothing here touches it.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
nvidia-devwith and without this commit alone: ournvidia-devruns all had it.AI use
🤖 Generated with Claude Code