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

Open
github-bot wants to merge 2 commits from github-bot/gh-2383 into main AGit
Owner

@⁠makmatvey on GitHub · 2026-11-25 12:22 UTC · original
makmatvey:cursor/gpu-agility-sdk-opt-in-ec56 → main · +455 −1 · 7 files · 2 commits · open

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

**@⁠makmatvey** on GitHub · 2026-11-25 12:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/2383) `makmatvey:cursor/gpu-agility-sdk-opt-in-ec56` → `main` · +455 −1 · 7 files · 2 commits · open ## 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 #84

Co-authored-by: Matsvey Makushenka <[email protected]>
Calvix2k's review on #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 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:04:15 +00:00
Author
Owner

@⁠Calvix2k on GitHub · 2026-11-25 12:25 UTC · original

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. #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 #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 #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.

**@⁠Calvix2k** on GitHub · 2026-11-25 12:25 UTC · [original](https://github.com/Marvisak/VIctory/pull/2383#issuecomment-7162343524) 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.** #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 #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 #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.
Author
Owner

@⁠makmatvey on GitHub · 2026-11-25 12:38 UTC · original

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.

**@⁠makmatvey** on GitHub · 2026-11-25 12:38 UTC · [original](https://github.com/Marvisak/VIctory/pull/2383#issuecomment-7162653311) 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.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 14:57 UTC · original · edited 2026-11-25 22:22 UTC

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

**@⁠Marvisak** on GitHub · 2026-11-25 14:57 UTC · [original](https://github.com/Marvisak/VIctory/pull/2383#issuecomment-7166080572) · edited 2026-11-25 22:22 UTC <!-- victory-triage v1 head=f40129ab5e6efce17b32d9d2c16da9bc55e916a1 verdict=needs-rebase at=2026-11-25T22:30:35Z --> 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](https://claude.ai/code)_
This pull request has changes conflicting with the target branch.
  • apps/victory/src/main.rs
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.
git fetch -u origin '+refs/pull/2383/head:github-bot/gh-2383'
git switch 'github-bot/gh-2383'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2383'
git switch 'github-bot/gh-2383'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2383'
git switch 'github-bot/gh-2383'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2383'
git switch 'main'
git merge --squash 'github-bot/gh-2383'
git switch 'main'
git merge --ff-only 'github-bot/gh-2383'
git switch 'main'
git merge 'github-bot/gh-2383'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
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/Marvisak--VIctory!2383
No description provided.