D3D12.X: retire idle NVIDIA command pools between presents #3122
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3122"
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?
Imported from ivall/xcl. Originally posted by Prime1997 on 2026-11-28T11:51:33Z.
Idle split command lists and alternate native command allocators stayed owned after their recordings finished, including while world loading stopped calling PresentX. Reclaim completed spare objects every two seconds, keep a small reuse pool, and return an idle logical allocator to its primary only after Reset succeeds.
NVIDIA adaptation of iggyvilla's AMD #3110. Required binding-cleanup ordering overlaps the problem addressed by #2138 and #2707; their broader orphan/concurrency work is not included. Part of #2688.
What is in it
Tested
2156e42d6e6a69878539b12641a7dfe52556368a.d54d80e1bc9d070cbec4a619abb5f4b89880b2f5compiled withcargo build --locked --release -p xcl --target-dir <isolated-target>: exit 0, 229.200 seconds. This is compilation of the combined candidate, not a build or runtime validation of this standalone PR. Zero tests executed; no GPU checks or smoke run.git diff --check.Regression run
Pending. No main/head smoke comparison has been run for this revision.
Not tested
Four new CPU-only regression fixtures, full suite, NVIDIA/AMD runtime behavior and memory savings. Existing native PSOs and driver heaps are not evicted.
AI use
Codex (GPT-6) adapted the contributor repair, wrote the lifetime safeguards and fixtures, and performed source review.
Optional contributor/test coordination: https://discord.gg/6B4TykyC4W
Imported from ivall/xcl. Originally posted by Prime1997 on 2026-11-28T12:06:42Z.
Failed interactive integration result for
d54d80e1bc9d070cbec4a619abb5f4b89880b2f5, containing this PR's change together with the other memory/removal repairs. This was not a standalone test of2156e42d6e6a69878539b12641a7dfe52556368aand does not establish which change caused or prevented a symptom.0x887a0005(DEVICE_REMOVED); no external stop or automated inputs.0x887a0004(unsupported), so there is no reliable GPU fault location. System commit still had 34,764 MiB headroom at removal; no out-of-memory result was established.The command-pool log reports 3,471 spare lists retired, 38 parked, 25 allocator owners, 35 alternate allocators put aside (9 idle), and zero allocators retired. Object reclamation is observed; a byte saving or full RAM-growth repair is not established.
This run does not justify merge approval or a claim that RAM growth/device removal is fixed. Full standalone validation and matching main/head smoke reports remain outstanding. No builds or synthetic GPU tests ran during gameplay. Logs, hashes, counter samples and source/installed-data preservation checks are retained locally.
AI use: OpenAI Codex (GPT-6) launched the prepared candidate at the user's request, monitored existing logs and read-only counters, and prepared this report; a separate Codex agent reviewed the log evidence.
Optional contributor/test coordination: https://discord.gg/gK3y7WRRY
Imported from ivall/xcl. Originally posted by kole07139 on 2026-11-28T13:12:00Z.
Test report for head
2156e42d. Two existingalloc_pooltests fail on this head and pass on its base.54225f58they pass 3 of 3 alone:hle::d3d12x::alloc_pool::tests::a_recording_outlives_the_reset_of_the_titles_allocator:alloc_pool.rs:1028, "the allocator put aside is free again" (left: 2297796011296, right: 2297796013056).hle::d3d12x::alloc_pool::tests::ended_recordings_keep_their_memory_until_the_gpu_passes_their_allocator:alloc_pool.rs:913,left: (Some(0), [x+1, x]), right: (Some(0), [x+1, x+1]), so the second reset does not get the spare again.idle_reclaim_waits_for_binding_retirement_and_keeps_live_owners,returning_to_primary_keeps_the_alternate_until_reset_succeeds,device_removal_is_not_allocator_completion,only_finished_aged_spares_leave_the_pool.move_listnow keeps the old backing inretiringuntil its binding blocks are retired, andBacking::freerequiresretiringto be empty. Both tests move a list to another allocator and then expect the first one to be free again, without driving that retirement.Tested: NVIDIA GeForce RTX 3070 8 GB (driver 617.42, wave32), Intel i9-9900K, 32 GB RAM, Windows 11 Pro N 26200, rustc 1.99.0, DXC 1.8.2502.11, debug. Each head was tested alone, with its own target directory, on its base
nvidia-dev54225f58. The library tests were run ascargo test -p xcl --lib --no-fail-fast -- --test-threads=4 --skip a_refused_gpu_upload_segment_becomes_custom. That one test is left out because the library test binary stops at its fail-stop (0x7C10003), as throny reported on #3041, with or without this PR; alone it passes. On the base the same command gives 1771 passed, 6 failed, 28 ignored. The 6 failures (placed_title_textures_share_vram_and_preserve_pixels, threestream_recheck_*,d32s8_targets_take_their_own_size_of_video_memory,gpu_retire_queue_holds_heap_until_blocked_queue_passes_mark) are the base's own and are not repeated below.I also merged the four heads #3122–#3125 together on
54225f58(only README.md conflicts, plus the two new tests of #3123 and #3125 at the same place insparse.rs; both kept). On that treecargo test --workspace --no-fail-fast -- --test-threads=4gives: library binary stopped at the same fail-stop; the other test binaries 132 passed, 0 failed, 20 ignored. The library command above: 1779 passed, 9 failed, 28 ignored, that is the base's 6 plus the 3 named below.Not tested: a title run or smoke run of this head, a release build, AMD and Intel GPUs.
AI use: Claude Code (Claude Opus 5.5) ran the merges, builds and tests, and wrote this report.
Imported from ivall/xcl. Originally posted by jeroenhaentjens on 2026-11-28T14:34:33Z.
Standalone Windows game-load test of this PR head
2156e42d6e6a69878539b12641a7dfe52556368aon a Quadro RTX 3000 (5,955 MiB VRAM), 32 GiB RAM, Xbox Series X profile, GTA VI 1.0.2.1. Release binary SHA-2564EAD064B326C46E6EB8489B7112270B5ED3E9C05E29885D9D6F1080A2BA2F604.The title reached PLAYER1, accepted input, played the intro and began the illustrated world-loading screen. With
XCL_ACTIVITY=1, the command-pool log reached 4 spare lists retired, 0 allocators retired (11 parked, 5 alternates put aside). At 161 seconds of host execution, XCL logged 23,044 MB of process commit, 6,944 MB of target pages and 10,948 MB of local video memory against a 5,187 MB DXGI budget. It reported 37,949 textures holding 11,498 MB of pages counted by texture ownership (shared pages can be counted more than once). The external guard closed the test when free physical RAM fell below 3 GiB. The world was not observed.This was an isolated profile with a cold candidate DXIL cache,
XCL_PREPARE_GRAPHICS=0, 16 GiB Windows page file, 1080p/60 requested, 16,667 µs host frame interval and network disabled. A synthetic nonmatching pipeline key was used in this test cache to bypass the optional startup precompile, so the runtime had to compile pipelines on demand. These conditions differ from the prior warm-cache combined-PR run, and this is not a matched main/head speed comparison. It establishes that the standalone head executes the retirement path but does not get this machine through world loading within its RAM guard. No merge approval is implied.OpenAI Codex built the standalone head, ran the title, recorded process memory and checked the activity log.
Imported from ivall/xcl. Originally posted by KDenKC on 2026-11-28T15:05:44Z.
@Prime1997 a whole-suite run of your head on an RTX 3090 against its base on the same machine: two existing
alloc_pooltests fail on the head and pass on the base.Tested:
2156e42dand its basenvidia-dev54225f58.XCL_*set.cargo test --workspace --no-fail-fast -- --test-threads=4 --skip uma_driver::tests::a_refused_gpu_upload_segment_becomes_custom --skip uma_driver::tests::mixed_window_keeps_its_bytes_and_the_gpu_sees_every_segment --skip uma_driver::tests::failed_restore_stops_before_importing_an_unbacked_window(the three end the lib test binary on 621.24, at the base too): base 1,900 passed, 7 failed, 48 ignored; head 1,902 passed, 9 failed, 48 ignored.alloc_pool::tests::a_recording_outlives_the_reset_of_the_titles_allocator:alloc_pool.rs:1028, "the allocator put aside is free again";alloc_pool::tests::ended_recordings_keep_their_memory_until_the_gpu_passes_their_allocator:alloc_pool.rs:913,assertion left == right(left(Some(0), [..])).cargo test -p xcl --lib -- alloc_pool::tests --nocapture --test-threads=1: 10 passed, 2 failed), and pass on the base in the full run. So not a full-run effect.title_textures(one0x8007000Ein the full run andPoisonErrorfrom it), 2vram0x8007000E,e2etest_title_runs_and_game_folder_is_untouched.Not tested: a title run; a release build; AMD / Intel.
AI use: an agent swarm: Claude Fable 5.2, Claude Opus 5.5, GPT-6.2-Sol and Gemini 4 Neon.
Imported from ivall/xcl. Originally posted by Aniseto on 2026-11-28T15:20:25Z.
Ran the
alloc_poolgroup at2156e42don an NVIDIA Blackwell desktop part:Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), MSVC 14.44.35207, DXC 1.9.2609.5, debug build.
The two failures are the same ones reported in the thread on RTX 3070 and RTX 3090, reproduced here on a third NVIDIA card:
hle::d3d12x::alloc_pool::tests::a_recording_outlives_the_reset_of_the_titles_allocatorhle::d3d12x::alloc_pool::tests::ended_recordings_keep_their_memory_until_the_gpu_passes_their_allocatorI am reporting the measured outputs, not attributing the cause. The four new tests in this group pass. I did not run a title, a paired smoke run or the full workspace suite.
Not tested: a retail title, a paired smoke run, the full workspace suite, AMD and Intel GPUs, native wave64 hosts, Wine, release profile, game data.
AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
Imported from ivall/xcl. Originally posted by andrewDoing on 2026-11-28T16:04:17Z.
I checked the proposed explanation for the native
a_recording_outlives_the_reset_of_the_titles_allocatorfailure on RTX 5070 / NVIDIA 616.92 at2156e42d6e6a69878539b12641a7dfe52556368a. The primary allocator was reusable after the same GPU work when the fixture ran the binding retirement step used by the normal list reset.alloc_pool::reset_listdirectlybind::reset(list, alternate, 0)after successful list resetBoth fresh processes executed the three native queue submissions and reported a healthy device. The test observed the old backing's retiring marker before the binding reset in both cases. There was no presentation and no wait for a background sweep. Two focused controls passed, zero skips.
This points to a specific fixture change: exercise the successful list-reset lifecycle (or pair the direct helper call with its binding reset) before asserting reuse.
list_x::reset_pc_inneralready callsbind::resetafter a successful native reset. The fixture used a real command list and allocator with empty binding payloads. It did not run the title wrapper, the background trim thread, a retail title, or the other failing testended_recordings_keep_their_memory_until_the_gpu_passes_their_allocator.AI use: OpenAI Codex (GPT-6) prepared and ran the test-only controls and wrote this report.
Imported from ivall/xcl. Originally posted by Prime1997 on 2026-11-28T22:29:48Z.
Closing as superseded on
main. This was written againstnvidia-dev. After the move tomain(#3203) its allocator half no longer applies:mainalready retires spare recordings and reclaims idle command allocators in its own design (31930d855,8e7b566ae), andalloc_pool.rsthere has been rewritten since, so this branch conflicts across six files.The one part
maindoes not have is releasing idle spare command lists before their wrapper goes. That is left for a separate small PR againstmainwith a played run behind it; #2138, #2707 and #3110 work in the same area.Checked and closed with Claude Code on Prime's behalf.
Pull request closed