CUDA for AMD on Windows – Running CUDA Windows Apps on AMD GPUs via ZLUDA and ROCm/HIP
TL;DR
CUDA‑for‑AMD‑Windows enables CUDA‑targeted Windows programs to execute on AMD GPUs by translating CUDA calls through ZLUDA and the ROCm/HIP stack; the reference implementation is verified on a Radeon RX 9060 XT (gfx1200) and supports core libraries such as cuBLAS, cuBLASLt, cuSPARSE and cuFFT.
What the project delivers
- A reproducible Windows environment that chains ZLUDA → ROCm/HIP to satisfy CUDA driver and library calls.
- Automated installer (
install.ps1) that detects the AMD GPU, validates driver/HIP SDK versions, pulls the official ZLUDA Windows build, and optionally downloads LibTorch 2.3.0+cu118. - Runtime‑check scripts (
cuda_check.exe,doctor.ps1,gpu‑scan.ps1) that confirm library coverage and report GPU details. - A documented validation workflow showing a full PPO training run (2,216,347‑parameter network) completing 65,536 timesteps on the AMD GPU.
Validated hardware and software stack
| Component | Version / Detail |
|---|---|
| AMD GPU | Radeon RX 9060 XT (gfx1200, RDNA4) – only officially validated |
| AMD HIP SDK | 6.4 (Windows) |
| ZLUDA | v6‑preview.69 (official release) |
| LibTorch | 2.3.0 + cu118 (≈2.66 GB) |
| CUDA libraries | nvcuda, cuBLAS, cuBLASLt, cuSPARSE, cuFFT – all pass cuda_check |
| cuDNN | Unavailable in the stable Windows HIP SDK |
The repository explicitly marks other AMD GPUs as unverified candidates; users are encouraged to file a GPU‑compatibility issue regardless of success or failure.
How the translation layer works
CUDA‑targeted Windows app
│
ZLUDA (PTX/JIT → HIP)
│
cuBLAS / cuSPARSE / cuFFT
│
rocBLAS / hipBLASLt / rocSPARSE
│
AMD GPU
ZLUDA intercepts CUDA driver calls, JIT‑compiles PTX to HIP, and forwards the work to the corresponding ROCm libraries.
Installation steps (Windows)
- Install AMD prerequisites – latest AMD GPU driver and the AMD HIP SDK for Windows (HIP libraries included). The reference uses HIP SDK 6.4; newer releases may work but are unverified.
- Clone the repo and run the installer:
The installer detects the GPU, verifies driver/HIP versions, downloads ZLUDA and LibTorch, checks SHA‑256 hashes, generates runtime configuration files, and runsgit clone https://github.com/Speedstu/CUDA-for-AMD-Windows.git cd CUDA-for-AMD-Windows powershell -ExecutionPolicy Bypass -File .\scripts\install.ps1cuda_check.exe. - Optional – skip the large LibTorch download with
-SkipLibTorchif only the translation layer is needed.
Running a CUDA‑targeted program
# Launch and stage required DLLs automatically
.
scripts\run-zluda.ps1 -Program C:\path\to\app.exe
# Or stage the runtime without launching
.
scripts\stage-runtime.ps1 -TargetDir C:\path\to\your-app
The scripts place ZLUDA compatibility DLLs next to the executable and set the HIP/ROCm runtime paths for that session only.
Diagnosing the environment
.
scripts\doctor.ps1
.
scripts\gpu-scan.ps1
.
scripts\test-runtime.ps1
gpu-scan.ps1 outputs a JSON report containing the GPU model, gfx architecture, driver version, and HIP SDK details, e.g.:
AMD Radeon RX 9060 XT -> gfx1200 -> RDNA4 -> validated-reference
Runtime coverage on the validated setup
| CUDA‑facing component | Status |
|---|---|
CUDA driver (nvcuda) |
✅ |
| cuBLAS | ✅ (via rocBLAS) |
| cuBLASLt | ✅ (via hipBLASLt) |
| cuSPARSE | ✅ (via rocSPARSE) |
| cuFFT | ✅ |
| cuDNN | ⚠️ unavailable (stable HIP SDK lacks MIOpen) |
The absence of cuDNN means convolution‑heavy workloads may require a newer/nightly HIP stack or custom overlays.
Performance snapshot
A controlled A/B benchmark (2026‑09‑13) on the reference PPO workload measured:
- Median overall steps‑per‑second (SPS): 13,278 for the upstream ZLUDA path vs. 12,876 for a historical custom overlay.
- Relative slowdown: The custom overlay was ~3 % slower, so the upstream path is the default recommendation.
Older tuned runs (different training configuration) reported 70k–109k SPS, documented in docs/BENCHMARKS.md.
Optional historical custom overlay
The repository contains a historical custom cuBLAS/cuBLASLt/HIP overlay that is not required for the validated path. Its recovered DLL hashes are stored in manifests/recovered-artifacts.sha256. The overlay is provided for reference only; the upstream ZLUDA build outperforms it on the PPO benchmark.
Reporting compatibility or bugs
- Run the diagnostic scripts (
gpu‑scan.ps1,test-runtime.ps1). - Open a GPU compatibility report issue using the provided template and attach the JSON output and any error logs.
The project maintainers encourage both successful and failed reports to expand the compatibility matrix.
Repository layout (high‑level)
scripts/ # install, diagnostics, staging, launcher
manifests/ # pinned versions, hashes, GPU metadata
docs/ # validation, benchmarks, troubleshooting
examples/ # reference integration snippets
.runtime/ # generated dependencies and reports (git‑ignored)
local-artifacts/ # archival files (git‑ignored)
Limitations to be aware of
- GPU support: Only the RX 9060 XT (
gfx1200) is officially validated. - CUDA completeness: ZLUDA does not implement the full CUDA API; unsupported features include CDNA‑specific extensions, NCCL, TensorRT, and many custom PTX instructions.
- Windows ROCm ecosystem: The stable Windows HIP SDK lacks the full AI stack (e.g., MIOpen/cuDNN), limiting convolution‑heavy models.
- Compatibility value:
ZLUDA_CC=8.6reflects the CUDA compatibility target, not the AMD GPU architecture.
Licensing
Project scripts and documentation are MIT‑licensed. ZLUDA, AMD ROCm/HIP, NVIDIA CUDA components, and PyTorch/LibTorch retain their upstream licenses. See THIRD_PARTY_NOTICES.md for details.
Community reaction (Hacker News highlights)
- Open‑standard advocacy: Some commenters argue that efforts like this underscore the need for open APIs such as HIP, SYCL, or OpenCL, noting the dominance of closed‑source NVIDIA stacks in LLM inference.
- Hardware scope questions: Users ask whether the setup works on other GPUs (e.g., Radeon 7900 XT) and on non‑AI workloads like MATLAB.
- Strategic implications: A few remarks suggest that if CUDA‑to‑HIP translation becomes trivial, CUDA’s moat erodes, turning it into an intermediate representation rather than a lock‑in.
- Practical caveats: Others point out the lack of cuDNN and the reliance on an older Windows ROCm version (7.1/7.2) compared to the current upstream releases.
These discussions highlight both enthusiasm for cross‑vendor compatibility and realistic expectations about current limitations.
Sources
Related
- Dispatch
- Dispatch
- Dispatch
- Project
- Project