Repository navigation
Conversation
After 3292b09 placed physical page homes in windows 1+ first via `Uma::sparse_alloc_above`, the start of window 1 holds 664+ MiB of homes on Series S sparse-heap layouts, leaving under 3.35 GiB in window 1 while window 2 has a full 4 GiB free. Because `Uma::sparse_reserve` always passed `single_window = false`, a title reservation of at most one window (for example ~3.4 GiB) straddled the window 1 / window 2 boundary (0x12_0000_0000) instead of landing wholly in window 2. Round `size` with checked arithmetic (`checked_next_multiple_of(GRAIN)?`), try `take_sparse_in(..., above_0, end, size, GRAIN, true)` first when `size <= WINDOW`, and fall back to cross-window placement in windows 1+ and then `lo..end` so window 0 stays uncluttered for 32-bit descriptor heaps and fragmented or multi-window reservations keep working. Related to xcl-dev#2867. Assisted-by: Google Antigravity (Gemini 4 Neon)
|
@Decodere thanks for the fix. I ran it on the 12 GB card from #2867, where Tree: #2867's (
So with #2886 the crash in the title still comes, and the other run faults on the GPU instead, at the same stage of the world load. The one run with AI use: Claude Code (Claude Opus 5.5) ran the runs on the hardware above, read the logs and wrote this. |
|
Thank you @joeypercia for testing #2886 on the 12 GB #2867 setup — really helpful data. Understood and agreed: #2886 alone does not stop the #2867 crashes, especially with @grahamster2's hardware measurement on #2867 showing Window 2 left only 3,911 MB contiguous vs the title's 3,977 MB Keeping #2886 scoped strictly to |
…m, pure std) Upstream single-commit 7575f67 on 8b957be: 1 file shaders.rs +38/-2. Helper + 2 direct_sweep call-site swaps + regression test, hunk bodies identical (only line offset from linux-only helpers). xcl-dev#2909/xcl-dev#2910 SKIP (hle/d3d12x/real.rs, Windows-only); xcl-dev#2906 SKIP (dev-stack tip, same shape as xcl-dev#2886); xcl-dev#2889 re-pinned f334cc9 (force-push, still SKIP).
|
Tested PR #2886 ( Environment
Unit test
Paired
|
| Run | Exit | Crashes / Removals | Frames (PresentX) |
Heavy world start | Peak Commit | Peak Local VRAM | Peak Non-Local | Target Pages |
|---|---|---|---|---|---|---|---|---|
Base eae01502 |
0x0 |
0 / 0 |
1764 |
109.31 s |
25679 MB |
8285 MB |
4288 MB |
3647 MB |
#2886 (237b7181) |
0x0 |
0 / 0 |
1845 |
116.05 s |
26075 MB |
8528 MB |
4246 MB |
3752 MB |
Both runs entered the open world cleanly with 0 crashes and 0 device removals.
Targets
nvidia-dev(eae01502). Related to #2867.After
3292b096moved physical page homes out of window 0 into windows 1+ viaUma::sparse_alloc_above, Series S sparse-heap layouts place 664+ MiB of physical homes at the start of window 1 (0x11_0000_0000), leaving under 3.35 GiB in window 1 while window 2 (0x12_0000_0000) has a full 4 GiB free. BecauseUma::sparse_reservealways passedsingle_window = false, a title reservation of at most one window (for example ~3.4 GiB) straddled the window 1 / window 2 boundary (0x12_0000_0000) instead of landing wholly inside window 2. Multiple sparse-window paths (title_buffer_window,uma_window_buffer, andview_bytes) reject or truncate ranges that cross a 4 GiB window boundary.What is in it
crates/xcl/src/gpu/uma.rs(Uma::sparse_reserve):sizewith checked arithmetic (size.max(1).checked_next_multiple_of(GRAIN)?), matchingsparse_allocandsparse_alloc_above.size <= WINDOW, first attempttake_sparse_in(&mut g, above_0, end, size, GRAIN, true)so single-window title reservations stay inside one window in windows 1+ whenever one has room (placing a ~3.4 GiB Series S arena wholly in window 2 after 664+ MiB of window 1 physical homes).take_sparse_in(&mut g, above_0, end, size, GRAIN, false)and thentake_sparse_in(&mut g, lo, end, size, GRAIN, false)so window 0 stays uncluttered for 32-bit descriptor heaps and fragmented or multi-window (> WINDOW) reservations keep working unchanged.crates/xcl/src/gpu/uma.rs(gpu::uma::tests::sparse_reserve_keeps_single_window_reservations_inside_one_window):3292b096Series S startup layout (2892 MiB GPU heaps + 38 MiB view heap in window 0, 664 MiB physical homes in window 1) and asserts a 3500 MiBsparse_reservelands wholly in window 2 (b + 2 * WINDOW) instead of straddling0x12_0000_0000, smaller 256 MiB reservations reuse window 1's remaining tail, fragmented windows 1+ (2 GiB + 2 GiB across the boundary) still satisfy a 3 GiB reservation via cross-window fallback without touching window 0, andusize::MAXreturnsNone.Tested
rustc 1.100.0(stable-x86_64-pc-windows-msvc), DXC1.9.2609.5, debug and release onorigin/nvidia-dev(eae01502).eae01502sparse_reservewith only the new test added:cargo test -p xcl --lib -- sparse_reserve_keeps_single_window_reservations_inside_one_window --nocapture --test-threads=1: 0 passed, 1 failed (left: 73710698496=0x11_2980_0000straddling0x12_0000_0000,right: 77309411328=0x12_0000_0000).237b7181):cargo clippy --all-targets -- -A clippy::approx_constant: 0 new warnings and 0 errors incrates/xcl/src/gpu/uma.rs(1 pre-existingnvidia-devclippy error remains in untouchedcrates/xcl/src/hle/d3d12x/sparse.rs:6393).cargo test -p xcl --lib -- gpu::uma::tests:: --test-threads=1: 19 passed, 0 failed, 0 ignored (0 skipped);cargo test -p xcl --lib -- physical_homes_leave_window_0_to_the_title --nocapture --test-threads=1: 1 passed, 0 failed, 0 ignored (0 skipped).cargo test --release -p xcl --lib -- gpu::uma::tests:: --test-threads=1: 19 passed, 0 failed, 0 ignored (0 skipped);hle::kernelx::tests::: 59 passed, 0 failed, 1 ignored (0 skipped);hle::d3d12x::console_heap::tests::: 19 passed, 0 failed, 0 ignored (0 skipped).cargo build --release --workspace && cargo test --release --workspace --no-fail-fast -- --test-threads=4: 1819 passed, 5 failed, 48 ignored across 39 top-level test targets (30 expectedSKIPPEDnotices: 21 wave64, 3 per-lane refusals, 3 D3D12 debug layer, 2 opt-in/heap-window skips, 1 Windows driver-cache toggle). All 5 failures are pre-existing onorigin/nvidia-dev(eae01502) and unrelated touma.rs:gpu_compute_thread_limits_leave_the_lanes_past_them_out(Tests: the split compute test's piece limit leaves room for the thread limit test #2854),split_compute_prefers_the_offline_whole_pipeline(Tests: the split compute test's piece limit leaves room for the thread limit test #2854),console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly(Tests: a console MS in the AS slot is refused by its MS translation #2788),async_compute_pso_registers_real_pso_and_not_standin(Tests: wait for late release before checking released pipelines are gone #2770), andtwo_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs.Regression run
Quiet 60 s release runs (
scripts/smoke.ps1 -Seconds 60,XCL_NETWORK=0, default flags, RTX 4060 8 GB, driver 621.14). Includes same-daymainancestor (e120925e) forpr_check.py, freshly measurednvidia-devtarget base (eae01502), and PR head (237b7181):mainancestor (e120925e, same-day baseline forpr_check.py):nvidia-devtarget base (eae01502):PR (
237b7181):Not tested
XCL_DEVICE_TYPE=lockhart+XCL_COHERENT_HEAPS=sparse:1024) world-load crash reproduction from nvidia-dev eae01502: title reads bad addresses 3-4 min in on the Series S profile with sparse GPU heaps; gone with 3292b096 reverted #2867 on 12 GB hardware; this PR fixes the provenUma::sparse_reservewindow 1 / window 2 straddle and does not claim to close nvidia-dev eae01502: title reads bad addresses 3-4 min in on the Series S profile with sparse GPU heaps; gone with 3292b096 reverted #2867 on its own.d3d12SDKLayers.dllnot installed), and Linux / Wine / vkd3d-proton.AI use
Uma::sparse_reserveand3292b096onorigin/nvidia-dev(eae01502), implemented the single-window-first placement and unit test, ran the baseline-fail check, clippy, unit/workspace tests, and paired 60 s retail smokes on the hardware above, and drafted this PR description.