# CUDA for AMD on Windows

> A scripted Windows setup that runs unmodified CUDA applications on AMD GPUs through ZLUDA and the HIP SDK

- Category: Models & Inference / GPU Kernels & Compilers
- Language: PowerShell
- Licence: MIT
- Repository: https://github.com/Speedstu/CUDA-for-AMD-Windows
- Canonical page: https://ai-tldr.dev/tools/cuda-for-amd-windows/
- Updated: 2026-09-13

## In short

CUDA for AMD on Windows is a scripted Windows setup that runs unmodified CUDA applications on AMD GPUs through ZLUDA and the HIP SDK. The application binary is not recompiled, patched or aware of the substitution — it keeps calling CUDA, and the AMD card answers. It sits in the GPU Kernels & Compilers category of the Models & Inference tools and is open-source, written in PowerShell and licensed MIT.

## Overview

CUDA for AMD on Windows is a set of PowerShell scripts that assemble a working ZLUDA-on-ROCm runtime on a Windows machine with an AMD GPU. ZLUDA is a translation layer: it intercepts the CUDA driver calls an application makes and forwards them to AMD's HIP/ROCm stack instead. The application binary is not recompiled, patched or aware of the substitution — it keeps calling CUDA, and the AMD card answers.

The value of the project is not the translation layer itself, which already existed, but the reproducibility around it. Getting ZLUDA, a specific AMD driver, the Windows HIP SDK, the ROCm math libraries and a CUDA-built LibTorch to agree on versions is the part that normally fails. The repository pins the pieces in a manifest, downloads them, checks hashes and then runs a test suite, so the result either works or tells you which library is missing.

Scope is stated narrowly and honestly. Only the Radeon RX 9060 XT (gfx1200) has been validated; every other AMD GPU is described as a candidate rather than a supported device, and the author asks for compatibility reports. Coverage is per workload rather than blanket CUDA compatibility: the CUDA driver API, cuBLAS, cuBLASLt, cuSPARSE and cuFFT resolve through their ROCm equivalents, while cuDNN has no counterpart in the stable Windows HIP SDK, and NCCL, TensorRT and custom CUDA extensions are out of scope.

## What it does

- Runs CUDA-targeted Windows binaries unmodified by routing the CUDA driver API through ZLUDA to AMD HIP/ROCm
- install.ps1 detects the GPU architecture, verifies the driver and libraries, downloads a pinned ZLUDA build and LibTorch, validates checksums and runs compatibility tests
- Maps cuBLAS to rocBLAS, cuBLASLt to hipBLASLt and cuSPARSE to rocSPARSE, with cuFFT also confirmed working
- Diagnostic scripts: gpu-scan.ps1 reads the AMD architecture via hipInfo.exe, doctor.ps1 checks for required libraries, test-runtime.ps1 runs the compatibility suite
- stage-runtime.ps1 places compatibility libraries beside an executable and run-zluda.ps1 launches it through zluda.exe with HIP on PATH
- Version pinning in manifests/: ZLUDA v6-preview.69 against Windows HIP SDK 6.4, with hashes and GPU architecture metadata
- Validated on a real workload — a 2.2M-parameter PPO reinforcement-learning network trained end to end, 65,536 timesteps per iteration

## Getting started

You need a Windows machine with a current AMD GPU driver and the AMD HIP SDK for Windows installed, including HIP Libraries. Version 6.4 of the HIP SDK is the validated reference. The installer downloads LibTorch, which is a 2.66 GB fetch.

1. Clone the repository

   The scripts, manifests and docs all live in the repo; nothing is installed globally.

```powershell
git clone https://github.com/Speedstu/CUDA-for-AMD-Windows.git
cd CUDA-for-AMD-Windows
```

2. Run the installer

   install.ps1 detects your GPU architecture, verifies the driver and libraries, downloads ZLUDA and LibTorch, validates checksums and runs the compatibility tests.

```powershell
powershell -ExecutionPolicy Bypass -File .\scripts\install.ps1
```

3. Check what your GPU exposes

   gpu-scan.ps1 reads the AMD architecture through hipInfo.exe, and doctor.ps1 reports which required libraries are present or missing.

```powershell
.\scripts\gpu-scan.ps1
.\scripts\doctor.ps1
```

4. Launch a CUDA application on the AMD GPU

   run-zluda.ps1 starts the program through zluda.exe with the HIP libraries on PATH. The program itself is unchanged.

```powershell
.\scripts\run-zluda.ps1 -Program C:\path\to\app.exe
```

## When to use it

- Running a CUDA-only Windows tool on a Radeon card instead of buying an NVIDIA GPU for it
- Training or running small PyTorch/LibTorch workloads on AMD hardware under Windows rather than dual-booting Linux for ROCm
- Checking, before committing to hardware, which CUDA libraries a given AMD GPU and HIP SDK combination can actually resolve
- Reading a worked, pinned example of how ZLUDA, the HIP SDK and ROCm math libraries fit together on Windows

## Version history

- 2026-09-13: First public release of the scripted ZLUDA + ROCm setup. The author validated it on a Radeon RX 9060 XT (gfx1200) by training a 2.2M-parameter PPO network through CUDA-built LibTorch, and documented which CUDA libraries resolve and which do not.
