Model setup recipes
Last updated
Install PyTorch ROCm on AMD Radeon and verify GPU operation
Verify step by step that PyTorch uses a ROCm GPU on Radeon
PyTorch1 takes image or text data, performs training or inference2 computations on a GPU3, and returns result tensors or model output. ROCm4 builds on Radeon also retain the torch.cuda5 device API6 name, so verify the AMD-supported combination, install in an isolated Python environment, check the HIP7 build, and then test the actual app.
Using an RX 9070 XT Ubuntu desktop as an example, this guide checks device discovery separately from real computation. If the setup is outside a supported combination, align it first and repeat the checks.
Match the exact GPU and supported combination first
Identify whether the device is an RX 9070 XT, RX 9070, or integrated GPU. In AMD's unified compatibility matrix, match the GPU, Ubuntu version and kernel, driver, ROCm, and PyTorch along one supported path. As of September 27, 2026, ROCm Core SDK 10.0.0 had been released on August 26. Do not assemble versions from separate guides; if no matching row exists, start with a supported OS and version.

Install test Python packages in a virtual environment
A virtual environment8 installs Python packages such as PyTorch in a project-specific space, separate from other work. This manages Python libraries; it does not install the host GPU driver. Follow AMD's OS-specific driver procedure, and check whether the selected package path includes user-space ROCm libraries or requires separate setup.
python3.12 -m venv ~/venvs/rocm-pytorch
source ~/venvs/rocm-pytorch/bin/activate
python -m pip install --upgrade pip wheel
Select the official PyTorch wheel for your GPU
This versioned example comes from AMD's selector with RX 9070 XT (gfx1201), Linux, ROCm 10.0, and PyTorch 2.13.0 selected. It uses torch 2.13.0+rocm10.0.0, torchvision 0.28.0+rocm10.0.0, torchaudio 2.11.0.2+rocm10.0.0, and AMD's wheel index. Do not copy it unchanged to another GPU or OS; select those again in the selector. A generic pip install torch from PyPI does not guarantee an AMD build.
python -m pip install --index-url https://stable.repo.amd.com/rocm/whl-next/ \
"torch[device-gfx1201]==2.13.0+rocm10.0.0" \
"torchvision[device-gfx1201]==0.28.0+rocm10.0.0" \
"torchaudio==2.11.0.2+rocm10.0.0"Check the installed build and HIP runtime
collect_env gathers the Python, OS, GPU, and runtime9 information detected by PyTorch. A HIP version shown in torch.version.hip is an indicator of a ROCm build. Redact personal paths, tokens10, API keys, and other secrets before sharing the output.
python -m torch.utils.collect_envRun a basic GPU calculation after device discovery
In a ROCm build, torch.version.hip may have a value while torch.version.cuda is usually None. Even if torch.cuda.is_available() is True, it means PyTorch found a GPU through its shared device API. The tensor sum below checks a GPU calculation and transfers the result back to the CPU11, but does not guarantee a large model or every operation will work.
python -c 'import torch; print("PyTorch:", torch.__version__); print("HIP:", torch.version.hip); print("CUDA build:", torch.version.cuda); print("GPU available:", torch.cuda.is_available()); print("Device:", torch.cuda.get_device_name(0) if torch.cuda.is_available() else "not detected"); print("2x2 sum:", torch.ones((2,2), device="cuda").sum().item() if torch.cuda.is_available() else "skipped")'Reproduce the workload in the actual model and app
If the GPU is not detected, first check whether python and pip point to the same virtual environment and whether the GPU, Linux kernel, driver, ROCm, and PyTorch match the matrix. Use Windows-specific documentation for native Windows and the WSL compatibility matrix and ROCDXG path for WSL. If installed, rocminfo can provide more device detail, but its absence does not by itself mean unsupported; seeing a GPU there also does not guarantee PyTorch or the app can compute with it.
Finally, open the model and program you plan to use, run a small input, restart the app session, and reproduce the same task. Model format, precision, kernels, memory, and extensions can change actual behavior. If it fails, record whether it stopped during model loading, GPU computation, or memory allocation, then inspect the documentation and logs for that stage.
rocminfo
Verify a representative task in a fresh session
For the RX 9070 XT Ubuntu example, proceed from checking the supported combination to installing the selected wheel, verifying HIP and GPU discovery, running a small tensor calculation, and processing a representative image in the actual image tool. Reopen the app to confirm the same input works, then increase to normal size. Saving the failed stage and full logs helps narrow the configuration or operation involved.
Terminology notes
PyTorch — A software framework for building and running AI models. Check the compatible PyTorch version and hardware support along with the model.
Back to the textInference — The process of using a trained model to compute an output for an input. Here, local inference means running the model on the user’s device.
Back to the textGPU — A processor designed to handle many calculations in parallel. It performs model computations during AI inference.
Back to the textROCm — AMD’s software platform for AI and high-performance computing on GPUs. Support depends on the combination of GPU, operating system, driver, and framework versions.
Back to the textCUDA — A software platform for general-purpose computing on NVIDIA GPUs.
Back to the textAPI — A defined interface that lets other code call a program’s functions.
Back to the textHIP — An API and runtime for portable GPU C++ code. It helps with porting CUDA code.
Back to the textPython virtual environment — An isolated space for installing Python packages per project, helping reduce package-version conflicts.
Back to the textRuntime — The software environment that provides facilities needed while a program runs. In local AI, it can also refer to a model execution engine.
Back to the textToken — A unit into which a model divides input or output for processing.
Back to the textCPU — The central processor that runs the operating system and general-purpose instructions; in AI workloads it also handles tasks such as preprocessing and data movement.
Back to the text
Frequently asked questions
- What should you check first in this article?
- PyTorch takes image or text data, performs training or inference computations on a GPU, and returns result tensors or model output. ROCm builds on Radeon also retain the torch.cuda device API name, so verify the AMD-supported combination, install in an isolated Python environment, check the HIP build, and then test the actual app.
- How much memory does it need?
- Finally, open the model and program you plan to use, run a small input, restart the app session, and reproduce the same task. Model format, precision, kernels, memory, and extensions can change actual behavior. If it fails, record whether it stopped during model loading, GPU computation, or memory allocation, then inspect the documentation and logs for that stage.
Read next
Executable programs and extensions
Local AI with ROCm and Radeon: Reading Support Combinations and Runtime Paths
Executable programs and extensions
If you port CUDA code to AMD, will it run just as fast?
Model setup recipes
When OpenRouter Is Unavailable, How Do You Switch Your App to a Local LLM?
Model setup recipes
How to run Nemotron Bolt on an RTX 3090 or 5090
