Backport gfx1154 support into ZLUDA's Windows LLVM compiler

Adapt official LLVM 7a0829e41228 to the pinned LLVM 22 parser and ELF structures. Apply and audit the complete source delta before building, export its provenance, and package the source patch. Add 33 offline public PTX compilation checks across all eleven GPU targets without hardware execution. Preserve strict arithmetic and document RX9070XT K/M regressions.
This commit is contained in:
xdfnx-dev committed 2026-10-02 17:45:41 +03:00
1 parent b6b6d91ed9
commit 3d5f42865f
10 files changed
+307 -2

No files matched your search

+2 -1
View File
@@ -128,4 +128,5 @@ uses a previous-frame fallback.
OptiScaler source modifications are GPL-3.0 and exported under
`source-patches/optiscaler`. ZLUDA source modifications are exported under
`source-patches/zluda`. Dependency license texts and build hashes are included.
`source-patches/zluda`; the LLVM gfx1154 backport is under
`source-patches/zluda-llvm`. Dependency license texts and build hashes are included.
+23
View File
@@ -99,6 +99,29 @@ 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.
Rebuild LLVM/ZLUDA when updating from an older package: the old LLVM 22 backend
does not recognize gfx1154 even though Clang 24 compiles native objects for it.
`build-zluda-llvm.ps1` now applies the source backport in `patches/zluda-llvm`
automatically; relink with `build-zluda-windows.ps1` afterward. Compiler base
and patch hashes are recorded in the ZLUDA build metadata and included in game
packages. The expected patched LLVM submodule appears modified in its parent
checkout; its complete source delta is exported, not a binary target override.
For a compilation gate requiring neither a GPU nor NVIDIA DLLs, run:
```powershell
.\scripts\windows\test-zluda-target-compilation.ps1 -ZludaRoot "$PWD\dist\zluda-windows-final"
```
All 33 public PTX compilations pass for the eleven targets: Driver API pattern,
FP16 MMA strict reference and explicit WMMA modes, with correct ELF targets
and wave32. The gfx12 strict F16 reference intentionally retains its existing
double-precision helper; the separate WMMA mode checks code generation only.
It does not enable relaxed arithmetic in game packages or validate numerical
results on other GPUs. The original gfx1154 compiler abort is preserved locally
in `build/llvm-gfx1154/before.log`; the regression results are in
`test-results/windows-gpu-coverage/zluda-offline`.
## Fork adaptation
Reviewed [realdody's branch](https://github.com/realdody/d4r/tree/windows-rdna3)
+20 -1
View File
@@ -52,6 +52,22 @@ Results: `test-results/windows-gpu-coverage`; build logs and the compile-only
matrix report: `build/windows-gpu-coverage`. No physical multi-GPU, APU or
other-target validation is claimed. K performance remains open.
The final translator gate exposed a separate dependency gap: pinned LLVM 22
rejects `gfx1154` and aborts (`0xC0000409`) on a public PTX pattern. A minimal
source backport of official LLVM `7a0829e41228` adds the processor's real
11.5.4 features, parser and ELF identity. It is exported under
`patches/zluda-llvm`, applied idempotently by the LLVM builder and included with
its base/hash in package metadata. LLVM and ZLUDA are rebuilt; all 33 offline
pattern/F16-reference/WMMA compilations pass across the eleven targets without
GPU execution. The existing strict gfx12 F16 reference lowering remains intact.
The rebuilt ZLUDA passes 20/20 RX 9070 XT CTest gates. Its twelve further K
4K burst/recreation frames are finite and all six async RGB images are exact;
three sync RGB images also exactly match the previous compiler's captures.
Four further M 4K frames are finite and match all four previous-compiler RGB
images exactly. Both require native transformer hits, zero CPU frame copies
and frame age 0. Results: `k-new-zluda`, `m-new-zluda` and compiler comparison
logs under `test-results/windows-gpu-coverage`. Other GPUs remain unverified.
**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
@@ -1219,7 +1235,10 @@ Pinned additional build dependencies:
rust-std and rust-mingw archives and installs only under `.tools`.
* ZLUDA LLVM submodule `ff4dc1f7c9e1c64d4d69e40f4ed30c2280a96dfd`,
`llvm-config` reports `22.0.0git`. AMDGPU/LLVM/LLD are built with LLVM-MinGW
`20260922`; no Linux build host or runtime is used.
`20260922`; no Linux build host or runtime is used. The Windows builder adds
`patches/zluda-llvm/0001-backport-gfx1154.patch`, adapted from official LLVM
`7a0829e41228513299c5108685b0bc127463c6a1`. Rebuild and relink ZLUDA when
updating; native Clang 24 target support alone does not cover translated PTX.
* HiGHS submodule `364c83a51e44ba6c27def9c8fc1a49b1daf5ad5c`.
* The LLVM IR helper producer is stable HIP 7.2/LLVM 21. The final target is
selected by the translator from HIP `gfx1201`; generic helper generation