Windows 上的 AMD CUDA
CUDA for AMD on Windows

原始链接: https://github.com/Speedstu/CUDA-for-AMD-Windows

本仓库提供了一个可重现的运行环境,旨在通过 **ZLUDA** 和 **AMD HIP/ROCm SDK** 在 AMD GPU 上运行针对 CUDA 开发的 Windows 应用程序。 **主要特性:** * **性能验证:** 目前已针对 **AMD Radeon RX 9060 XT (gfx1200)** 进行优化和验证,可成功运行 LibTorch 训练负载及各类 CUDA 数学库(cuBLAS, cuSPARSE, cuFFT)。 * **简化部署:** 包含自动化的 PowerShell 脚本,用于安装依赖项、验证硬件、下载指定的 ZLUDA/LibTorch 版本并启动应用程序。 * **兼容性:** 使用上游 ZLUDA v6-preview.69 和稳定的 HIP SDK 6.4。尽管目前不支持 cuDNN,但该技术栈可有效处理密集型/GEMM 加速的训练任务。 **重要提示:** * **硬件:** 仅官方验证了 RX 9060 XT。其他 AMD GPU 被视为未经测试的候选设备;建议用户运行仓库中提供的 `gpu-scan.ps1` 并反馈测试结果。 * **局限性:** ZLUDA 并非完整的 CUDA 实现。对负载的支持取决于具体的 CUDA API 使用情况;NCCL、TensorRT 以及某些 PTX 指令等功能可能会失效。 如需安装,请克隆本仓库并运行 `install.ps1`。详细的文档、基准测试及故障排除指南包含在源代码中。

这场 Hacker News 讨论聚焦于 GitHub 用户 `speedstu` 的一个项目。该项目利用 ZLUDA 和 ROCm/HIP,使得基于 CUDA 的应用程序能够在 Windows 上的 AMD GPU 上运行。 该帖讨论了几个核心议题: * **“CUDA 护城河”**:许多用户认为,英伟达的领先地位不仅在于硬件,更在于其成熟稳健的软件生态。相比之下,Vulkan、SYCL 和 OpenCL 等替代方案因开发门槛高、开发体验差以及缺乏行业范围内的硬件协同而受到诟病。 * **标准的挑战**:评论者指出,为多样的 GPU 架构创建通用的高性能标准极其困难。由于现代 AI 工作负载需要针对特定硬件进行内核调优,许多专家认为“一刀切”的开放标准目前还只是幻想。 * **兼容性的未来**:虽然有人期待未来通过转换层(如 ZLUDA)使 CUDA 代码能够脱离硬件限制,但也有人持怀疑态度,认为调试和优化 GPU 计算的复杂性过高。 * **市场背景**:讨论还涉及了 AMD 在 AI 市场拓展方面的困境。许多观点指出,AMD 历史上由于缺乏持续且“全情投入”的软件支持,从而将市场领导地位拱手让给了英伟达。
相关文章

原文

WORKING REPRODUCIBLE STACK IS NOW UPLOADED.

Run CUDA-targeted Windows applications on AMD GPUs through ZLUDA + ROCm/HIP.

Windows AMD verify

A reproducible Windows CUDA compatibility setup built around ZLUDA + AMD HIP/ROCm. It is intended for CUDA-facing compute applications, including workloads that use CUDA-enabled LibTorch.

Important

Validated hardware is currently AMD Radeon RX 9060 XT (gfx1200) only. Other AMD GPUs are candidates, not guaranteed working devices. If you test another card, please open a GPU compatibility report, whether it works or fails.

The public, upstream-only path has been tested without any private/recovered DLLs:

  • ZLUDA v6-preview.69 from the official ZLUDA release
  • AMD HIP SDK 6.4
  • LibTorch 2.3.0 + cu118
  • RX 9060 XT / gfx1200
  • nvcuda, cuBLAS, cuBLASLt, cuSPARSE and cuFFT all pass cuda_check
  • a real 2,216,347-parameter PPO network completed forward/inference, PPO learning and optimizer work on the CUDA-facing device
  • one clean validation iteration completed 65,536 timesteps using the runtime produced by this repository

That integration test used the same CUDA-facing LibTorch training workload that originally motivated this project. See docs/VALIDATION.md.

This does not mean every CUDA program or AI model works. CUDA API/library coverage is workload-dependent.

CUDA-targeted Windows application
              |
            ZLUDA
              |
 cuBLAS / cuSPARSE / cuFFT compatibility
              |
 rocBLAS / hipBLASLt / rocSPARSE / HIP
              |
           AMD GPU

1. Install the AMD prerequisites

Install a current AMD GPU driver and the AMD HIP SDK for Windows including HIP Libraries.

The validated reference uses HIP SDK 6.4. Newer versions may work but should be treated as unverified until reported.

AMD Windows HIP SDK guide: https://rocm.docs.amd.com/projects/install-on-windows/en/docs-6.4.2/index.html

2. Clone and run the installer

git clone https://github.com/Speedstu/CUDA-for-AMD-Windows.git
cd CUDA-for-AMD-Windows
powershell -ExecutionPolicy Bypass -File .\scripts\install.ps1

install.ps1 will:

  1. detect the AMD GPU and native gfxXXXX target;
  2. verify the AMD driver/HIP SDK and required math libraries;
  3. download the pinned official ZLUDA Windows build;
  4. download LibTorch 2.3.0+cu118 (about 2.66 GB);
  5. verify the downloaded SHA-256 hashes;
  6. generate .runtime\runtime-config.json and .runtime\gpu-report.json;
  7. run ZLUDA's cuda_check.exe against the installed AMD stack.

If you do not need LibTorch:

.\scripts\install.ps1 -SkipLibTorch

Run a CUDA-targeted application

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

The launcher stages the required ZLUDA compatibility DLLs beside the target application and sets the HIP/ROCm runtime paths for that run.

You can also stage without launching:

.\scripts\stage-runtime.ps1 -TargetDir C:\path\to\your-app
.\scripts\doctor.ps1
.\scripts\gpu-scan.ps1
.\scripts\test-runtime.ps1

The GPU scanner records the model, gfx architecture, driver and HIP information. It does not intentionally collect usernames, tokens or user files.

Example on the validated machine:

AMD Radeon RX 9060 XT -> gfx1200 -> RDNA4 -> validated-reference
GPU Target Project status
Radeon RX 9060 XT gfx1200 ✅ validated reference

The scanner recognizes other Windows HIP architecture families and marks them as unverified candidates rather than claiming support. Detection is not proof that a workload runs.

AMD's current Windows hardware table: https://rocm.docs.amd.com/projects/install-on-windows/en/latest/reference/system-requirements.html

Runtime coverage on the validated setup

Current upstream runtime check:

CUDA-facing component Result
CUDA driver / nvcuda ✅
cuBLAS ✅ via rocBLAS
cuBLASLt ✅ via hipBLASLt
cuSPARSE ✅ via rocSPARSE
cuFFT ✅
cuDNN ⚠️ unavailable with the validated stable Windows HIP SDK

The stable Windows HIP SDK does not ship the full ROCm AI-library stack such as MIOpen, so convolution-heavy software that requires cuDNN can need a newer/nightly HIP stack or additional work. Dense/GEMM-heavy LibTorch training does not necessarily require cuDNN; the validated PPO workload completed without it.

A controlled 2026-09-13 A/B ran 10 iterations per runtime on the same RX 9060 XT PPO workload. After discarding the first iteration of each trial as warmup, the public upstream path reached 13,278 median overall SPS versus 12,876 for the recovered custom overlay. In this workload the custom overlay was about 3.03% slower, so upstream remains the default.

Historical tuned runs used a different training configuration and reached roughly 70k–109k overall steps/s. See docs/BENCHMARKS.md for methodology and raw data.

Optional historical custom overlay

The original development environment also experimented with a custom cuBLAS/cuBLASLt/HIP overlay. It is not required for the validated public path and, based on the controlled A/B above, is not currently a performance win for the reference PPO workload.

The recovered DLLs remain fingerprinted in manifests/recovered-artifacts.sha256. They are not published as binary blobs because the original custom wrapper source/provenance is incomplete and the recovered HIP runtime contains third-party AMD binaries. See docs/CUSTOM_OVERLAY.md.

Found a bug or tested another GPU?

Please publish an issue. Failed tests are useful too.

.\scripts\gpu-scan.ps1 -OutputPath .\gpu-report.json
.\scripts\test-runtime.ps1

Then open a GPU compatibility report and include the application, result and first useful error/output.

scripts/              install, diagnostics, scanner, staging and launcher
manifests/            pinned versions, hashes and GPU architecture metadata
docs/                 validation, architecture, benchmarks and troubleshooting
examples/             integration/reference snippets
.runtime/             generated dependencies and reports; ignored by Git
local-artifacts/      local archival files; ignored by Git
  • Only RX 9060 XT / gfx1200 is currently validated by this project.
  • ZLUDA is not a complete CUDA implementation.
  • Windows exposes only a subset of the full ROCm ecosystem.
  • cuDNN/MIOpen is not available in the validated stable HIP SDK path.
  • NCCL, TensorRT, unsupported PTX behavior and some custom CUDA extensions may fail.
  • ZLUDA_CC=8.6 is a CUDA-facing compatibility value, not the AMD GPU architecture.

License and third-party software

Project-owned scripts and documentation are MIT licensed. ZLUDA, AMD ROCm/HIP, NVIDIA CUDA components and PyTorch/LibTorch retain their own upstream licenses. See THIRD_PARTY_NOTICES.md.

联系我们 contact @ memedata.com