Repository navigation
Conversation
…for waiting title threads GTA VI (retail, GDK) creates ~51 000 distinct pipelines in its first 30 s. Each one built at creation stays in AMD's driver heap (~400 KB): commit went past 45 GB and the system ran out. Pipelines with console shaders now get their stand-in at creation and are built the first time they are bound (pso_async::submit_lazy, sent to the workers on the first `resolve`; compute is waited for as before). XCL_LAZY_PSO=0 builds them all at creation as before. A title thread with no stand-in waits in its own call for the translation: its DXC compiles now run at once on a thread of their own (dxc::urgent) instead of queueing behind thousands of background jobs held by the memory gate. GTA VI's watchdog killed the game when one of its threads stayed silent ~30 s. resolve_wait builds a pipeline nobody sent yet on the spot. Stand-ins also get the PC topology type (pc_topology_type): the console's rect list / none were refused (0x80070057) and the title waited in the call instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XTYmP6vKUQKatSiA2PC95B
|
Update 18:16 UTC: I had a smaller change for the same wait ready (a waited-for pipeline moves ahead of the queue) and found this PR in my last duplicate check, so I did not open mine. I tested this one instead. Machine: Ryzen 5 1600 (6C/12T), 16 GB RAM, ~13.5 GB commit free, GTX 1650 4 GB (driver 32.0.16.2124, 32-lane waves), Windows 11 26300, DXC from SDK 10.0.26100. No retail title was run here. PR head Tests: Synthetic bench: 200 pipelines, each one DXC compile of a different CS, no cache, no driver PSO, 11 DXC threads. 3 runs each.
The
My version's tests (queue order, waiting twice, a blocked worker) are yours if useful; I can send them as a patch. |
|
Tested The null-write crash is unchanged — Differences with lazy-pso:
Two conclusions this rules in/out:
Happy to re-run any candidate fix (AS/MS numbering, or #163) on this title and report register-level diffs — fast turnaround on our side. |
…urgent compiles for waiting title threads Conflict in pso_async.rs: ivall#162's version kept - it already holds upstream's build-in-the-bind behaviour (resolve_wait takes the job) and adds the lazy queue.
…urgent compiles for waiting title threads Conflict in pso_async.rs: ivall#162's version kept - it already holds upstream's build-in-the-bind behaviour (resolve_wait takes the job) and adds the lazy queue.
# Conflicts: # crates/xcl/src/hle/d3d12x/pso_async.rs
With GTA VI's compute pipelines built at their first dispatch the device was removed ~20 s in (an invalid call, nothing from the debug layer before it); with graphics ones only it runs at 30 fps. Compute pipelines are far fewer and their first bind waits for them anyway. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XTYmP6vKUQKatSiA2PC95B
|
Update after 956a476 ("Retail game reaches 30 fps"):
Converting to draft: as it stands, this does not earn its complexity on current 🤖 Generated with Claude Code |
|
Found the cause of the device removal I attributed to deferring compute pipelines: invalid UAV descriptors on depth buffers whose UAV flag #163 drops, used by a dispatch. #163 now writes a null view for them. With that, deferring compute pipelines too works ( 🤖 Generated with Claude Code |
|
Setup: AMD Radeon RX 7800 XT (RDNA3, 16 GB), driver 32.0.32015.7029, 32 GB RAM, Windows 11 Pro 26200, GTA VI retail, Data point for compute deferral, with the view-format fixes I posted on #163 and #168 in place: deferring compute pipelines works on this machine and it is what makes the difference with 32 GB of RAM.
(I restored the compute branch of 73c8e74 behind Related: Next stop with deferral on: 🤖 Generated with Claude Code |
|
Tested 641f551 (main 956a476 + this PR) on an RTX 3090 (driver 616.92), Windows 11 26300, Ryzen 9 5950X. AI-assisted test report (Claude); tests run locally as stated; the diff was read in full before running. |
|
I tested disposal, concurrent first use and build failure at the scheduler boundary on PR head
Repeated binding after failure continued to return the stand-in. The first draw can still block while a build is in flight: The PR adds no tests. The affected module plus two reviewer tests gave 56 pass / 0 fail on the PR head and 55 pass / 1 fail on main; the eager-disposal negative control accounts for the difference. The fixtures cover two concurrent waiters and an ordinary failed build. Driver compilation time, frame-time distribution, process memory and retail execution were outside this test. AI-assisted review. |
Built at creation, GTA VI's thousands of compute pipelines took 60+ GB of commit in AMD's driver within a minute and the game never left its loading screen (no dispatch at all in 80 s). The device removal this deferral once caused was not the deferral: invalid UAVs of depth buffers (fixed in ivall#163) used by the dispatches it let the game reach. With both, GTA VI reaches its title screen and menus. `XCL_LAZY_COMPUTE=0` builds them at creation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SKtJseucqXR6iuAE6HBtiA
|
Compute pipelines are deferred again, now by default ( 🤖 Generated with Claude Code |
|
Main now creates console pipelines at their first use by default (956a476 + 38b05b7: |
|
Checked against current main (7a033c8): main already builds console pipelines at first use, graphics at first resolve and compute at first bind. With it, the retail game gets past its title screen and into its world without this branch. The only thing left here is dropping a deferred build whose stand-in is released before its first bind (the disposal case Kalmarv tested). It saves some wasted compiles but isn't needed for correctness, and I haven't measured a difference from it. Closing. I can reopen a small PR for that part alone if you want it. 🤖 Generated with Claude Code |
Problem
The retail GTA VI (GDK) creates ~51 000 distinct pipelines in its first 30 s (measured: a translation-keyed cache found only 33 duplicates). Built at creation, each stays in AMD's driver heap (
amdxc64.dll, ~400 KB per pipeline, measured with anNtAllocateVirtualMemorytrace): private commit climbed past 45 GB and the system ran out of commit.While the shader queue was long, title threads without a stand-in waited in their own
Create*PipelineStatecall behind thousands of background DXC jobs (most held bywait_for_memory). The game's watchdog (+0x2215a60) kills the process when a thread stays silent ~30 s.Change
pso_async::submit_lazy: pipelines with console shaders (graphics without HS/DS/GS, compute) get their stand-in at creation and are sent to the workers on their firstresolve.resolve_wait(compute) builds a not-yet-sent pipeline on the spot.XCL_LAZY_PSO=0restores build-at-creation.dxc::urgent: compiles requested from a title thread that waits for them (the sync fallbacks with no stand-in) run immediately on their ownxcl-dxc-urgentthread, not behind the pool queue / memory gate (still counted inWORKING).pc_topology_type(console rect list19/0were refused with0x80070057, so the title waited for the full translation instead).Result (GTA VI 1.0.2.1, AMD GPU, 64 GB)
No more watchdog kill from starved pipeline creation. (The game then stops on Xbox depth-format issues: separate PR.)
Test plan
cargo test --release -p xcl --lib: 534 passed; the 1 failure (gpu_wave64_ps_whole_wave_reductions) also fails onmainpipelines are built at their first use (n created so far)XCL_LAZY_PSO=0to compare)🤖 Generated with Claude Code
https://claude.ai/code/session_01XTYmP6vKUQKatSiA2PC95B