Skip to content

GPU: opt-in Agility SDK runtime for victory.exe - #2383

Open
makmatvey wants to merge 2 commits into
Marvisak:mainfrom
makmatvey:cursor/gpu-agility-sdk-opt-in-ec56
Open

makmatvey wants to merge 2 commits into
Marvisak:mainfrom
makmatvey:cursor/gpu-agility-sdk-opt-in-ec56

Conversation

@makmatvey

Copy link
Copy Markdown
Contributor

Summary

Opts victory.exe into an app-local DirectX 12 Agility SDK runtime so Windows 10 can run builds that need a newer D3D12 feature level / SM 6.6 without relying on the OS-shipped runtime alone.

Changes

  • Wire Agility SDK export/packaging through xtask (agility module) and victory build.rs / main.rs
  • Document the Agility-enabled build path in the README
  • Update Cargo lock/deps as needed for the opt-in path

Test plan

  • Standard (non-Agility) build still builds and runs on Windows 11 + SM 6.6
  • Agility-enabled build produces D3D12Core.dll next to victory.exe and runs on Windows 10
  • Confirm placing Agility DLL beside a standard victory.exe alone is still insufficient (as documented)

Related: #84, #2360

Windows 10's inbox D3D12 stops at shader model 6.5 while translated title
shaders need 6.6. When target/<profile>/D3D12/D3D12Core.dll is present,
apps/victory's build script exports D3D12SDKVersion/D3D12SDKPath so the
loader picks that runtime; otherwise it warns instead of failing later
with a confusing SM 6.5 device error. `cargo xtask agility` downloads the
pinned Microsoft.Direct3D.D3D12 1.614.1 package, checks SHA-256, and
stages the DLL (never committed).

Fixes Marvisak#84

Co-authored-by: Matsvey Makushenka <matvey.myown@gmail.com>
@Calvix2k

Copy link
Copy Markdown
Contributor

Built and checked on the machine this is for: Windows 10 19045, MSVC 14.44.35207, CARGO_TARGET_DIR separate, cargo build --release -p victory, fa18d59.

With D3D12/D3D12Core.dll staged (I used package 1.620.2, not 1.614.1, on purpose):

1    0 0053E990 D3D12SDKPath = D3D12SDKPath
2    1 0053E9A4 D3D12SDKVersion = D3D12SDKVersion

With the folder removed and the crate rebuilt: no exports at all — so the build script really re-runs on the file's disappearance and a machine without the runtime keeps the in-box D3D12. Both test-plan boxes that do not need the title are ticked on Windows 10 here.

Two things worth keeping, and one to consider:

  1. rustc-link-arg-bins is the right form. shader: opt the test binaries into an app-local Agility SDK runtime #486 needed .drectve because cargo:rustc-link-arg applies to every target of the package and /EXPORT:D3D12SDKVersion,DATA fails with LNK2001 in a target that does not link the object (guard_runs). -bins scopes it to the binaries, so cargo build --benches stays clean. With shader: opt the test binaries into an app-local Agility SDK runtime #486 for the test binaries and this for the app, both halves are covered.
  2. D3D12SDKPath as a const char* static (your SdkPath wrapper) is what the loader dereferences — an array would export its contents, not the pointer. Same shape as shader: opt the test binaries into an app-local Agility SDK runtime #486's.
  3. Version 1.614.1 vs what people stage. It works with a newer DLL (my 1.620.2 staging above), but not with an older one: the loader refuses with 0x887e0003 and the first device creation dies. Since the README's audience will happily copy whatever Microsoft.Direct3D.D3D12 version they already have, one line — "the staged D3D12Core.dll must be 1.614.1 or newer" — would save the next person that error. (Optional: accept VICTORY_AGILITY_VERSION in build.rs for people who want to pin a newer announce.)
  4. check_runtime warns but continues. A build made with the exports cannot start without the DLL — d3d12.dll fails the process at load. The warning is right, but its wording ("copy D3D12Core.dll … or rebuild") reads as advice for a soft problem; say that the process will exit and where the error will come from (0x887e0003), or exit right there with that message instead of letting the loader produce it.

For the record, this is the piece Windows 10 users need that #2307 measures (0 → 26,641 pipelines) and that the guide in #1612 tracks; the same staging I used here is what let me validate today's shader work on the card.

@DenRakEiw DenRakEiw left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified against origin/main (940d32f):

  • Opt-in Agility SDK staging (cargo xtask agility) and apps/victory/build.rs integration build and pass all xtask and victory tests cleanly without affecting default builds when no app-local D3D12Core.dll is present.
  • cargo test -p xtask: 8/8 passed (including agility::tests::package_constants_agree and sha256_of_known_bytes).
  • cargo test -p victory: 12/12 passed.
  • cargo clippy -p xtask -p victory --all-targets -- -D warnings: 0 warnings.
  • cargo xtask policy: 185 files ok.

AI-assisted (Gemini 4 Neon).

@catminou4 catminou4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opt-in Agility SDK runtime: cargo xtask agility downloads Microsoft.Direct3D.D3D12 1.614.1 into target, build.rs exports D3D12SDKVersion/Path when D3D12Core.dll present (+382). Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1. Legit mechanism for Windows 10 SM 6.6 support (#84); pairs with README #2360. Downloads an official Microsoft NuGet package — hash-pinning the package would harden the supply chain here.

Calvix2k's review on Marvisak#2383: require staged D3D12Core.dll >= 1.614.1
(older → 0x887e0003), allow VICTORY_AGILITY_VERSION to pin a newer
announce, and fail early with that HRESULT instead of a soft warning.

Co-authored-by: Matsvey Makushenka <matvey.myown@gmail.com>
@makmatvey

Copy link
Copy Markdown
Contributor Author

Thanks @Calvix2k — addressed in f40129a:

  1. README now requires staged D3D12Core.dll ≥ 1.614.1 (older → 0x887e0003).
  2. build.rs accepts VICTORY_AGILITY_VERSION to announce a newer SDK.
  3. check_runtime fails early with that HRESULT instead of a soft warning.

Kept rustc-link-arg-bins and the SdkPath / const char* export shape.

Marvisak commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Automated triage for the maintainers.

Needs rebase. This PR no longer merges cleanly into main (conflict in apps/victory/src/main.rs). It will be reviewed again once it is rebased.

From the earlier needs-work note: it needs the maintainer's decision (new build.rs, a tempfile dependency, and cargo xtask agility, which downloads and runs external programs); #2460 and #2429 address the same problem.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants