Skip to content

Windows 11 + AMD Radeon RX 9070 XT (gfx1201) + ROCm 7.14 + PyTorch + Voicebox #918

Description

@raveformovie

AMD ROCm 7.14 + PyTorch + Qwen-TTS + Voicebox — Windows 11 Installation Guide

Tested on: Windows 11 + RX 9070 XT (gfx1201)

This guide includes the pitfalls we actually hit during setup — not just the happy path.


Part 1 — Clean System Preparation

Step 1. Install the latest AMD Adrenalin driver

Download the latest WHQL/Recommended driver from AMD.

After installation, confirm in:

Device Manager → Display adapters → AMD Radeon RX 9070 XT is visible.

Step 2. Remove any old HIP SDK

If previously installed, go to:

Control Panel → Programs → Uninstall a program

Remove:

  • HIP SDK
  • Old ROCm SDK
  • Any obsolete AMD AI SDK

Reboot.

Step 3. Disable conflicting Windows security features

Disable Windows Defender Application Guard:

Turn Windows features on/off → uncheck Microsoft Defender Application Guard

Disable Smart App Control:

Settings → Privacy & Security → Windows Security → App & Browser control → Smart App Control → Off

Reboot.


Part 2 — Python

Install Python 3.12.x (64-bit).

Verify:

python --version

Part 3 — Create a Virtual Environment

py -3.12 -m venv venv
venv\Scripts\activate
python -m pip install --upgrade pip

Part 4 — Install ROCm

Exactly as AMD recommends:

python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ "rocm[libraries,device-gfx1201]==7.14.0"

Verify:

pip freeze

Should include:

rocm==7.14.0
rocm-sdk-core
rocm-sdk-device-gfx1201
rocm-sdk-libraries

Part 5 — Install PyTorch

Install AMD's architecture-specific packages:

python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ ^
"torch[device-gfx1201]==2.12.0+rocm7.14.0" ^
"torchvision[device-gfx1201]==0.27.0+rocm7.14.0" ^
"torchaudio==2.11.0+rocm7.14.0"

This additionally installs:

  • amd-torch-device-gfx1201
  • amd-torch-device-gfx12-0
  • amd-torchvision-device-gfx1201

These packages proved essential in our testing.


Part 6 — Verify ROCm

hipinfo

Should report:

AMD Radeon RX 9070 XT
gfx1201

Also check:

python -c "import torch; print(torch.cuda.is_available())"

Expected: True


Part 7 — Verify Device Detection

python -c "import torch; print(torch.cuda.device_count()); print(torch.cuda.get_device_name(0))"
  • If you have only one GPU, this should show AMD Radeon RX 9070 XT.
  • If you have multiple GPUs, continue to Part 8.

Part 8 — Multi-GPU Systems (IMPORTANT)

Many Ryzen systems expose:

  • Device 0AMD Radeon(TM) Graphics (iGPU)
  • Device 1AMD Radeon RX 9070 XT (dGPU)

Without intervention, PyTorch may choose the iGPU.

Create backend/.env with only this content:

HIP_VISIBLE_DEVICES=1

⚠️ Do NOT add HSA_OVERRIDE_GFX_VERSION unless ROCm fails to detect gfx1201.

⚠️ Do NOT keep AMD_SERIALIZE_KERNEL set except while actively debugging.


Part 9 — Load .env Before Torch Initializes

Install:

pip install python-dotenv

In backend/main.py, immediately after:

from dotenv import load_dotenv

add:

load_dotenv(
    Path(__file__).with_name(".env"),
    override=True
)

This must occur before from .app import app — otherwise Torch may initialize before the environment variables are loaded.


Part 10 — Verify Environment Is Actually Loaded

Temporarily add:

print(os.getenv("HIP_VISIBLE_DEVICES"))

Expected output: 1

Then remove the debug print once confirmed.


Part 11 — Minimal GPU Test

python -c "import os; os.environ['HIP_VISIBLE_DEVICES']='1'; import torch; print(torch.cuda.get_device_name(0))"

Expected: AMD Radeon RX 9070 XT

Kernel test:

python -c "import os; os.environ['HIP_VISIBLE_DEVICES']='1'; import torch; print(torch.randn(2,2,device='cuda'))"

Should execute without crashing.


Part 12 — Voicebox Test

just dev

Generate speech in the app.

Expected:

  • GPU usage: 20–40%
  • CPU usage: 20–40%
  • VRAM increases during generation

Common Errors

hipErrorInvalidImage

Usually indicates: wrong PyTorch wheel, or missing amd-torch-device packages.
Solution: reinstall the architecture-specific PyTorch packages (Part 5).

"Device kernel image invalid" on torch.randn(...)

Usually indicates: wrong architecture wheel installed.

Torch detects the iGPU (AMD Radeon(TM) Graphics) instead of the dGPU

Solution: set HIP_VISIBLE_DEVICES=1 (Part 8). Only add HSA_OVERRIDE_GFX_VERSION if ROCm still fails to detect gfx1201 afterward.

AMD_SERIALIZE_KERNEL

Debug-only. Do not leave this enabled in normal use.


Final Working Configuration (Validated)

Component Version
OS Windows 11 Pro (24H2)
Python 3.12.x
GPU AMD Radeon RX 9070 XT (gfx1201)
ROCm 7.14.0
PyTorch 2.12.0+rocm7.14.0

Installed AMD packages:

rocm
rocm-sdk-core
rocm-sdk-device-gfx1201
rocm-sdk-libraries
amd-torch-device-gfx1201
amd-torch-device-gfx12-0
amd-torchvision-device-gfx1201

Voicebox-specific:

  • python-dotenv installed
  • .env loaded via:
    load_dotenv(Path(__file__).with_name(".env"), override=True)
    before importing the application

.env contents:

HIP_VISIBLE_DEVICES=1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions