GPU: load an app-local D3D12 Agility SDK runtime when present #463
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!463
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-463"
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?
@Shaun-Fong on GitHub · 2026-11-24 03:43 UTC · original
Shaun-Fong:fix/win10-agility-runtime→main· +112 −0 · 3 files · 1 commits · openWindows 10's inbox D3D12 runtime stops at shader model 6.5, while the shaders victory translates target 6.6 and bind through descriptor heaps. The title's root signatures (flags 0xc01) therefore fail to serialize, its renderer never finishes initializing, and it crashes during Game Init.
When target//D3D12/D3D12Core.dll exists, export the loader's D3D12SDKVersion (614) and D3D12SDKPath (.\D3D12) opt-in symbols so d3d12.dll loads that runtime instead of the system copy, and warn when the runtime is missing at run time. The build script enables the exports only when the file is present, so builds without it behave unchanged.
Verified on Windows 10 19045 with an i5-10400F and an RTX 2070 SUPER: the device reports shader model 6.6, the title's root signatures serialize, and its menus render and respond at 30 fps.
@DaviTostes on GitHub · 2026-11-24 03:46 UTC · original
The head
f47a36edoes not build its tests against currentmain(d2a4bae):The branch carries its own
mod testswhilemainnow already has one inhost.rs(same class as #134/#135/#161/#175/#193). A rebase onto currentmainshould fix it; until thencargo test -p victory-gpufails at compile time, so the change cannot be verified.No game data here, so the Agility SDK loading itself was not exercised either.
valu_testspass on hardware #473valu_testspass on hardware #473@andrewpozdnakov7-jpg on GitHub · 2026-11-24 12:39 UTC · original
I merged
f47a36eintoffe310ein an isolated checkout. The GPU library tests built and ran on Windows 10 (50 passed, one benchmark ignored).I found an incremental build issue. After a build without the SDK, I copied
D3D12Core.dllfrom Agility 1.614.1 with its original, older timestamp. The nextcargo buildreusedvictory.exe, and its PE export table still lacked both SDK symbols. Forcing the build script to rerun enabled them.Watching the
D3D12directory lets Cargo detect the newer directory entry. I verified that copying the older DLL into a newly created directory or an existing empty directory enabled the exports. Removing the DLL from the directory disabled them on the next build. A second build with the DLL still in place did not relink.The rebuilt CLI passed the startup SM 6.6 check with Agility 614 and WARP 1.0.22, and accepted one header-only synthetic DXBC container. With the same WARP package and no Agility exports, the CLI reported SM 6.5. The opt-in executable also printed its missing-runtime warning when copied without
D3D12Core.dll.AI-assisted. Verified with synthetic input and software D3D12.
Incremental patch on
f47a36e@Marvisak on GitHub · 2026-11-25 00:26 UTC · original · edited 2026-11-25 01:16 UTC
Automated triage for the maintainers.
Needs rebase. This pull request conflicts with
main(conflicting:README.md). It will be reviewed once it is rebased onto the currentmain.Generated by Claude Code
valu_testspass on hardware #473@reboot0000-cmd on GitHub · 2026-11-25 06:04 UTC · original
Two small additions to the verifications above, from a third host (Windows 10 IoT Enterprise LTSC 2021 19044.7846, RTX 4090, Agility 1.614.1 as staged, #463 + #486 cherry-picked with the same single
README.mdconflict the triage bot flags):target\<profile>\D3D12\D3D12Core.dllthe exports are simply not emitted, the build succeeds, and the run dies withError: the device supports SM 0x65 only— on a 4090, which reads as a driver or hardware limitation rather than a missing file. Acargo:warning=in theelsebranch (something like "no app-local D3D12 runtime found; the host will stay at SM 6.5") would turn a confusing half hour into a one-line answer. This is separate from @andrewpozdnakov7-jpg's timestamp finding, where the file is present but the export table goes stale: same silent outcome, different cause, and both are worth covering.the D3D12 SDK version configuration of the host exe is invalidrather than falling back to the in-box runtime; and puttingSystem32\D3D12Core.dll(10.0.19041.7291 here) in the app-local slot gives the same refusal, because the export announces 614. So the opt-in is genuinely read and version-checked — it is not merely the presence of a DLL that changes the shader model.The downstream value of merging this is a hardware picture nobody can publish without it: with the opt-in we completed a full
translate --validate --pipelinesover the title's shader archive on this machine in ~43 minutes with no device removal, which is posted on #1247. Without #463, that stage cannot be measured at all on a Windows 10 host. Counts and offsets only, per the asset policy.@leonidaavenger on GitHub · 2026-11-25 06:10 UTC · original
Tested on Windows 10 with an RTX 4070 Ti: works. With this PR the title gets past the root-signature failure, into the world and through the opening cutscene to the Prologue, with no device removal.
Setup: Windows 10 22H2 (19045), RTX 4070 Ti 12 GB, driver 621.14, i9-12900K, 32 GB.
Build: this PR's
apps/victory/build.rsandsrc/main.rs(f47a36e) applied on fxceless/victory-fork310c6eb. It applies cleanly there; I left out the README hunk because the fork's README differs. I did not test it on this PR's own base. Diag build, Series X,VICTORY_RELAY=0 VICTORY_LATE_WAIT=0 VICTORY_D3D12_DRED=1.Runtime:
Microsoft.Direct3D.D3D121.614.1 from nuget.org (Authenticode: Microsoft Corporation). I putD3D12Core.dllandd3d12SDKLayers.dllintarget\diag\D3D12\before building.opting the host D3D12 runtime into Agility SDK 614 (…\target\diag\D3D12\D3D12Core.dll).dumpbin /exportslistsD3D12SDKPathandD3D12SDKVersion.D3D12Core.dll1.614.1.0.20240716.3 fromtarget\diag\D3D12\, beside the systemd3d12.dll10.0.19041.5794.Without the opt-in (same tree): every root signature is refused with
Unsupported bit-flag set (root signature flags c01), nothing draws, and the title crashes at about 3 s.With this PR:
E_INVALIDARG). It is the same 7 under 1.620.2, so the runtime version doesn't cause them; they are the 32-lane wave64 cases from #71.nvlddmkmevents in the System log.Two things worth knowing:
host pipeline library rejected; starting an empty one … 0x80070057). The first run after switching therefore rebuilds every pipeline. For a few minutes the world flickers grey or black (dropped 1282.0/frame without a host pipeline: being made), then fills in. victory handles this correctly, but a README line would save people from thinking it's broken.D3D12SDKVersion = 620and 1.620.2 showed blocky corruption and missing geometry in the cutscene. With 1.614.1 the cutscene rendered cleanly. That is one run each and the shots aren't frame-matched, so treat it as a hint, not a result. It does support pinning 614 as this PR does.Note: Nsight Aftermath's Global mode was off for these runs; with it on, the world load hangs here (see #71). No game files or captures attached.
AI use: Claude Code (Claude Opus 5.5) built the trees, ran the title on my machine, read the logs, and drafted this comment.
@walterwallaceson on GitHub · 2026-11-26 03:39 UTC · original
With a runtime in
target/<profile>/D3D12,cargo test -p victoryfails to link:rustc-link-argalso applies the two/EXPORTs to the integration tests, which don't define the symbols.rustc-link-arg-binsfixes it.Reproduced on
main63bcca4+ this PR (f47a36e, merged), Windows 10 22H2 (19045), MSVC, withD3D12Core.dllintarget/debug/D3D12:Without a runtime, the exports aren't emitted and the tests build. That's probably why CI and the earlier test runs here didn't hit it.
The change in
apps/victory/build.rs:With it,
cargo test -p victory --no-runlinks all four test binaries, and thevictorybinary still loads the app-local runtime. I've used this change for about 25 runs on an RTX 3070 under Windows 10, where the title needs the Agility runtime to start. If the package ever gains another binary,rustc-link-arg-bin=victory=...would scope it to just the one that defines the symbols.I'm testing with Claude's help, and Claude drafted this comment.
@reboot0000-cmd on GitHub · 2026-11-26 10:20 UTC · original
Confirming @walterwallaceson's report from a second Windows 10 host, with the precondition spelled out and one field note that makes the fix obvious rather than arguable.
Reproduced here. Windows 10 IoT Enterprise LTSC 2021 (
19044.7846), MSVC,main+ this branch, withD3D12Core.dllstaged intarget\debug\D3D12:The precondition is worth stating because it explains the blind spot: the failure needs both an integration-test target in
apps/victory/testsand a runtime staged in the profile directory. The branch's own base predates the tests directory, socargo testthere links fine, and CI has no runtime to stage — neither half of the trap is visible from either side alone.The scoping fix works. With
cargo:rustc-link-arg-bins=…,cargo test -p victory --no-runexits 0 with noLNKoutput and builds bothunittests src\main.rsandtests\census.rs. The release binary still carries the opt-in and still reaches shader model 6.6 on this host (translate --pipelinesruns with noSM 0x65refusal).What each image ends up with afterwards, read out of the built binaries:
/EXPORTpresenttarget/release/victory.exetarget/debug/victory.exeunittests src\main.rstests\census.rsThat last row is the consequence to record, not a defect: an integration test that needs shader model 6.6 still cannot opt in on Windows 10, so on this OS it must skip, not assert. I hit the mirror image of this on #2117 this week, where a lane-group test that needs an SM 6.6 device fails here for that reason alone —
victory-shader's test harness has no opt-in at all, by design — and it reads as a regression unless the skip is explicit.The field has already converged on this spelling. The two other open Agility implementations on this repository, #2383 and #2460, both emit:
and #2383's
build.rscarries the reason in a comment:-bins, not plainrustc-link-arg, "keeps/EXPORT:…,DATAoff benches". Note the second half — both use the,DATAsuffix, which is how MSVC is told the export is a variable rather than a function. I measured that spelling too, same tree: clean build, tests link, shader model 6.6 reached, only the build script's own informational warning emitted. Adopting both halves brings this branch in line with the other two implementations rather than inventing a third variant.One housekeeping point while it is being touched: the branch is currently not mergeable against
63bcca4(needs a rebase), so both changes can land in the same push.Why this matters from our side: every hardware pipeline census we have posted this week ran on Windows 10 behind this opt-in — the full-archive
--pipelinesruns (26,084 programs, five separate builds) are impossible here without it, since the in-box runtime caps at shader model 6.5. So acargo testthat cannot link on the same host is a real obstacle for anyone doing that work, not a theoretical one.Setup, if anyone wants to repeat it: Windows 10
19044.7846, runtimeD3D12Core.dll1.614.1 intarget\<profile>\D3D12\, validator DXC1.8.2502.8, RTX 4090. No game data was needed for the link results.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.