Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RCOM - ROCm PyTorch for gfx1030 on Windows

A UV-managed Python project for running PyTorch with AMD ROCm on Windows, specifically optimized for RX 6800/6900 (gfx1030) GPUs.

✅ Tested & Working on Windows

GPU Nightly Env Official Env
RX 6800 ✅ Working ❌ Not detected
RX 6800 XT ✅ Should work ❌ Not detected
RX 6900 XT ✅ Should work ❌ Not detected
RX 6600/6600 XT ✅ Should work ❌ Not detected

Recommendation for RX 6000 series: Use the Nightly environment. The official AMD wheels do not detect gfx1030 GPUs on Windows.

Quick Start

# 1. Setup nightly environment (recommended for RX 6800/6900)
.\scripts\setup-nightly.bat

# 2. Test GPU detection
.\scripts\run-test.bat nightly

# 3. Activate and use
.\activate.bat
python -c "import torch; print(torch.cuda.get_device_name(0))"
# Output: AMD Radeon RX 6800

Table of Contents


Overview

This project provides two PyTorch environments for AMD GPUs on Windows:

Environment ROCm Version PyTorch Version Target GPUs Windows Status
Nightly 7.12 2.10.0 gfx103x (RX 6800/6900/6600) Working
Official 7.2 2.9.1 gfx1100/gfx1101 (RX 7000) ⚠️ RX 6000 not detected

Why Two Environments?

AMD's official PyTorch wheels for Windows only support RDNA3 (RX 7000) and RDNA4 (RX 9000) GPUs. The RX 6000 series (RDNA2, gfx1030) is supported by the HIP SDK but NOT by the official PyTorch wheels.

This project offers two approaches:

  1. Nightly gfx103xRECOMMENDED: Uses AMD's semi-official nightly builds specifically compiled for gfx103x GPUs. Tested and working on RX 6800.

  2. Official + HSA Override ❌: Uses the official wheels with HSA_OVERRIDE_GFX_VERSION=10.3.0. Does not work on RX 6800 - GPU not detected.


Supported GPUs

Official Environment (ROCm 7.2)

GPU Architecture Support
RX 7900 XTX gfx1100 ✅ Official
RX 7900 XT gfx1100 ✅ Official
RX 7800 XT gfx1101 ✅ Official
RX 7700 XT gfx1101 ✅ Official
RX 9070 / 9070 XT gfx1200/1201 ✅ Official
RX 6800 / 6800 XT gfx1030 ⚠️ Requires HSA override
RX 6900 XT gfx1030 ⚠️ Requires HSA override

Nightly Environment (ROCm 7.12)

GPU Architecture Support
RX 6800 / 6800 XT gfx1030
RX 6900 XT gfx1030
RX 6800M gfx1031
RX 6600 / 6600 XT gfx1032
RX 6600M gfx1032

Prerequisites

Required Software

  1. UV Package Manager (will auto-install Python 3.12)

    pip install uv
    # OR
    pipx install uv
    • UV automatically downloads and manages Python 3.12
    • No manual Python installation needed!
  2. AMD HIP SDK

  3. AMD Graphics Driver

Optional Software


Quick Start

# 1. Setup the nightly environment (WORKS for RX 6800)
.\scripts\setup-nightly.bat

# 2. Test GPU detection
.\scripts\run-test.bat nightly

# 3. Activate and use
.\activate.bat
python -c "import torch; print(torch.cuda.get_device_name(0))"
# Output: AMD Radeon RX 6800

Installation

Option A: Nightly Environment ✅ WORKS for RX 6000 Series

.\scripts\setup-nightly.bat

This will:

  1. Create .venv-nightly with Python 3.12 (UV auto-downloads if needed)
  2. Install ROCm 7.12 SDK for gfx103x
  3. Install PyTorch 2.10.0 built specifically for gfx103x
  4. Install triton-windows and other dependencies

Tested on: RX 6800 - ✅ GPU detected and working

Option B: Official Environment ❌ Does NOT Work for RX 6000

.\scripts\setup-official.bat

Status: ❌ GPU not detected on RX 6800 even with HSA_OVERRIDE_GFX_VERSION

The official AMD wheels (ROCm 7.2) only support gfx1100/gfx1101 (RX 7000 series) and gfx120x (RX 9000 series) on Windows. RX 6000 series users should use the nightly environment.


Testing

Test Nightly Environment (Recommended)

.\scripts\run-test.bat nightly

Expected Output (RX 6800)

============================================================
  RCOM GPU Detection Test
============================================================

--- System Information ---

  OS: Windows 11
  Python: 3.12.9
  Architecture: AMD64

--- GPU Detection ---

  CUDA Available: True
  ROCm/HIP Version: 7.2.0
  Device Count: 1
  Device Name: AMD Radeon RX 6800

  [SUCCESS] GPU detected!

--- Tensor Operations Test ---

  [OK] Success! Result shape: (1000, 1000), dtype: float32

--- Memory Test ---

  [OK] Total GPU Memory: 16368 MB

============================================================
  All Tests Passed!
============================================================

Project Structure

RCOM/
├── pyproject.toml              # UV project configuration
├── .python-version             # Python version pin (3.12)
├── README.md                   # This file
├── activate.bat                # Quick activation script
├── quick-start.bat             # Setup both environments
│
├── envs/
│   ├── official/
│   │   └── requirements.txt    # Official ROCm 7.2 wheel URLs
│   └── nightly/
│       └── requirements.txt    # Nightly gfx103x wheel URLs
│
├── scripts/
│   ├── setup-official.bat      # Setup official environment
│   ├── setup-nightly.bat       # Setup nightly environment
│   ├── run-test.bat            # Test runner for both envs
│   └── test-gpu.py             # GPU detection test script
│
├── .venv-official/             # Official environment (created by setup)
└── .venv-nightly/              # Nightly environment (created by setup)

Environment Variables

HSA_OVERRIDE_GFX_VERSION

Overrides GPU architecture detection. Required for RX 6000 series with official wheels.

GPU Series Value Architecture
RX 6800/6800 XT/6900 XT 10.3.0 gfx1030
RX 6600/6600 XT 10.3.2 gfx1032
RX 7900 XTX/XT 11.0.0 gfx1100
RX 7800 XT 11.0.1 gfx1101
RX 7700 XT 11.0.1 gfx1101

Setting in CMD

set HSA_OVERRIDE_GFX_VERSION=10.3.0
python your_script.py

Setting in PowerShell

$env:HSA_OVERRIDE_GFX_VERSION = "10.3.0"
python your_script.py

Other Useful Variables

# ROCm debug logging
set MIOPEN_LOG_LEVEL=5
set MIOPEN_FIND_MODE=5

# Triton cache directory
set TRITON_CACHE_DIR=C:\path\to\cache

References

Official Documentation

Community Resources

Wheel Sources


Contributing

  1. Test on your AMD GPU
  2. Report issues with GPU model, driver version, and error messages
  3. Submit PRs for improvements

About

Run AMD ROCm on Windows with gfx1030 GPUs for ML/AI workloads

Resources

Stars

3 stars

Watchers

0 watching

Forks

Contributors

Languages