Files
d4r/docs/windows-gpu-support.md
T
xdfnx-devandrealdody 3fa963fd1b Enable experimental native Windows RDNA3 and RDNA4 targets
Share explicit target metadata across build/runtime/package guards, preserve native gfx11 WMMA with a Windows LDS lane exchange, select HIP devices by D3D12 LUID, and reject wrong-target/vkd3d installations before changing game files. Review all issue #10 logs and document compile-only coverage plus RX9070XT regressions.

Co-authored-by: realdody <[email protected]>
2026-10-02 17:10:42 +03:00

7.8 KiB

Experimental Windows RDNA3 / RDNA4 coverage

The shim, diagnostics, native K/M kernels and game installer accept the targets below, with one package per actual ISA. Only RX 9070 XT has physical validation here. All other targets are experimental and compile-tested; working DLSS, interop and performance on them remain unverified.

Family Target Examples / scope
RDNA3 gfx1100 RX 7900 family; same-target workstation GPUs
RDNA3 gfx1101 RX 7700 / 7700 XT / 7800 XT; same-target mobile/workstation GPUs
RDNA3 gfx1102 RX 7600 / 7600 XT; same-target mobile/workstation GPUs
RDNA3 gfx1103 RDNA3 integrated graphics
RDNA3.5 gfx1150, gfx1151, gfx1152, gfx1153, gfx1154 Corresponding integrated graphics targets
RDNA4 gfx1200 RX 9060 / 9060 XT; same-target GPUs
RDNA4 gfx1201 RX 9070 / 9070 XT / 9070 GRE; same-target GPUs

Names and IDs follow LLVM processors and ELF ABI. tools/windows/gpu-targets.json supplies CMake-generated C++, PowerShell and the private texture builder. Selection uses HIP's real gcnArchName and the D3D12 adapter LUID, including systems with several GPUs sharing a target. Marketing names do not control eligibility.

All listed RDNA3/RDNA3.5/RDNA4 targets with existing gfx11/gfx12 WMMA contracts are included. TBD RDNA4m gfx1170..gfx1172 and gfx12.5 gfx1250/gfx1251 are different ISA groups and excluded. Unknown future targets need explicit review. Check AMD's Windows matrix for driver/runtime eligibility. Compiler support cannot supply missing Windows driver support or external-memory APIs, especially on APUs.

Installation and diagnostics

Use the actual target's archive: gfx1200 for RX 9060 XT, for example. Metadata, host target and every ELF target must agree. Runtime/scripts reject mixed targets and never rename targets, rewrite ELF IDs or set HSA_OVERRIDE_GFX_VERSION. Legacy metadata-free packages remain gfx1201 only.

Before changing game files, windows-game.ps1 now runs a read-only HIP inventory and checks the target and wave32. Inventory allocates no GPU buffers and runs no kernels; success is discovery, not validation. Failure prints one ZIP containing stdout/stderr, exit code, runtime/DLL and driver details. A local d3d12.dll identifying itself as vkd3d/Wine is rejected before install. Restore the game's native D3D12 installation; the script never loads or removes that proxy itself. Begin synchronously on an untested GPU:

.\windows-game.ps1 -GameExe "D:\Games\Example\Game.exe" -NgxCore "C:\LocalDLLs\_nvngx.dll" -DlssDll "C:\LocalDLLs\nvngx_dlss.dll" -Preset 11 -ValidateOutput -CaptureExceptions

The local DLLs must match the documented NGX version and DLSS 310.9.1 SHA256 in package.json. NVIDIA DLLs are never distributed. Retain the printed ZIP on failure. Async K and performance are subsequent gates; gfx1201-specific FP8, arithmetic and tuning experiments remain separate.

Issue #10 review, 2026-10-02

Reviewed comment 5952822115, including all 32 attached text logs from eight attempts. HIP discovers RX 9060 XT / gfx1200 successfully. Every attempt fails with the old shim's "No selected gfx1201 device" rejection; OptiScaler reports support=false / BAD00002. None reaches D4R_RUNTIME initialization or native transformer execution. These logs do not demonstrate a K/M kernel crash. Use the gfx1200 package instead of overriding architecture. Three attempts also load vkd3d-proton 3.1.0 from a local D3D12 proxy, outside this Windows backend.

The new packages/preflight address the identified failures. They do not prove those games work on RX 9060 XT; a new native-D3D12 run on that GPU is required. Raw community logs and personal directory paths stay local.

Build

Prepare dependencies following windows-rdna4-port.md. Default: gfx1201. Select another target explicitly and keep separate directories:

$arch = 'gfx1101'  # for example RX 7800 XT
$diag = "$PWD\dist\windows-$arch-diagnostics"
.\scripts\windows\build-windows-rdna4.ps1 -RuntimeProfile therock -GpuArch $arch -ZludaRoot "$PWD\dist\zluda-windows-final" -BuildDirectory "$PWD\build\windows-$arch" -InstallDirectory $diag
.\scripts\windows\stage-native-k.ps1 -DlssDll "$PWD\nvngx_dlss.dll" -PackageRoot $diag
.\scripts\windows\stage-native-m.ps1 -DlssDll "$PWD\nvngx_dlss.dll" -PackageRoot $diag
.\scripts\windows\package-windows-game.ps1 -DiagnosticRoot $diag -GpuArch $arch -PackageRoot "$PWD\dist\windows-$arch-game" -ArchivePath "$PWD\dist\windows-$arch-game.zip"

Rebuild diagnostics for the new inventory executable. The package keeps strict K FP16 and M FP16-equivalent baselines; native M FP8 remains disabled. CMake: -DD4R_GPU_ARCH=gfx1101. Some source/executable names retain gfx1201/gfx12 for compatibility; actual targets follow the selected architecture.

One command compiles all eleven targets without GPU workloads:

.\scripts\windows\build-windows-gpu-matrix.ps1 -ZludaRoot "$PWD\dist\zluda-windows-final"

Add -PackageGames -DlssDll "$PWD\nvngx_dlss.dll" -ArchiveDirectory "$PWD\dist\windows-gpu-archives" to stage/archive all packages after committing source and preparing OptiScaler. Use -GpuArchitectures gfx1100,gfx1101,gfx1102,gfx1200,gfx1201 for a subset. Per-target logs and matrix-build.json distinguish compilation from execution. The supplied DLL generates manifests locally and is never copied into archives.

Fork adaptation

Reviewed realdody's branch at ae530b0f53ed5c0bb87558dd7c20f619e014e4fd and the newer 1897b4a correction. Earlier MSVC binary16 and generated BOOL fixes remain. The earlier forced gfx12 fragment layout is not used.

The newer fork reports Windows gfx1101 permlanex16 returning its own lane, duplicating even K values into odd slots. This port adapts that finding into kernels/common/wave32_exchange.h: a Windows/gfx11-only per-wave LDS exchange, with native gfx11 layout, generic x/y/z indexing, 2 KiB scratch (512 threads maximum), volatile accesses and wave fences/barriers protecting scratch reuse. It covers K/M fragment conversions and other K half-wave exchanges. gfx12 and Linux keep the original instruction path. The raw gfx11 probe uses its actual intrinsic/layout, without a forced gfx12 shim.

The fork reports RX 7800 XT enc1/enc2 identity/nonzero/reference checks. Those are the author's results, not validation of this adaptation or full K/M here. LDS exchange, full network, translated CUDA, accuracy, interop and speed still need physical gfx11 testing. Credit: realdody [email protected].

Results and next hardware gate

All eleven targets compile the complete MinGW host build and 19 device objects with TheRock 10.2.0a20260929, HIP 7.17.26386, Clang 24. Software target contracts inspect actual ELF objects without other-target GPU launches. RX 9070 XT passes all 20 CTest gates after these changes. K/M full-frame and package checks are recorded in windows-rdna4-port.md. Local logs are in build/windows-gpu-coverage and test-results/windows-gpu-coverage.

The first hardware gate on another GPU needs no NVIDIA DLL:

.\scripts\windows\test-windows-rdna4.ps1 -RuntimeProfile therock -PackageRoot "$PWD\dist\windows-gfx1101-diagnostics" -ZludaRoot "$PWD\dist\zluda-windows-final"

Success requires exit 0, correct actual target, exact HIP/PTX/WMMA/pixel checks and stable interop lifetime. Failure prints one ZIP. Full K/M reference, temporal, DLSS and game validation remain subsequent gates.