D3D12-WARM-AMD-SINGLE-PROCESS: default leonida warm to one process on AMD #2830
Closed
github-bot
wants to merge 1 commit from
github-bot/gh-2830 into main
AGit
pull from: github-bot/gh-2830
merge into: github:main
github:main
github:perf/darner-title-priority-ceiling
github:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
github:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
github:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
github:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
github:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
github:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
github:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
github:fix/runtime-test-conservative-fixtures
github:ci/shard-semantic-linux
github:docs/fg-limit-fps-switch
github:fix/runtime-test-fixture-paths
github:fix/runtime-test-fixture-readers
github:fix/read-file-hard-link
github:fix/book-slot-heap-never-read
github:fix/depth-resolve-spv-path
github:fix/indirect-unused-batched
github:gh-pr/3358/base
github:fix/xmem-refusal-diagnostics
github:gh-pr/3357/base
github:ci/shorten-ci-time
github:fix/alias-later-queued-submissions
github:claude/gallant-sagan-aamatr
github:gh-pr/3342/base
github:gh-pr/3341/base
github:d3d12/agility-sdk-621
github:gh-pr/3293/base
github:gh-pr/3319/base
github:gh-pr/3318/base
github:gh-pr/3315/base
github:gh-pr/3313/base
github:gh-pr/3314/base
github:claude/fervent-curie-m19lnr
github:gh-pr/3216/base
github:gh-pr/3272/base
github:gh-pr/3276/base
github:gh-pr/3279/base
github:gh-pr/3257/base
github:gh-pr/3258/base
github:gh-pr/3271/base
github:codex/skip-no-hit-ray-passes
github:gh-pr/3230/base
github:gh-pr/3266/base
github:gh-pr/3247/base
github:gh-pr/3246/base
github:gh-pr/3244/base
github:claude/sharp-sagan-1jqnp3
github:t3/preserve-fsr-sdk-restart-path
github:t3/propagate-host-failure-hresult
github:t3/launcher-custom-parameters
github:t3/series-x-2160-startup
github:codex/d3d12-uncapped-simulation
github:ci/less-to-run
github:perf/native-compute-shader-forms
github:claude/blissful-franklin-ukp7ag
github:codex/full-precompile-default
github:gh-pr/3166/base
github:gh-pr/3148/base
github:gh-pr/3138/base
github:gh-pr/3106/base
github:gh-pr/3057/base
github:gh-pr/2756/base
github:gh-pr/2812/base
github:gh-pr/3032/base
github:gh-pr/2992/base
github:notes/card-time-and-plant-flicker
github:gh-pr/2986/base
github:gh-pr/3000/base
github:gh-pr/2966/base
github:gh-pr/2924/base
github:gh-pr/726/base
github:gh-pr/2761/base
github:gh-pr/2663/base
github:gh-pr/2861/base
github:gh-pr/2862/base
github:gh-pr/2820/base
github:gh-pr/2811/base
github:gh-pr/2803/base
github:rt-call-trace
github:gh-pr/2802/base
github:gh-pr/2766/base
github:perf/ahead-split
github:gh-pr/2589/base
github:gh-pr/2699/base
github:gh-pr/2696/base
github:docs/readme-runtime-proposal
github:gh-pr/1346/base
github:codex/coord-claim-check-20261124-7e48
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
area: ci
.github/ workflows and settings
area: d3d12
The D3D12 runtime in d3d12/ (Rust: leonida.exe and its crates)
area: docs
Documentation
area: launcher
The launcher (launcher/)
area: runtime (legacy)
The earlier Vulkan runtime in runtime/
area: shader translator
The shader translator (leonida-shader, tools/rdna2spirv) and its tests
area: tools
tools/ and scripts/
area: viewer
The map viewer (viewer/)
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
missing claim
Needs a claim in #14
needs in-game run
Changes the code a frame runs through: needs the 300 s in-game gate (docs/game_gate.md)
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
wontfix
This will not be worked on
No labels
accessibility
area: ci
area: d3d12
area: docs
area: launcher
area: runtime (legacy)
area: shader translator
area: tools
area: viewer
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs in-game run
needs rebase
needs-triage
question
ready-for-agent
submodules
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!2830
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2830"
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?
@bobcatchris on GitHub · 2026-12-01 04:14 UTC · original
bobcatchris:fix/d3d12-warm-amd-single-process→main· +61 −2 · 4 files · 1 commits · closed without mergingClaim:
D3D12-WARM-AMD-SINGLE-PROCESS(#2570).What and why
leonida warmdefaulted to two thirds of the logical cores. On an RX 7900 XTX that starts tenamdxc64.dllcompiler processes; the driver silently refuses most PSOs and ends some processes with0xc0000005. The same machine warmed 1,845 of 1,845 used pipelines with--jobs 1and zero crashes, leavingwarm-bad.txtempty.This changes the default to one process when the DXGI adapter reports vendor
0x1002.--jobsstill wins when passed explicitly, so the old behaviour remains available for A/B. Every other vendor keeps two thirds of the logical cores.The vendor is queried through DXGI without creating a device, and
LEONIDA_ADAPTERis honoured the same way the host device honours it. Two unit tests pin the pure default helper for AMD, another vendor and an unknown adapter.No rendering or visual setting changes: this only chooses how many compiler processes warm uses before a run.
Verification (offline, no game files)
The two
leonidaclippy warnings (player.rs:570and the pre-existingcount % 1000inwarm.rs) are onmainbefore this change.Hardware
Measured on AMD Ryzen 7 7800X3D, Radeon RX 7900 XTX (24 GB, driver 32.0.32029.2010), Windows 11. The compiler fault and the single-process warm are from the reporter's 48-minute log; this pull request changes only the default and was verified with the tests above, not by launching the game.
No game data, archives, shaders, textures or logs are in this change.
AI-assisted: yes.
07c45c2eb3toc6fc64b059@ecox982745 on GitHub · 2026-12-01 04:22 UTC · original
Independent Windows CLI verification. Head
c6fc64b05merged cleanly into86c30fcea(tree556ef0ca1). I built it on Windows 11 with Rust 1.98.1/MSVC. For this CPU-only probe I stubbed adapter detection and the driver fingerprint in a scratch build and made any attempt to create the D3D12 host fail the fixture. Thewarmargument parser and job-selection path were unchanged.Each invocation used
warm --limit 0with its own empty synthetic pipeline store. The two existingwarm::testsalso passed in this build.--jobs 7--jobs 0The NVIDIA and no-adapter defaults used 16 logical cores. Both explicit cases were configured to fail if the new vendor lookup was called. All five invocations exited successfully with zero pipelines to compile. Actual DXGI selection and AMD compiler stability remain hardware checks.
AI-assisted with OpenAI Codex (GPT-6.2 Sol).
@KelboLive on GitHub · 2026-12-01 06:03 UTC · original · reviewed
On this NVIDIA box the new path is inert, which is the first thing to want:
adapter_vendor_id()returns0x10deanddefault_jobs(Some(0x10de), 32)is 21 (two thirds of 32) — the same as before — while--jobsstill wins and never queries DXGI when passed.warm::testsis 2/2, flipping the vendor comparison fails both, andd3d12_switches.py --check,check_no_game_dataandgit diff --checkare clean.Shaders' "every logical core" andLEONIDA_PIPELINE_WORKERSare untouched, so the shader-translation process count does not change — only how manywarmprocesses run.The risk I would write down, because I could not observe AMD here: the helper takes the first non-software
EnumAdapters1adapter (host.rs:1431), whilecreatepassesNULLtoD3D12CreateDeviceand lets Windows choose. On an Intel-iGPU + AMD-dGPU hybrid those can disagree — an OS per-app preference, or the iGPU enumerated first — and thenwarmpicks two thirds of the cores while the runtime device is AMD, which is exactly the compiler-concurrency problem this default exists to avoid.LEONIDA_ADAPTERis the only way to align them today; the DXGI selection has no test (onlydefault_jobsdoes). A sentence in the doc/comment aboutLEONIDA_ADAPTERwould be cheap; a helper that takes the adapter list by injection would let the selection be tested.Nit: with
LEONIDA_ADAPTERset, the warm query callschosen_adapter, which logs "host device on the card …" before any device exists, and then the device logs the same line again.@imShangLi on GitHub · 2026-12-02 00:35 UTC · original
VERIFY-2830 — Linux, Fedora 45, Rust 1.98.1 (the pinned toolchain), Wine 11.21, no GPU device, no game files
Verdict: PASS. The repository's own red/green idea holds under Wine: the new test fails on the merge base and passes with the pull request, and nothing that worked before is broken.
Head
c6fc64b0, base the currentmain85ec1d33, merge base86c30fce, 4 files, +61/−2:d3d12/apps/leonida/src/warm.rs,d3d12/apps/leonida/src/main.rs,d3d12/crates/leonida-gpu/src/host.rs,d3d12/crates/leonida-gpu/src/lib.rs.1. What it changes
AMD's driver compiler refuses most pipelines when several processes ask it at once, and faults (
0xc0000005) when enough are refused. Thewarmcommand (which makes the title's pipelines ahead of time) used to run two thirds of the logical cores' worth of processes. The change asks the adapter for its vendor id and uses one process on AMD:and the vendor id comes from a plain DXGI enumeration that makes no device:
The enumeration skips software adapters (
DXGI_ADAPTER_FLAG_SOFTWARE), so a WARP-only machine getsNoneand keeps the old default ✓.2. What I checked
cores * 2 / 3and the new one is(cores * 2 / 3).max(1)for a non-AMD vendor — the same value as before (the old code's.max(1)was applied afterunwrap_or, the new one afterunwrap_or_else, so a caller-passed--jobsis still taken as given) ✓. On 16 cores that is 10, on one core 1 ✓.Nonecase keeps the old behaviour, as the comment says: no adapter → the old two-thirds default ✓, which the new test checks (default_jobs(None, 16) == 10).0x1002, the same constant the driver fault is attributed to ✓; a non-AMD vendor (0x10de) keeps two thirds ✓.EnumAdapters1andGetDesc1, no device made — which matters because the caller is theleonidaapp, before any device exists ✓.3. Red and green, run under Wine
apps/leonidaandleonida-gpudo not build on Linux (upstream: "The crates are Windows-only today … Linux follows #2577"), so I cross-compiled them forx86_64-pc-windows-gnuand ran the tests under Wine 11.21:watchtests that need Microsoft'sVirtualAlloc/VirtualQuerybehaviour, which Wine does not have4. What I did not check
0xc0000005is a claim about an AMD card and its driver; I have no AMD card here, and the fix's effect (one process instead of ten) cannot be measured.LEONIDA_ADAPTERbeing honoured byadapter_vendor_id(): I read that it uses the samechosen_adapter()the device path uses, and did not run it with that variable set.AI-assisted: MiniMax M3.1 Flash.
@MoonEyes on GitHub · 2026-12-02 11:52 UTC · original
Closing: this pull request no longer applies to current
main(merge conflict ind3d12/apps/leonida/src/warm.rs), and open pull requests that have fallen out of step withmainare being closed so the list stays workable. If you still want this change, rebase it on currentmainand reopen it (or open a new pull request); it will be looked at again.AI-assisted (Claude Code).
Pull request closed