Build native Windows packages for both RDNA4 targets
Add explicit gfx1200/gfx1201 builds, runtime selection and per-target code objects. Guard staging, packaging and installation against mixed architectures; retain gfx1201 compatibility and strict K/M arithmetic. Adapt realdody's target configuration and MSVC binary16/BOOL portability fixes from ae530b0. Do not import its forced gfx12 layout on RDNA3. Add exhaustive binary16 and C++/PowerShell target contract regressions. Validation: 20 CTest gates on RX 9070 XT; four software-only gfx1200 gates; MSVC portability compile checks; exact 4K K async and M control outputs; isolated package install/restore and mixed-target rejection tests. No physical gfx1200 validation is claimed. Co-authored-by: realdody <[email protected]>
This commit is contained in:
1 parent
8f7058d2ba
commit
98de8e3a3e
51 files changed
+636
-127
No files matched your search
@@ -8,6 +8,14 @@ The user reports 49-51 FPS for K in the measured scene after the command-hook
|
||||
fix and locally built output-store optimization. This is a local
|
||||
development package; no NVIDIA proprietary DLL is included.
|
||||
|
||||
Builds also accept gfx1200 (for example RX 9060/9060 XT). This target is
|
||||
**compile-tested only**; no physical gfx1200 validation has been performed.
|
||||
RX 9070 and other gfx1201 cards also remain untested. Use a package built for
|
||||
the GPU's actual HIP architecture: its `gpu-target.json`, host shim and ELF
|
||||
code objects must agree. Installation/runtime reject mixed targets. See
|
||||
[windows-gpu-support.md](windows-gpu-support.md) for separate-target build
|
||||
commands, the fork review and the first hardware diagnostic gate.
|
||||
|
||||
Build the shim/diagnostics, corrected ZLUDA, K/M native objects and patched
|
||||
OptiScaler using the scripts in `scripts/windows`, then run:
|
||||
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
# Windows GPU targets
|
||||
|
||||
The native Windows build accepts **gfx1200** and **gfx1201**. It builds a
|
||||
separate shim, diagnostics and code objects for each target. The default stays
|
||||
gfx1201. GPU selection uses HIP's real `gcnArchName`, followed by D3D12/HIP
|
||||
adapter LUID matching; it does not depend on a marketing name or overridden
|
||||
DXGI vendor ID.
|
||||
|
||||
| Target | Examples in LLVM's processor table | This project's validation |
|
||||
| --- | --- | --- |
|
||||
| gfx1201 | RX 9070, RX 9070 XT | RX 9070 XT: hardware, K/M and game tests. Other cards untested. |
|
||||
| gfx1200 | RX 9060, RX 9060 XT | Host/device compilation and software tests only. No physical gfx1200 available. |
|
||||
|
||||
Sources: [LLVM AMDGPU processors](https://llvm.org/docs/AMDGPUUsage.html#processors)
|
||||
and [AMD's Windows compatibility matrix](https://rocm.docs.amd.com/projects/radeon-ryzen/en/latest/docs/compatibility/compatibilityrad/windows/windows_compatibility.html).
|
||||
AMD's matrix is dependency information, not evidence that d4r's K/M or external
|
||||
memory path works on an untested card. Other RDNA4 SKUs are eligible only when
|
||||
HIP reports one of these exact targets and exposes the required Windows APIs.
|
||||
Device-specific drivers, performance and memory capacity still need testing.
|
||||
gfx1250/gfx1251 are a separate ISA group and are not enabled by this change.
|
||||
|
||||
Do not rename a gfx1201 package to gfx1200. `gpu-target.json`, the compiled
|
||||
host target and each ELF code-object target must agree. Runtime selection
|
||||
rejects another architecture before launching kernels. Staging, packaging and
|
||||
installation inspect the documented AMDGPU ELF machine ID and reject mixed
|
||||
objects. They never rewrite a binary target or set `HSA_OVERRIDE_GFX_VERSION`.
|
||||
Legacy packages without target metadata remain gfx1201 only.
|
||||
|
||||
## Build and package
|
||||
|
||||
Prepare the pinned dependencies as described in `windows-rdna4-port.md`.
|
||||
Select a target explicitly; this example creates the experimental gfx1200
|
||||
package. Use gfx1201 for a 9070/9070 XT. Keep separate output directories when
|
||||
building both targets.
|
||||
|
||||
```powershell
|
||||
$arch = 'gfx1200'
|
||||
$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"
|
||||
```
|
||||
|
||||
ZLUDA, HIP and OptiScaler must already be built/prepared. The package contains
|
||||
the strict K FP16 and M FP16-equivalent baseline; native FP8 stays disabled.
|
||||
The architecture does not change arithmetic or the existing WMMA layout.
|
||||
Private NVIDIA-derived texture overrides remain optional local experiments;
|
||||
their builder accepts `-GpuArch`, and their validation must match the target
|
||||
package before installation. Existing gfx1201 performance measurements are
|
||||
not measurements of gfx1200.
|
||||
The separate experimental FP8/F16 arithmetic and tuning recipes remain
|
||||
gfx1201-specific; this change enables the conservative production baseline
|
||||
on both build targets.
|
||||
|
||||
Equivalent CMake selection is `-DD4R_GPU_ARCH=gfx1200`. Unknown targets fail
|
||||
configuration. Some diagnostic executable names and source filenames retain
|
||||
`gfx1201` for compatibility; the logged architecture and compiled code objects
|
||||
use the selected target.
|
||||
|
||||
## First hardware gate on another card
|
||||
|
||||
From the repository root, with the matching diagnostic package above and the
|
||||
pinned dependencies, run this single command:
|
||||
|
||||
```powershell
|
||||
.\scripts\windows\test-windows-rdna4.ps1 -RuntimeProfile therock -PackageRoot "$PWD\dist\windows-gfx1200-diagnostics" -ZludaRoot "$PWD\dist\zluda-windows-final"
|
||||
```
|
||||
|
||||
Success requires exit 0, all selected tests passed in `summary.json`, the
|
||||
correct actual GPU/target in stdout, exact HIP/PTX/WMMA/pixel-format checks and
|
||||
stable interop lifetime. On failure, retain the single printed diagnostic ZIP;
|
||||
it includes stdout/stderr, exit code, runtime/driver inventory and DLL identity.
|
||||
No NVIDIA DLL is required for this first gate. Full K/M reference, temporal,
|
||||
standalone DLSS and game validation are subsequent gates on that hardware;
|
||||
passing the first gate alone does not close them.
|
||||
|
||||
Without that GPU, run `ctest --test-dir build/windows-gfx1200 -L software
|
||||
--output-on-failure`. These CPU/WARP checks do not execute gfx1200 kernels.
|
||||
|
||||
## Fork review
|
||||
|
||||
Reviewed [realdody's windows-rdna3 branch](https://github.com/realdody/d4r/tree/windows-rdna3)
|
||||
at `ae530b0f53ed5c0bb87558dd7c20f619e014e4fd`, on 2026-10-02. Adapted:
|
||||
|
||||
- Per-target build configuration and actual-target diagnostics, narrowed here
|
||||
to the two documented RDNA4 subtargets, with package/ELF guards added.
|
||||
- MSVC binary16 conversion in the synthetic CUDA MMA reference. An exhaustive
|
||||
CPU test covers 63,490 finite/infinity encodings and 31,743 rounding
|
||||
boundaries; LLVM also checks it against native `_Float16` conversion.
|
||||
- `WINBOOL` to `BOOL` normalization in generated D3D12 hooks, so the generated
|
||||
header works with the Microsoft SDK as well as MinGW headers.
|
||||
|
||||
The fork's RDNA3 implementation forces `D4R_WMMA_LAYOUT=12` for gfx11. That
|
||||
kernel-layout change, the raw gfx11 probe and the expanded gfx11 runtime
|
||||
allowlist are not imported. Its reported RX 7800 XT/K result has not been
|
||||
independently reproduced here; its M/translated-path limitations still require
|
||||
separate checks. This change does not advertise native Windows RDNA3 readiness.
|
||||
The existing upstream Linux/RDNA3 implementation is unchanged. Credit for
|
||||
the adapted portability fixes: realdody <dodobozicek@gmail.com>.
|
||||
|
||||
## Local results, 2026-10-02
|
||||
|
||||
- Both targets: complete MinGW host build and 19 device code objects using
|
||||
TheRock `10.2.0a20260929`, HIP `7.17.26386`, Clang 24. The runtime, driver,
|
||||
patched ZLUDA and OptiScaler versions are unchanged from the validated port.
|
||||
- gfx1201/RX 9070 XT: 20/20 CTest gates, including 16 physical-GPU gates.
|
||||
- gfx1200: 4/4 software gates; no gfx1200 kernel execution.
|
||||
- MSVC v143 `14.44.35207`: binary16 CPU test passes; CUDA MMA probe and D3D12
|
||||
hook translation units compile. This is not a complete MSVC build claim.
|
||||
- K: 12 finite 4K frames at 2259x1271 input, burst and feature recreation;
|
||||
all six async RGB images exactly match their synchronous controls.
|
||||
- M: eight finite 4K control/candidate frames at the same input dimensions;
|
||||
all four new-build RGB images exactly match the prior validated build.
|
||||
Both presets log every required native layer, zero CPU image copies and
|
||||
current-frame output.
|
||||
- Original gfx1201 objects remain byte-identical on disk. In fresh builds,
|
||||
`.text` and `.rodata*` match the prior gfx1201 objects for all 19 kernels;
|
||||
fresh ELF files have different overall hashes. gfx1200 and gfx1201 have
|
||||
distinct correct ELF targets. Matching instruction sections are compile
|
||||
evidence, not a substitute for testing gfx1200 hardware.
|
||||
- A gfx1200 HIP probe on the physical gfx1201 fails cleanly with exit 4 before
|
||||
any GPU allocation/kernel execution. This tests refusal, not gfx1200 support.
|
||||
- Both target packages pass install/restore checks in isolated workspace
|
||||
fixtures; no game is launched. Only manifest-listed runtime files install.
|
||||
Packaging rejects a mismatched destination or native kernel directory before
|
||||
writing files. Every packaged code object has the expected ELF target.
|
||||
|
||||
Logs are local in `test-results/rdna4-targets-*` and
|
||||
`test-results/rdna4-target-objects.json`; they contain no public NVIDIA DLLs.
|
||||
@@ -1,6 +1,7 @@
|
||||
# Windows / RDNA4 port
|
||||
|
||||
Branch: `windows-rdna4`. Target: Windows 11 x64, RX 9070 XT, **gfx1201**.
|
||||
Branch: `windows-rdna4`. Native Windows build targets: **gfx1200 / gfx1201**.
|
||||
Validated physical hardware: Windows 11 x64, RX 9070 XT, **gfx1201**.
|
||||
Priority: correct K, correct M, native Windows, same-frame output, then speed.
|
||||
Upstream integration: [PR #11](https://github.com/countervolts/d4r/pull/11)
|
||||
is merged into `countervolts/d4r:windows` at `c522101`.
|
||||
@@ -17,6 +18,16 @@ explicit limits; the validated package keeps conservative arithmetic.
|
||||
|
||||
## Milestone and gates
|
||||
|
||||
2026-10-02 target coverage: gfx1200 and gfx1201 now have separate host/device
|
||||
builds and guarded packages. Both compile; gfx1201 passes 20 CTest gates on
|
||||
RX 9070 XT, and gfx1200 passes four software-only gates. No physical gfx1200
|
||||
test is available. K's new host build passes twelve finite 4K burst/recreation
|
||||
frames with all six async RGB images exact. M's four new-build 4K RGB images
|
||||
exactly match the previous build. The fork audit, adopted MSVC fixes,
|
||||
per-target commands, validation limits and first hardware gate are maintained
|
||||
in [windows-gpu-support.md](windows-gpu-support.md). RDNA3 runtime/layout changes
|
||||
from the reviewed fork are not imported. K performance remains open.
|
||||
|
||||
**Current milestone: K performance remains open.** The latest unprofiled 4K
|
||||
Silent Hill 2 scene capture records 65.250 FPS. Functional K/M and the
|
||||
reproducible archive do not close this gate. Prioritize measured K kernel cost
|
||||
@@ -1496,7 +1507,8 @@ automatically on CUDA failure when `trace/nvcuda.dll` is available. The trace
|
||||
DLL forwards to the real DLL through `ZLUDA_CUDA_LIB`; explicit loading no
|
||||
longer bypasses the trace by accidentally passing the real DLL to the launcher.
|
||||
|
||||
The HIP module compiler uses the selected SDK, fixed `--offload-arch=gfx1201`,
|
||||
The HIP module compiler uses the selected SDK, `--offload-arch=${D4R_GPU_ARCH}`
|
||||
(gfx1201 by default, optionally gfx1200),
|
||||
wave32 and no host/device library dependency. Host code uses the installed HIP
|
||||
header ABI and loads that SDK's `amdhip64_7.dll` by absolute path. CUDA loads the
|
||||
provided ZLUDA DLL by absolute path, matches the adapter against HIP PCI identity,
|
||||
|
||||
Reference in new issue
Block a user