Windows 10: load the D3D12 Agility SDK runtime (shader model 6.6) #44
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD!44
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-44"
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?
@Arvi23 on GitHub · 2026-11-25 12:47 UTC · original
Arvi23:pr/windows10-agility→main· +571 −5 · 15 files · 6 commits · openWindows 10's in-box D3D12 runtime stops at shader model 6.5. It refuses the root signatures every translated pipeline uses (directly indexed heaps, flags
0x400/0x800, logged asroot signature flags c01/c00), so nothing draws, and the title crashes during init. This tree's README lists Windows 10 as supported, but nothing here loads a newer runtime yet.What
Six commits, authorship kept:
1b3243e(Marvisak/VIctory#175 by kykifox1337-source, as carried in fxceless/victory-fork#420):victory.exeexportsD3D12SDKVersion = 620andD3D12SDKPath = ".\D3D12\".cargo xtask agilitydownloadsMicrosoft.Direct3D.D3D121.620.2 from nuget.org, checks its published SHA-512, and unpacksD3D12Core.dllandd3d12SDKLayers.dllintotarget\<profile>\D3D12\. The DLLs never enter the repository.victory configreports whether the runtime is in place.7fde840(Marvisak/VIctory#362, also from fxceless/victory-fork#420): thevictory-shadertest executables get the same exports, only whenD3D12Core.dllis staged. Without it they behave as before.0807c72: the Windows 10 step goes in this fork's "How it is run here" section. The upstream half of the README stays unchanged.451255b:victory-gpu's test executables get the same exports as the shader tests (a build script and a test-only module). Without them, on Windows 10,depth_bounds_control_a_title_drawfailed with "host refused the depth bounds pipeline"; it passes on Windows 11.7a06d5a: the tests' exports are a.drectvelinker directive in the test-only module, not link arguments from the build scripts. Link arguments reached the integration tests too (victory-shader/tests/resource_tracking.rs), which lack the symbols, socargo test --workspacefailed to link. The build scripts now only setcfg(agility_runtime)when the runtime is staged.ed30376:victory.exegets the exports only whenD3D12Core.dllis in the profile'sD3D12\folder at build time (cfg(agility_runtime), as the test executables already did). Without it, the executable names no runtime and the in-box one is used, as on01aadd1. Before this commit, Windows 11 withoutcargo xtask agilityfailed every device creation withD3D12_ERROR_INVALID_REDIST(reported below by adrianmjim, RX 7900 XT).cargo xtask agilitynow also touchesapps/victory/build.rs, so the next build picks the runtime up, andvictory configsays which case applies: present, named but missing, or not built in.Changes for this tree:
apps/victory/build.rskeeps this tree's/STACK:16777216next to the two/EXPORTs (the exports only when the runtime is staged, see 6).crates/victory-shader/src/lib.rsgets only the test-onlyagilitymodule. There is nobvhmodule here.xtaskdeclaresminiz_oxideitself, since the workspace doesn't list it.When the runtime was not staged at build time, on Windows 11 or 10,
victory.exenames no runtime and the in-box one is used, as before. D3D12 does not fall back when an executable names a runtime that is missing (D3D12_ERROR_INVALID_REDIST), which is why the exports are only added oncecargo xtask agilityhas filled the folder (commit 6).Tested
RX 9070 XT, driver 32.0.32029.2010, Ryzen 7 5800X3D, 32 GB, Windows 10 IoT Enterprise LTSC 21H2 (19044), Rust 1.98.1.
71652a2+ this PR + the integer-target blend PR: the diagnostics build, run as your README describes (sameVICTORY_*settings), loads into the prologue. 0 root signatures were refused, the whole first room was drawn, at 2.7–3.0 fps, with no crash or device removal. Five earlier runs on4cbe9d7plus these commits also refused no root signatures.flags c01). I saw that on fxceless's tree on this machine, where the title crashed about 2 s in.cargo xtask agility, thenvictory config:d3d12 sdk : ...\target\diag\D3D12\D3D12Core.dll (version 620).cargo test --workspaceon71652a2+ this PR: 555 passed, 7 failed, and the 7 fail without this PR too:xmemtests of #2 and #8;repository_passes_policy(lower.rsover the size limit, as your README notes);crash::tests::unwinds_like_the_system_walk, which is flaky on Windows 10: 4 failures in 6 runs on71652a2alone, 2 in 6 with this PR.depth_bounds_control_a_title_drawpasses.queue::tests::present_runs_after_a_queues_waitfailed once. It passed on its own 5 times out of 5, so it looks timing-sensitive.cargo clippyon the touched crates: no warnings in the touched files.D3D12\folder at build time,victory.exehas no exports andvictory configsays the in-box runtime is used. With the folder staged and a rebuild, both exports are there,victory confignamesD3D12Core.dll (version 620), andvictory translate --pipelinesmakes its device on the Agility runtime (host waves 32-64 lanes). With the folder removed afterwards,victory configsays it is named but missing.Not tested here: Windows 11. adrianmjim's report there found the regression that commit 6 fixes; a retest of the new head is pending. On NVIDIA, #113 ran the workspace tests with this PR on Windows 10 (RTX 2060).
AI use: Claude Code (Claude Opus 5.5) assembled and adapted the commits, ran the checks, and wrote this. The runs are on my machine.
🤖 Generated with Claude Code
The build scripts passed /EXPORT:D3D12SDKVersion and /EXPORT:D3D12SDKPath as link arguments, which reach every executable of the crate, the integration tests too. Those link the library without its test-only `agility` module, so `cargo test --workspace` failed to link victory-shader's tests/resource_tracking.rs ("unresolved external symbol D3D12SDKVersion"). The exports are now a `.drectve` linker directive in the `agility` module itself, so only the unit-test executable carries them, and the build scripts set `cfg(agility_runtime)` when the runtime is staged instead. Co-Authored-By: Claude Opus 5.5 <[email protected]>@chazi123 on GitHub · 2026-11-25 13:01 UTC · original
One more data point for 620 on NVIDIA, from a different tree (JoshuuDev/victory-amd, same translator core), Windows 10 19045 + RTX 3060 Laptop 12 GB:
host mesh shader support mesh=true, the world reaches and draws.The method differs from the PR above, and it needs no build-script change — useful when
apps/victory/build.rsis not yours to edit. Load the runtime at call time instead of through/EXPORT:called from
host::create(), immediately beforeD3D12CreateDevice.D3D12Core.dllstill has to be in<exe>\D3D12\; only the wiring differs. About 165 lines, no dependency beyond thewindowscrate already in the tree, one call site.Source: https://github.com/chazi123/xcl-chazi/tree/main/victory-amd-win10-nvidia —
files/agility.rs, with log excerpts inlogs/evidence.txt.One thing worth knowing whichever path is taken: D3D12 does not fall back when the executable names a runtime that is missing (
D3D12_ERROR_INVALID_REDIST), so this path returns a state rather than failing silently and falls through to the in-box runtime only when it was never loaded.@Arvi23 on GitHub · 2026-11-25 13:28 UTC · original
Added
451255b:victory-gpu's test executables now get the Agility exports too, as the shader tests already did (a build script plus a test-only module, andcargo xtask agilitytouches both build scripts).This comes from the note on #45 that
depth_bounds_control_a_title_drawpasses on Windows 11. On Windows 10 it failed with "host refused the depth bounds pipeline", because thevictory-gputests still ran on the in-box runtime. It was the tests, not the game. With the commit,cargo test -p victory-gpu --libon this branch gives 109 passed, 0 failed, three runs in a row (RX 9070 XT, Windows 10 LTSC 21H2). The description is updated.AI use: Claude Code (Claude Opus 5.5) wrote the commit and this; the runs are on my machine.
@Arvi23 on GitHub · 2026-11-25 13:33 UTC · original
One more fix,
7a06d5a: with the Agility runtime staged,cargo test --workspacefailed to linkvictory-shader/tests/resource_tracking.rs("unresolved external symbol D3D12SDKVersion"). The build scripts'/EXPORTlink arguments reached the integration tests too, and those don't have the test-only module. The exports are now a.drectvelinker directive inside that module, so only the unit-test executable carries them.cargo test --workspaceon this branch now links and runs: 555 passed, and the 7 that fail also fail without this PR (listed in the description).@adrianmjim on GitHub · 2026-11-25 17:23 UTC · original
Tried on Windows 11 (build 26300, in-box
D3D12Core.dll10.0.26100.9818), RX 7900 XT, with this PR (7a06d5a) applied to01aadd1, release build, without runningcargo xtask agility:(The system's Spanish text for
D3D12_ERROR_INVALID_REDIST: "the host exe's D3D12 SDK version configuration is invalid".) The same command on01aadd1creates the device (host waves 32-64 lanes) and goes on translating. So on this Windows 11 the in-box runtime is not used as before when the folder is missing:victory.exealways exportsD3D12SDKVersion = 620, the in-box runtime here does not satisfy it, and D3D12 refuses the device rather than falling back, as the description itself notes.victory runcreates its device the same way, so it would fail too for anyone on Windows 11 who has not runcargo xtask agility.Maybe make the exports on
victory.exeopt-in in the same way as the test executables (only when the runtime is staged at build time, e.g. theagility_runtimecfg the build scripts already compute), or havevictory config/runfail early with a hint to runcargo xtask agility. I can retest a new head on this machine.@Arvi23 on GitHub · 2026-11-25 18:31 UTC · original
@adrianmjim thanks, that's a real regression, and your first suggestion is the fix:
ed30376makes the exports onvictory.exedepend on the runtime being staged at build time, as the test executables already did.apps/victory/build.rsexportsD3D12SDKVersion/D3D12SDKPathonly whentarget\<profile>\D3D12\D3D12Core.dllexists when it runs (cfg(agility_runtime)). Without it,victory.exenames no runtime and D3D12 uses the in-box one, as01aadd1does.cargo xtask agilitynow also touchesapps/victory/build.rs, so the next build picks the runtime up without a clean.victory configsays which case it is: built in and present, built in but missing (device creation will fail, runcargo xtask agility), or not built in (in-box runtime).Checked here on Windows 10 (RX 9070 XT, driver 32.0.32029.2010), debug build:
victory.exevictory configD3D12\folder at build timeD3D12Core.dll (version 620)translate --pipelines:host waves 32-64 lanes)cargo xtask agilityI can't test Windows 11 here, so a retest of the new head on your machine (without
cargo xtask agility) would confirm the device comes up on the in-box runtime again.AI use: Claude Code (Claude Opus 5.5) wrote the fix and this reply; the checks ran on my machine.
@HAL9000RELOADED on GitHub · 2026-11-25 18:35 UTC · original
Another Windows 10 data point, on RDNA3: Windows 10 22H2 (19045), RX 7900 XTX 24 GB, driver 32.0.32015.7029, i7-13700KF, 96 GB, Rust 1.98.1.
ed30376merged on000ffdd(clean), debug build.victory.exe(victory translate --pipelines --jobs 1 <empty dir>, which makes the host device without game data):dumpbin /exports)victory configD3D12\at build timenot built in, the in-box runtime is usedthe device supports SM 0x65 only (on Windows 10, cargo xtask agility …)cargo xtask agility, then buildD3D12Core.dll (version 620)host waves 32-64 lanesOn
7a06d5athe first row wasD3D12_ERROR_INVALID_REDISThere too, so @adrianmjim's case also happened on Windows 10. Withed30376you get the hint instead.cargo test --workspace, runtime staged: 560 passed, 6 failed: the fivexmemtests (#2, #8) andrepository_passes_policy.unwinds_like_the_system_walkpassed this time (flaky, as you noted). Nono SM 6.6 deviceskips.For comparison,
000ffddwithout this PR fails 38 here: on top of those, 31victory-shadertests (valu_tests,scratch_tests,lane_read_loop_tests: "the device supports SM 0x65 only") anddepth_bounds_control_a_title_draw("host refused the depth bounds pipeline"). This PR fixes all 32 on this card.Not tested: building with the runtime and removing the folder afterwards (your third row), and the game itself.
@adrianmjim on GitHub · 2026-11-25 18:42 UTC · original
Retested
ed30376on the same machine (Windows 11 build 26300, in-boxD3D12Core.dll10.0.26100.9818, RX 7900 XT), release build, fresh target directory, withoutcargo xtask agility(noD3D12\folder beside the executable):victory.execarries neitherD3D12SDKVersionnorD3D12SDKPath.victory config:d3d12 sdk : not built in, the in-box runtime is used (needed on Windows 10: ...).victory translate --pipelines --jobs 1 <game>: the device is created (host waves 32-64 lanes) and translation goes on, as on01aadd1. With7a06d5athe same command failed withD3D12_ERROR_INVALID_REDIST.So the regression is gone here. Not tested: the two other rows of your table on Windows 11 (I did not run
cargo xtask agilityon this machine).@lerapeurdu62280-debug on GitHub · 2026-11-26 19:20 UTC · original
Test report on RDNA 2 under Windows 10, which this PR had no data point for yet: Windows 10 Pro 19045, AMD RX 6600 8 GB (Adrenalin 32.0.21045), Rust 1.98.1, debug build.
ed30376merged onmain4f62c2a(merges cleanly). No game files.victory.exe(victory translate --pipelines <empty folder>, which makes the host device first):victory configcargo xtask agilitythe device supports SM 0x65 only (on Windows 10, cargo xtask agility puts a newer D3D12 runtime beside victory.exe)not built in, the in-box runtime is used …cargo xtask agilityand a rebuildD3D12SDKPath,D3D12SDKVersion…\target\debug\D3D12\D3D12Core.dll (version 620)So no 0x887E0003 without the runtime, and clear messages both ways.
cargo xtask agilitydownloaded 1.620.2 and staged it intodebug,releaseanddiag.Test binaries:
victory-gpudepth_bounds_control_a_title_draw)victory-shaderThe two
victory-shaderfailures left (valu_tests::scalar_counted_in_a_divergent_loop_read_after_it,scalar_counted_in_nested_divergent_loops) fail without the runtime too, so they are not from this PR. In one of four fullvictory-gpuruns with the runtime,resource::tests::copy_texture_region_reads_back_into_title_bufferfailed (aligned row 0, all zeros). It passed 3/3 alone and in the other runs, so it looks like a parallel-run flake.A small note, not a blocker: the build scripts watch the
D3D12folder throughrerun-if-changed. If the folder is moved away and back by hand (its files keep their old timestamps), the test binary is not rebuilt and keeps whatever it had: I got a binary without the exports while the runtime was there, until I touchedbuild.rs. Going throughcargo xtask agilitydid not hit this.AI-assisted: yes (Claude Code)
@Arvi23 on GitHub · 2026-11-26 19:55 UTC · original
Thanks for testing on RDNA 2 under Windows 10, that's the combination the PR had no data for. The
SM 0x65 onlymessage without the runtime, and a clean device with it, is exactly the behaviour I was after. The test numbers match too: without a runtime that has shader model 6.6, the shader tests that need it can't make their pipelines.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.