RX 6900 XT, Windows 10: how I load the app-local Agility SDK (follow-up to beta #2) #36

Open
opened 2026-11-26 05:53:12 +00:00 by github-bot · 5 comments
Owner

@⁠BlackBu7let on GitHub · 2026-11-25 19:08 UTC · original

Follow-up to klbf-lab-beta#2 (archived). @⁠PastiiJay asked how the app-local Agility SDK 614 loads on Windows 10; cc @⁠jeemailtrevor22-cmy.

It is a build change, not an exe patch or a launcher. Two parts:

  1. The exe exports the two symbols. I append this to apps/victory/src/main.rs (Windows only):
#[cfg(target_os = "windows")]
#[unsafe(no_mangle)]
pub static D3D12SDKVersion: u32 = 614;

#[cfg(target_os = "windows")]
#[repr(transparent)]
pub struct AgilitySdkPath(*const u8);

// SAFETY: the exported pointer refers to immutable static bytes.
#[cfg(target_os = "windows")]
unsafe impl Sync for AgilitySdkPath {}

#[cfg(target_os = "windows")]
#[unsafe(no_mangle)]
pub static D3D12SDKPath: AgilitySdkPath = AgilitySdkPath(c".\\D3D12\\".as_ptr().cast());
  1. The symbols have to end up in the exe's export table, so I link with explicit export flags:
cargo rustc --profile diag -p victory --features diagnostics -- -C link-arg=/EXPORT:D3D12SDKVersion,DATA -C link-arg=/EXPORT:D3D12SDKPath,DATA

Then a D3D12 folder next to victory.exe with D3D12Core.dll and d3d12SDKLayers.dll from Agility SDK 1.614.0 (1.614.0.0.20240513.5 here).

Caveat: the builds start and run this way (Lab 33 and Lab 35), but I have not confirmed from the log that the folder's D3D12Core.dll is the one that gets loaded. I did not find a log line that says so.

I also saw that win10-test has "Agility SDK path exported as pointer, as d3d12.dll reads it" (4973c9e), which looks like the same idea.

**@⁠BlackBu7let** on GitHub · 2026-11-25 19:08 UTC · [original](https://github.com/PastiiJay/klbf-lab/issues/36) Follow-up to klbf-lab-beta#2 (archived). @⁠PastiiJay asked how the app-local Agility SDK 614 loads on Windows 10; cc @⁠jeemailtrevor22-cmy. It is a build change, not an exe patch or a launcher. Two parts: 1) The exe exports the two symbols. I append this to apps/victory/src/main.rs (Windows only): ```rust #[cfg(target_os = "windows")] #[unsafe(no_mangle)] pub static D3D12SDKVersion: u32 = 614; #[cfg(target_os = "windows")] #[repr(transparent)] pub struct AgilitySdkPath(*const u8); // SAFETY: the exported pointer refers to immutable static bytes. #[cfg(target_os = "windows")] unsafe impl Sync for AgilitySdkPath {} #[cfg(target_os = "windows")] #[unsafe(no_mangle)] pub static D3D12SDKPath: AgilitySdkPath = AgilitySdkPath(c".\\D3D12\\".as_ptr().cast()); ``` 2) The symbols have to end up in the exe's export table, so I link with explicit export flags: ``` cargo rustc --profile diag -p victory --features diagnostics -- -C link-arg=/EXPORT:D3D12SDKVersion,DATA -C link-arg=/EXPORT:D3D12SDKPath,DATA ``` Then a D3D12 folder next to victory.exe with D3D12Core.dll and d3d12SDKLayers.dll from Agility SDK 1.614.0 (1.614.0.0.20240513.5 here). Caveat: the builds start and run this way (Lab 33 and Lab 35), but I have not confirmed from the log that the folder's D3D12Core.dll is the one that gets loaded. I did not find a log line that says so. I also saw that win10-test has "Agility SDK path exported as pointer, as d3d12.dll reads it" (4973c9e), which looks like the same idea.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:53:12 +00:00
Author
Owner

@⁠PastiiJay on GitHub · 2026-11-25 19:09 UTC · original

Thanks a lot @⁠BlackBu7let, this is great, and it's the same approach as ours: our win10-test branch exports D3D12SDKVersion = 614 and a pointer D3D12SDKPath = ".\D3D12\\" with /EXPORT:…,DATA link args in a build script, so a plain cargo build --release produces the right exe. You were running Agility 614 on Windows 10 with us since yesterday, so you'll be credited for it in the README when this reaches the stable build. cc @⁠jeemailtrevor22-cmy: the win10-test branch should now work for you out of the box. The steps are in issue #11.

**@⁠PastiiJay** on GitHub · 2026-11-25 19:09 UTC · [original](https://github.com/PastiiJay/klbf-lab/issues/36#issuecomment-7171906302) Thanks a lot @⁠BlackBu7let, this is great, and it's the same approach as ours: our `win10-test` branch exports `D3D12SDKVersion = 614` and a pointer `D3D12SDKPath = ".\D3D12\\"` with `/EXPORT:…,DATA` link args in a build script, so a plain `cargo build --release` produces the right exe. You were running Agility 614 on Windows 10 with us since yesterday, so you'll be credited for it in the README when this reaches the stable build. cc @⁠jeemailtrevor22-cmy: the `win10-test` branch should now work for you out of the box. The steps are in issue #11.
Author
Owner

@⁠BlackBu7let on GitHub · 2026-11-25 19:11 UTC · original

Thanks @⁠PastiiJay, good to hear it is the same approach. For anyone who needs the same thing in a different VIctory fork or build (the KLBF win10-test branch already does it, see #11): here is the procedure above as a prompt you can paste into an AI coding assistant (Claude Code, Codex, Cursor, ...) opened in your checked-out source folder.

Info:

  • It only changes apps/victory/src/main.rs, builds, and puts two DLLs in a D3D12 folder next to victory.exe. It is written so the assistant asks before any download or deletion.
  • I have used these exports and link flags in my own builds on Windows 10 (RX 6900 XT). I have not confirmed from the log that the folder's D3D12Core.dll is the one that gets loaded, so the prompt asks the assistant to check this and not to claim it.
  • The package path in step 4 (build/native/bin/x64 in Microsoft.Direct3D.D3D12 1.614.0) is from the package layout as I know it, not checked by me here. Use only Microsoft's official NuGet package.
  • If your build uses another profile or features, keep them and only add the two link-arg flags.
I build a VIctory fork (Rust, Windows 10/11, AMD Radeon) and want the app-local D3D12 Agility SDK 1.614.0 to be loaded by victory.exe. Putting a D3D12 folder next to the exe is not enough: the exe itself must export D3D12SDKVersion and D3D12SDKPath. Please do this in my checked-out source tree. Ask me before any step that deletes files or downloads anything, and do not touch anything outside this repository folder and one new "D3D12" output folder.

1) Open apps/victory/src/main.rs. If it does not already contain "D3D12SDKVersion", append this at the end of the file:

#[cfg(target_os = "windows")]
#[unsafe(no_mangle)]
pub static D3D12SDKVersion: u32 = 614;

#[cfg(target_os = "windows")]
#[repr(transparent)]
pub struct AgilitySdkPath(*const u8);

// SAFETY: the exported pointer refers to immutable static bytes.
#[cfg(target_os = "windows")]
unsafe impl Sync for AgilitySdkPath {}

#[cfg(target_os = "windows")]
#[unsafe(no_mangle)]
pub static D3D12SDKPath: AgilitySdkPath = AgilitySdkPath(c".\\D3D12\\".as_ptr().cast());

2) Build with explicit export flags, so the symbols reach the exe's export table (a plain cargo build may drop them):

cargo rustc --profile diag -p victory --features diagnostics -- -C link-arg=/EXPORT:D3D12SDKVersion,DATA -C link-arg=/EXPORT:D3D12SDKPath,DATA

(If I use a different profile or feature set, keep my usual ones and only add the two link-arg flags after the "--".)

3) Check that the built victory.exe really exports both names. Use "dumpbin /exports victory.exe" if Visual Studio's tools are installed, otherwise a short PowerShell or Python (pefile) check that lists the export table. Show me the result.

4) Make a folder named "D3D12" next to the built victory.exe. Put D3D12Core.dll and d3d12SDKLayers.dll of Agility SDK 1.614.0 into it. Get them only from Microsoft's official NuGet package Microsoft.Direct3D.D3D12 version 1.614.0 (the files are under build/native/bin/x64 in the package). Tell me before you download. The DLL version must match 614.

5) Start victory.exe as usual with my usual arguments and tell me what to look for in the log. If the log has no line that shows which D3D12Core.dll was loaded, say so honestly and suggest a way to check (for example Process Explorer or "tasklist /m D3D12Core.dll" while the game runs).

Report each step briefly. Do not claim that the Agility SDK is active unless step 3 and step 5 show it.
**@⁠BlackBu7let** on GitHub · 2026-11-25 19:11 UTC · [original](https://github.com/PastiiJay/klbf-lab/issues/36#issuecomment-7171950464) Thanks @⁠PastiiJay, good to hear it is the same approach. For anyone who needs the same thing in a different VIctory fork or build (the KLBF win10-test branch already does it, see #11): here is the procedure above as a prompt you can paste into an AI coding assistant (Claude Code, Codex, Cursor, ...) opened in your checked-out source folder. Info: - It only changes apps/victory/src/main.rs, builds, and puts two DLLs in a D3D12 folder next to victory.exe. It is written so the assistant asks before any download or deletion. - I have used these exports and link flags in my own builds on Windows 10 (RX 6900 XT). I have not confirmed from the log that the folder's D3D12Core.dll is the one that gets loaded, so the prompt asks the assistant to check this and not to claim it. - The package path in step 4 (build/native/bin/x64 in Microsoft.Direct3D.D3D12 1.614.0) is from the package layout as I know it, not checked by me here. Use only Microsoft's official NuGet package. - If your build uses another profile or features, keep them and only add the two link-arg flags. ``` I build a VIctory fork (Rust, Windows 10/11, AMD Radeon) and want the app-local D3D12 Agility SDK 1.614.0 to be loaded by victory.exe. Putting a D3D12 folder next to the exe is not enough: the exe itself must export D3D12SDKVersion and D3D12SDKPath. Please do this in my checked-out source tree. Ask me before any step that deletes files or downloads anything, and do not touch anything outside this repository folder and one new "D3D12" output folder. 1) Open apps/victory/src/main.rs. If it does not already contain "D3D12SDKVersion", append this at the end of the file: #[cfg(target_os = "windows")] #[unsafe(no_mangle)] pub static D3D12SDKVersion: u32 = 614; #[cfg(target_os = "windows")] #[repr(transparent)] pub struct AgilitySdkPath(*const u8); // SAFETY: the exported pointer refers to immutable static bytes. #[cfg(target_os = "windows")] unsafe impl Sync for AgilitySdkPath {} #[cfg(target_os = "windows")] #[unsafe(no_mangle)] pub static D3D12SDKPath: AgilitySdkPath = AgilitySdkPath(c".\\D3D12\\".as_ptr().cast()); 2) Build with explicit export flags, so the symbols reach the exe's export table (a plain cargo build may drop them): cargo rustc --profile diag -p victory --features diagnostics -- -C link-arg=/EXPORT:D3D12SDKVersion,DATA -C link-arg=/EXPORT:D3D12SDKPath,DATA (If I use a different profile or feature set, keep my usual ones and only add the two link-arg flags after the "--".) 3) Check that the built victory.exe really exports both names. Use "dumpbin /exports victory.exe" if Visual Studio's tools are installed, otherwise a short PowerShell or Python (pefile) check that lists the export table. Show me the result. 4) Make a folder named "D3D12" next to the built victory.exe. Put D3D12Core.dll and d3d12SDKLayers.dll of Agility SDK 1.614.0 into it. Get them only from Microsoft's official NuGet package Microsoft.Direct3D.D3D12 version 1.614.0 (the files are under build/native/bin/x64 in the package). Tell me before you download. The DLL version must match 614. 5) Start victory.exe as usual with my usual arguments and tell me what to look for in the log. If the log has no line that shows which D3D12Core.dll was loaded, say so honestly and suggest a way to check (for example Process Explorer or "tasklist /m D3D12Core.dll" while the game runs). Report each step briefly. Do not claim that the Agility SDK is active unless step 3 and step 5 show it. ```
Author
Owner

@⁠PastiiJay on GitHub · 2026-11-25 19:19 UTC · original

Thanks a lot @⁠BlackBu7let, that's very generous! A ready-to-paste prompt will help a lot of Windows 10 players on other forks too.

**@⁠PastiiJay** on GitHub · 2026-11-25 19:19 UTC · [original](https://github.com/PastiiJay/klbf-lab/issues/36#issuecomment-7172144668) Thanks a lot @⁠BlackBu7let, that's very generous! A ready-to-paste prompt will help a lot of Windows 10 players on other forks too.
Author
Owner

@⁠HandshakeHackin on GitHub · 2026-11-26 03:09 UTC · original · edited 2026-11-26 03:15 UTC

For the open question about which D3D12Core.dll actually loaded, this works with an existing build. While victory.exe is running and the D3D12 device is ready, use 64-bit PowerShell under the same Windows account:

Get-Process -Name victory -ErrorAction Stop | ForEach-Object {
    $app = $_
    $localCore = Join-Path (Split-Path -LiteralPath $app.Path) 'D3D12\D3D12Core.dll'
    $systemCore = Join-Path ([Environment]::SystemDirectory) 'D3D12Core.dll'
    $app.Modules | Where-Object ModuleName -eq 'D3D12Core.dll' | ForEach-Object {
        $source = if ($_.FileName -ieq $localCore) { 'app-local' }
                  elseif ($_.FileName -ieq $systemCore) { 'Windows system' }
                  else { 'other location' }
        [pscustomobject]@{ PID=$app.Id; Source=$source; Version=$_.FileVersionInfo.FileVersion }
    }
}

An app-local row confirms the DLL from that executable’s D3D12 folder is mapped in that process. No row means no matching module was observed at that point. The output omits personal paths.

I checked this method on hosted Windows with two small WARP programs. Both had zero matching modules before device creation. After creation both showed the Windows system core, version 10.0.26100.33648, including the program that exported SDK 614 and had the verified 1.614.1 DLL beside it in D3D12. That’s a useful control for interpreting the result on your Windows 10 machine. Native verification

I also checked the app-local result on the same hosted Windows setup. After device creation, a probe exporting SDK 620 loaded 1.620.2.0.20261106.5 from its own D3D12 folder, while its baseline loaded the Windows system core. This was a separate diagnostic probe. Positive-control run

**@⁠HandshakeHackin** on GitHub · 2026-11-26 03:09 UTC · [original](https://github.com/PastiiJay/klbf-lab/issues/36#issuecomment-7181441278) · edited 2026-11-26 03:15 UTC For the open question about which `D3D12Core.dll` actually loaded, this works with an existing build. While `victory.exe` is running and the D3D12 device is ready, use 64-bit PowerShell under the same Windows account: ```powershell Get-Process -Name victory -ErrorAction Stop | ForEach-Object { $app = $_ $localCore = Join-Path (Split-Path -LiteralPath $app.Path) 'D3D12\D3D12Core.dll' $systemCore = Join-Path ([Environment]::SystemDirectory) 'D3D12Core.dll' $app.Modules | Where-Object ModuleName -eq 'D3D12Core.dll' | ForEach-Object { $source = if ($_.FileName -ieq $localCore) { 'app-local' } elseif ($_.FileName -ieq $systemCore) { 'Windows system' } else { 'other location' } [pscustomobject]@{ PID=$app.Id; Source=$source; Version=$_.FileVersionInfo.FileVersion } } } ``` An `app-local` row confirms the DLL from that executable’s `D3D12` folder is mapped in that process. No row means no matching module was observed at that point. The output omits personal paths. I checked this method on hosted Windows with two small WARP programs. Both had zero matching modules before device creation. After creation both showed the Windows system core, version `10.0.26100.33648`, including the program that exported SDK 614 and had the verified 1.614.1 DLL beside it in `D3D12`. That’s a useful control for interpreting the result on your Windows 10 machine. [Native verification](https://github.com/HandshakeHackin/klbf-lab/actions/runs/45746735919/job/139664501999) I also checked the `app-local` result on the same hosted Windows setup. After device creation, a probe exporting SDK 620 loaded `1.620.2.0.20261106.5` from its own `D3D12` folder, while its baseline loaded the Windows system core. This was a separate diagnostic probe. [Positive-control run](https://github.com/HandshakeHackin/klbf-lab/actions/runs/45747261190/job/139666221514)
Author
Owner

@⁠PastiiJay on GitHub · 2026-11-26 10:42 UTC · original

Thanks, that module check has already been useful in #11. Keeping this one open for the Windows 10 notes.

**@⁠PastiiJay** on GitHub · 2026-11-26 10:42 UTC · [original](https://github.com/PastiiJay/klbf-lab/issues/36#issuecomment-7189723763) Thanks, that module check has already been useful in #11. Keeping this one open for the Windows 10 notes.
This discussion has been locked. Commenting is limited to contributors.
No description provided.