CUDA-for-AMD-Windows README

The project's README from github.com/Speedstu/CUDA-for-AMD-Windows. As one markdown file: README.md.

CUDA for AMD on Windows

Windows AMD Radeon verify License: MIT

A reproducible Windows CUDA compatibility stack for AMD GPUs, built around ZLUDA + AMD ROCm/HIP.

Run CUDA-targeted Windows applications on AMD hardware, verify that work really reaches the GPU, and distinguish a correct result from a crash, timeout, CPU fallback, or silently wrong tensor.

[!IMPORTANT] This project is not a complete CUDA implementation. Support is capability- and workload-specific. The validated reference GPU is currently the Radeon RX 9060 XT (gfx1200).

Quick start

1. Install AMD prerequisites

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

The required HIP version depends on the GPU architecture. The project checks the architecture-specific floor recorded in manifests/windows-gpu-profiles.json.

2. Clone and install

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

The installer detects the GPU, verifies the HIP environment, downloads pinned assets, stages the runtime, runs a runtime smoke test, and performs numerical checks when a compatible Python/PyTorch environment is available.

3. Run a CUDA-targeted application

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

4. Validate the runtime

.\scripts\doctor.ps1
.\scripts\test-runtime.ps1
.\scripts\test-functional.ps1 -PythonExe C:\path\to\venv\Scripts\python.exe

The original low-level setup path is intentionally kept compatible for existing users and old posts:

.\scripts\setup.ps1 -DownloadZluda -DownloadLibTorch

See scripts/README.md for the stable user-facing commands and maintainer tooling.

Current compatibility

GPU Target Project status Notes
Radeon RX 9060 XT gfx1200 ✅ validated reference Main development and integration validation platform
Radeon RX 9070 XT gfx1201 ✅ validated external Separately tested Windows AMD/ZLUDA training setup
Radeon 890M gfx1150 🟡 community partial HIP/GEMM reported working; broader paths still under validation
Other recognized AMD GPUs architecture-dependent ⚪ unverified candidate Detection is not functional validation

Full details, version floors, evidence levels, known limitations, and the CUDA DLL → AMD backend map: docs/COMPATIBILITY.md.

What has been validated?

Stable public reference path

The public reference path uses pinned upstream components and has been tested with:

See docs/VALIDATION.md.

Experimental v7 path

The repository also maintains a pinned, source-based ZLUDA v7-preview.10 patch series for newer CUDA-facing behavior.

Validated work on the reference machine includes areas such as:

The patch set remains separate from the stable installer so experimental work cannot silently redefine the stable path.

See patches/zluda-v7-preview10/README.md.

Real application checks

This project deliberately tests more than tiny API calls.

PyTorch / LibTorch / PPO

The reference workload performs rollout, forward, backward, PPO learning, and optimizer work through the CUDA-facing device.

See docs/VALIDATION.md and docs/BENCHMARKS.md.

llama.cpp

A recent llama.cpp b10978 build has completed an end-to-end GPU smoke on the RX 9060 XT experimental v7 path:

This is evidence for that tested path, not a claim that every llama.cpp kernel or model is supported.

See docs/LLAMA_CPP.md.

Performance snapshot

Performance claims are kept same-GPU and reproducible where possible; this is not an AMD-vs-NVIDIA benchmark.

On the experimental v7/TheRock path, a clean four-pair FP32 SGEMM validation measured paired median overhead versus direct HIP/rocBLAS of +1.79% at 1024², +0.45% at 2048², and +2.20% at 4096². The corresponding throughput ratios were 98.2%, 99.6%, and 97.8%.

A real VelocityRL 512 agents × rollout 16 smoke separated first-use compilation from steady state: the warmed updates reached 72,306 SPS and 70,333 SPS, for 71,319.5 SPS median steady-state.

Methodology and raw results: docs/BENCHMARKS.md and benchmarks/.

Correctness first

A CUDA API returning success is not enough to call something supported.

The test suite distinguishes:

PASS · UNSUPPORTED · INCORRECT · TIMEOUT · ERROR · process failure

The project follows a fail-closed rule: an explicit unsupported result is better than a plausible-looking but incorrect tensor.

That policy already caught fused SDPA fallback paths that could return numerically wrong output instead of failing clearly.

For the evidence model and contribution rules, see CONTRIBUTING.md.

Project map

Area Purpose
scripts/ Installation, launch, diagnostics, tests, staging and maintainer helpers
manifests/ Pinned releases, hashes and GPU architecture metadata
patches/ Reproducible source patches against pinned upstream projects
native/ Small source-built native compatibility components
docs/ Architecture, validation, integrations, benchmarks and troubleshooting
examples/ Small integration/reference snippets
benchmarks/ Raw benchmark data checked into the repository
.github/ CI and structured GPU compatibility reports

Generated runtime files stay under .runtime/ and are ignored by Git.

Documentation

Start with docs/README.md instead of searching through the repository.

Historical reconstruction material is still preserved, but it is no longer part of the recommended path.

Found a bug or tested another GPU?

Both successful and failed reports are useful.

.\scripts\gpu-scan.ps1 -OutputPath .\gpu-report.json
.\scripts\test-runtime.ps1
.\scripts\test-functional.ps1 -PythonExe C:\path\to\venv\Scripts\python.exe

Then open a GPU compatibility report.

Please include the GPU model, gfxXXXX target, driver, HIP version, ZLUDA channel/build, exact workload, and proof that the AMD/ZLUDA device actually executed the work rather than falling back to CPU.

Known limitations

More detail: docs/COMPATIBILITY.md.

Contributing

The project is evidence-driven. New compatibility claims should include a focused reproducer, numerical validation where applicable, exact versions/hashes, and a real workload when possible.

Read CONTRIBUTING.md before changing support claims or promoting experimental patches.

License

Project-owned scripts and documentation are MIT licensed.

ZLUDA, AMD ROCm/HIP, NVIDIA CUDA components, PyTorch/LibTorch and other third-party projects retain their own licenses. See THIRD_PARTY_NOTICES.md.

CUDA-for-AMD-Windows (Speedstu/CUDA-for-AMD-Windows)

Searching Database…

Что это такое?Совместимость-стек для Windows, который запускает приложения, написанные под CUDA, на видеокартах AMD через ZLUDA плюс AMD ROCm/HIP, а также инструменты для проверки, что вычисления действительно идут на GPU, а не молча переключаются на CPU и не выдают неверные результаты.
Это драйвер, полноценная замена CUDA или что-то другое?Ни то, ни другое — это собранный вручную набор из зафиксированных сборок ZLUDA, настройки AMD HIP SDK, воспроизводимых патчей исходного кода и скриптов проверки. Это явно не полная реализация CUDA: поддержка заявляется только для тех задач, которые подтверждены тестами.
Как это настроить?Установите актуальный драйвер AMD и AMD HIP SDK для Windows, затем запустите установщик из репозитория: он определит вашу видеокарту, проверит окружение HIP, скачает зафиксированные компоненты, подготовит среду выполнения и прогонит дымовые тесты и проверку числовой корректности.
Что нужно перед установкой?Поддерживаемая видеокарта AMD, актуальный драйвер для Windows и AMD HIP SDK для Windows с HIP Libraries. Минимально необходимая версия HIP зависит от архитектуры вашей видеокарты и сверяется с манифестом в репозитории.
А моя конкретная видеокарта AMD вообще заработает?Проверены лишь несколько моделей: Radeon RX 9060 XT (gfx1200) — эталонная, RX 9070 XT подтверждена сторонними пользователями, а по Radeon 890M есть лишь частичные отзывы сообщества. Остальные видеокарты AMD — непроверенные кандидаты: само по себе определение устройства ещё не означает, что оно работает.
Это только для Windows или есть вариант и для Linux?Только Windows. Весь стек построен вокруг AMD HIP SDK для Windows и ZLUDA на Windows, а в README отмечается, что Windows раскрывает лишь часть всей экосистемы ROCm.
Это открытый код? Могу ли я свободно им пользоваться?Собственные скрипты и документация проекта — под лицензией MIT, но в стек входят сторонние компоненты — ZLUDA, ROCm/HIP, части NVIDIA CUDA, PyTorch/LibTorch, — у которых свои лицензии, поэтому у итоговой сборки лицензирование смешанное.
Какие реальные приложения уже проверили и запустили?PyTorch/LibTorch: реальная рабочая нагрузка PPO на 2,2 млн параметров прошла этапы rollout, forward, backward и шаги оптимизатора через устройство с интерфейсом CUDA. llama.cpp: сборка b10978 прошла сквозной дымовой тест на GPU по экспериментальному пути v7 на RX 9060 XT, все 6/6 слоёв, KV cache и вычислительные буферы размещались на GPU.
Насколько сильно это снижает производительность?Незначительно на экспериментальном пути v7: FP32 SGEMM показал медианную потерю от +0,45% до +2,20% по сравнению с прямым HIP/rocBLAS (97,8–99,6% от исходной пропускной способности). Все цифры замерялись на той же видеокарте; проект сознательно не публикует сравнений AMD с NVIDIA.
Что происходит, если какая-то возможность CUDA не поддерживается?Тогда честный отказ: результат помечается как PASS, UNSUPPORTED, INCORRECT, TIMEOUT или ERROR, и явный вердикт «не поддерживается» предпочтительнее, чем правдоподобный, но неверный тензор. Именно эта политика поймала слияния SDPA с фолбэком, которые возвращали численно неверный результат.
Работает ли cuDNN через этот стек?Не полностью: на стабильном пути Windows HIP нет полноценного аналога cuDNN/MIOpen. Экспериментальный мост v7 покрывает лишь узкое подмножество 2D-свёрток cuDNN v8 на gfx1200, а NCCL, TensorRT, пользовательские расширения CUDA и неподдерживаемый PTX могут не заработать.
Creator
Speedstu
Size
0.5 MB
Stars
321
Updated
CommitOct 17
Age
1mo
Commits · 90 Days