d3d12: adapt large shader compile concurrency to available memory #236
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/236"
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 brcly/TuxBox. Originally posted by Valdi320 on 2026-11-26T14:52:57Z.
Review goal: Bound simultaneous large pipeline compilation under host memory pressure while preserving progress.
Scope: Existing adaptive gate plus the wake-all fix when capacity grows; fixed-budget behavior remains notify-one. Existing environment override remains available.
Evidence: Current head
e5f8b58on main6ce0aac: Windows provider typecheck, Python suite 404 collected / 27 skipped, 10/10 native gate tests. Earlier negative control: old wake-one admitted 1/3 eligible workers; corrected gate admits 3/3. Previous six no-GPU groups and selected integrated GPU tests are historical; no new full GPU run or actual title RAM/time saving measured.Review order: fifth, after diagnostics. Independent of other pending PRs. Treat as a candidate until real memory-pressure measurements and full GPU validation are available.
Imported from brcly/TuxBox. Originally posted by Valdi320 on 2026-11-26T22:09:08Z.
Refresh #236 to
88aea59on maine76ff6a. Fixed adaptive wakeup under expanding budget: a single released slot can admit several waiters, so the adaptive path now notifies all; fixed-capacity behavior stays notify-one. Regression red/green on the exact compile-gate module: previous code admitted 1/3 and failed, new code admitted 3/3, all 10 native tests pass. Six no-GPU groups (including Windows typecheck) pass. Integrated validation branchgithub.com/Valdi320/TuxBox@d3276e9c69includes #236, #249, #257, #261, #272, #273 and #275. Rebuilt provider and Lanes fixture, 19/19 isolated D3D12 and 7/7 selected Lanes gates pass on RTX 4080/GE-Proton11-14; actual long-driver-compile memory savings not measured. The integration does not include DrArroway's #258, and does not establish AMD host-memory behavior. Initial isolated runner attempt with an uninitialized Wine prefix hid the NVIDIA adapter; initialized test prefix with NVAPI restored real PCI ID and all cases passed.Imported from brcly/TuxBox. Originally posted by NathansDomainSolutions on 2026-11-28T09:51:02Z.
A real memory-pressure measurement for this, as the description asks: ProjectScarlett 1.0.2.1 to the title screen ("ACCOUNT PICKER / TUXBOX"), on a machine where it nearly runs out of memory.
Host: RTX 4070 12 GB, driver 620.73.04, Ryzen 7800X3D, 30 GB RAM, 4 GB zram, no disk swap, GE-Proton11-14. The desktop holds about 11 GB before launch, which leaves the title about 19 GB. A run on
mainwas killed by the kernel OOM killer earlier tonight.Runs: both launched with the shader preparation cache warm, and both with #378 staged (a texture-memory change unrelated to compiles). Memory was sampled every 15 s from
/proc/<pid>/smaps. "Unix" is anonymous memory above0x7f00…(driver, vkd3d-proton, winevulkan). "Win" is the title's own memory below that.main+ #378 + #380main+ #378 + this PR (88aea59)The gate did adapt. B's "waits for one of N large compile slots" lines: N=4 71 times, N=3 16, N=2 90, N=1 20. A always had 4 (729 lines).
But the peak barely moved: 0.7 GB lower in total, and the unix side swung between about 4 and 13.5 GB either way. I read this as most of the transient driver memory not coming from the gated compiles:
Caveats: A's translator differed: it included #380, so its runtime HLSL cache was cold, while B's was mostly cold. The NVIDIA cache was warmer for B. Both runs end at the same screen. This is one run per arm.
Next I can measure a pinned
TUXBOX_LARGE_COMPILES=1run (the floor of what gating large compiles alone can do) and the per-compile peak of a single 750 KB translated compute pipeline on this driver, if that helps calibrateBYTES_PER_COMPILE.(Measured with Claude Code assisting.)