Repository navigation
D3D12.X: reclaim cooling and idle tiles on pool heap OOM - #1663
n-romanovich wants to merge 1 commit into
Conversation
Hardware test report — commit
|
|
Thanks for the review! |
…g, DirectStorage, and stream tracking Cherry-picks upstream stabilization improvements across VRAM allocation, pipeline caching, DirectStorage lifetime, descriptor heap indexing, Media Foundation device bridging, and stream PSO tracking: - D3D12.X: reclaim cooling and idle tiles on pool heap OOM (xcl-dev#1663, addressing xcl-dev#1585 and xcl-dev#1668). When CreateHeap returns 0x8007000E (E_OUTOFMEMORY), Pages::take_tile waits on Pages::fence up to 1000 ms to drain cooling tiles or force-evict idle pages rather than failing immediately. (by Nikita Romanovich) - DirectStorage: close a queue when its last reference is released (xcl-dev#1675). Moves queue_close logic into QueueInner::close and invokes it when the final queue reference is released, preventing background workers from writing to freed caller buffers and marking pending entries complete with E_QUEUE_CLOSED. (by eizispark) - D3D12.X: a pipeline the driver gave up on is not built again (xcl-dev#1665). Persists driver E_OUTOFMEMORY refusal state into used-pipelines.txt (!<key>) so giant compute pipelines that the host driver refuses to compile are skipped on subsequent runs. (by zorde23) - Recompiler: access outside heap windows takes a null view without branching (xcl-dev#1669, xcl-dev#680). Replaces conditional branches in XCL_HEAP_WINDOWS=1 (if (xcl_w >= windows)) with a branchless select pointing out-of-bounds accesses to a dedicated null UAV view (MEM_HEAP_NULL). (by milesah3ad) - HLE: bridge ID3D12Device before direct ResetDevice and cache D3D11 companion (xcl-dev#1677). Fixes MFResetDXGIDeviceManagerX in mfplat.rs to bridge ID3D12Device COM pointers and caches multithreaded companion ID3D11Device instances per adapter LUID. (by eizispark) - D3D12.X: route stream graphics PSOs through create_graphics_pso_tracked (xcl-dev#1661, finding XCL-BT-023 from xcl-dev#1489). Ensures stream-created graphics PSOs receive D3D12_PIPELINE_STATE_FLAG_DYNAMIC_DEPTH_BIAS and are tracked in device_x::note_base for CreateDerivedPipelineStateX and RSSetDepthBiasX. (by fixgep) Assisted-by: Antigravity
|
Test report on an 8 GB NVIDIA card, head Tested
Regression run main: this PR's head: Not tested
AI use: Claude Code (Claude Opus 5.5) built the PR, ran the tests and both smoke runs, read the logs and wrote this report; I checked it before posting. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
40fd9b6 to
c2ae579
Compare
|
Live I saw that this PR's description and two reviewers mark live retail VRAM exhaustion as untested. I have a local repro that reaches it, so here is a paired run on the same copied retail folder. Setup:
Results:
Last memory samples:
What this does and does not show:
AI use: OpenCode with Big Pickle ran the builds and retail-title runs, read the logs, and drafted this report. Please verify before posting. |
XCL PR #1663 verificationClean detached HEAD Windows 11 Enterprise Evaluation x64, build 26200. AMD Ryzen 7 3800X, Intel Arc A770 (16,258 MiB reported by XCL), driver 32.0.101.9175. DXC 1.9.2609.5 (01b62ad47), rustc 1.100.0 (0ef1bc386, x86_64-pc-windows-msvc). Unoptimized Cargo profiles with debug info and incremental compilation disabled. Tested
Workspace failures and skips 18 GPU DXIL/recompiler unit tests failed, including compute PSO creation errors (0x80070057) and shader output mismatches. The synthetic title e2e also failed on dynamic depth bias via Not tested Actual D3D12 pool-heap OOM, the fence-wait and retry under driver OOM, a matched AI use T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against |
# Conflicts: # crates/xcl/src/hle/d3d12x/vram.rs
…terface params in xcl-dev#2028's two-pass test helper Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
xcl-dev#1182 keys owned pages by their physical page, but the count of tiles to take (from the xcl-dev#1985/xcl-dev#1663 batch code) still looked pages up by address: a page already shared through its physical page was counted as missing, and a new one not, so fresh_iter ran dry and the title aborted at vram.rs:789 in the first XCLM run (49 s, menus). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
c2ae579 to
24e5eb3
Compare
|
The current no-GPU CI failure on head 24e5eb3 is a test-only stale API rename, not a failure in the reclaim change. I reproduced it locally at the exact PR head with cargo test --workspace --locked --no-run: two E0599 errors at crates/xcl/src/hle/d3d12x/vram.rs:1872-1873, because TilePool::add_heap was replaced upstream by add_heap_at(slot, pool_pages). A two-line replacement fixes the build and preserves the test setup: pool.add_heap_at(0, 2); Before: cargo test --workspace --locked --no-run failed with E0599 at vram.rs:1872:25 and 1873:25; the compiler suggested add_heap_at. AI use: OpenCode with Big Pickle reproduced the compiler failure, applied the two-line local verification patch, and drafted this comment. Please verify before applying. |
When CreateHeap fails with E_OUTOFMEMORY in Pages::take_tile, wait for Pages::fence and reclaim already-cooling tiles (oldest first) or force-evict the oldest still-idle page before failing. If waiting on the fence fails or times out, do not reclaim potentially in-flight tiles. Assisted-by: Antigravity (Claude Sonnet 5.5)
24e5eb3 to
bdcc0eb
Compare
|
Independent Windows check of bdcc0eb. Windows 11 build 26300, Ryzen 7 9800X3D, RTX 3080 Ti / 621.35, Rust 1.99.1 MSVC and DXC 1.8.2502.11.
Commands: AI-assisted. Codex (GPT-6, exact variant unavailable) wrote the local follow-up and fixture, ran the tests and drafted this report. |
|
Tested on \�dcc0ebe47316ad219212d28435c26a7833f239f\ (\�dcc0eb, clean PR head) and merged onto \origin/main\ \3ceb550:
Review note on \origin/main\ \3ceb550\ compatibility (#2275):
Not tested
AI use
|
|
NVIDIA and AMD full-suite run of head Tested
Not tested
AI use
|
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
Addresses #1585.
When
Pages::bindhitsE_OUTOFMEMORY(0x8007000E) inalloc_pool_heap, it previously failed immediately even when freed tiles were still waiting incooling(up toCOOL = 2s) or unreferenced pages were sitting inidle(up toIDLE = 2s). Now, ontake_batchfailure, ifpool.coolingoridleis non-empty,Pages::bindwaits up to 1,000 ms forPages::fenceand, onOk(()), callsTilePool::reclaim_for_oom(draining cooling tiles and evicting the oldest still-idle pages up tomissingtiles) before retryingtake_batch. Iffence::waitfails or times out, it logs a warning and returnsNonewithout reclaiming potentially in-flight tiles.What is in it
pop_idle_pagefromsweep_idleincrates/xcl/src/hle/d3d12x/vram.rs. - AddedTilePool::reclaim_for_oomand wiredPages::bindto wait onself.fence, reclaim cooling/idle tiles, and retrytake_batchon OOM. - Added unit testreclaim_for_oom_drains_cooling_and_idle_pagescovering cooling drain, staleidleentry skipping, andOwn/Extraidle eviction.Tested
Hardware: Windows 11 x64, NVIDIA GeForce RTX 5060 Ti.
cargo test -p xcl --lib vram::tests -- --test-threads=4:11 passed; 0 failed; 1 ignoredcargo test --workspace -- --test-threads=4:960 passed; 0 failed; 43 ignoredSKIPPED: 21 wave64 / unsupported#1426per-lane GPU tests (no wave64/unsupported V_MUL_F16/V_PK_MUL_F16/V_CVT_F16_F32),shaders::tests::pso_measurement_compiles_an_exact_synthetic_record(Windows Developer Mode is required),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows)Regression run
Main (
5478c4a7c1ae5adba127c8d27018d7fdbf3a8725):PR (
bdcc0ebe47316ad219212d28435c26a7833f239f):Not tested
AI use
smoke.ps1runs.