Install PyTorch for ROCm 7.14.0#
This topic guides you through installing PyTorch with ROCm support on AMD hardware. It applies to supported AMD GPUs and platforms.
Prerequisites#
Ensure your system has the AMD GPU Driver (amdgpu) installed. See the ROCm compatibility matrix for driver support information. For installation instructions, see the AMD GPU Driver documentation.
Ensure the host system has Docker Engine installed.
Ensure your system has a supported Python version installed and accessible: 3.11, 3.12, 3.13, or 3.14.
Complete the ROCm Core SDK installation prerequisites. See Prerequisites (Install ROCm) for instructions.
Get started#
Pull the ROCm PyTorch 2.12.0 Docker image.
docker pull rocm/pytorch:rocm7.14_ubuntu26.04_py3.14_pytorch_release_2.12.0
docker pull rocm/pytorch:rocm7.14_ubuntu24.04_py3.13_pytorch_release_2.12.0
docker pull rocm/pytorch:rocm7.14_ubuntu24.04_py3.12_pytorch_release_2.12.0
docker pull rocm/pytorch:rocm7.14_ubuntu24.04_py3.11_pytorch_release_2.12.0
Pull the ROCm PyTorch 2.11.0 Docker image.
docker pull rocm/pytorch:rocm7.14_ubuntu26.04_py3.14_pytorch_release_2.11.0
docker pull rocm/pytorch:rocm7.14_ubuntu24.04_py3.13_pytorch_release_2.11.0
docker pull rocm/pytorch:rocm7.14_ubuntu24.04_py3.12_pytorch_release_2.11.0
docker pull rocm/pytorch:rocm7.14_ubuntu24.04_py3.11_pytorch_release_2.11.0
Pull the ROCm PyTorch 2.10.0 Docker image.
docker pull rocm/pytorch:rocm7.14_ubuntu26.04_py3.14_pytorch_release_2.10.0
docker pull rocm/pytorch:rocm7.14_ubuntu24.04_py3.13_pytorch_release_2.10.0
docker pull rocm/pytorch:rocm7.14_ubuntu24.04_py3.12_pytorch_release_2.10.0
docker pull rocm/pytorch:rocm7.14_ubuntu24.04_py3.11_pytorch_release_2.10.0
Start the Docker container.
docker run -it --rm \ --device /dev/kfd \ --device /dev/dri \ --network=host \ --ipc=host \ --group-add=video \ --cap-add=SYS_PTRACE \ --security-opt seccomp=unconfined \ rocm/pytorch:rocm7.14_ubuntu26.04_py3.14_pytorch_release_2.12.0 \ bash
docker run -it --rm \ --device /dev/kfd \ --device /dev/dri \ --network=host \ --ipc=host \ --group-add=video \ --cap-add=SYS_PTRACE \ --security-opt seccomp=unconfined \ rocm/pytorch:rocm7.14_ubuntu24.04_py3.13_pytorch_release_2.12.0 \ bash
docker run -it --rm \ --device /dev/kfd \ --device /dev/dri \ --network=host \ --ipc=host \ --group-add=video \ --cap-add=SYS_PTRACE \ --security-opt seccomp=unconfined \ rocm/pytorch:rocm7.14_ubuntu24.04_py3.12_pytorch_release_2.12.0 \ bash
docker run -it --rm \ --device /dev/kfd \ --device /dev/dri \ --network=host \ --ipc=host \ --group-add=video \ --cap-add=SYS_PTRACE \ --security-opt seccomp=unconfined \ rocm/pytorch:rocm7.14_ubuntu24.04_py3.11_pytorch_release_2.12.0 \ bash
docker run -it --rm \ --device /dev/kfd \ --device /dev/dri \ --network=host \ --ipc=host \ --group-add=video \ --cap-add=SYS_PTRACE \ --security-opt seccomp=unconfined \ rocm/pytorch:rocm7.14_ubuntu26.04_py3.14_pytorch_release_2.11.0 \ bash
docker run -it --rm \ --device /dev/kfd \ --device /dev/dri \ --network=host \ --ipc=host \ --group-add=video \ --cap-add=SYS_PTRACE \ --security-opt seccomp=unconfined \ rocm/pytorch:rocm7.14_ubuntu24.04_py3.13_pytorch_release_2.11.0 \ bash
docker run -it --rm \ --device /dev/kfd \ --device /dev/dri \ --network=host \ --ipc=host \ --group-add=video \ --cap-add=SYS_PTRACE \ --security-opt seccomp=unconfined \ rocm/pytorch:rocm7.14_ubuntu24.04_py3.12_pytorch_release_2.11.0 \ bash
docker run -it --rm \ --device /dev/kfd \ --device /dev/dri \ --network=host \ --ipc=host \ --group-add=video \ --cap-add=SYS_PTRACE \ --security-opt seccomp=unconfined \ rocm/pytorch:rocm7.14_ubuntu24.04_py3.11_pytorch_release_2.11.0 \ bash
docker run -it --rm \ --device /dev/kfd \ --device /dev/dri \ --network=host \ --ipc=host \ --group-add=video \ --cap-add=SYS_PTRACE \ --security-opt seccomp=unconfined \ rocm/pytorch:rocm7.14_ubuntu26.04_py3.14_pytorch_release_2.10.0 \ bash
docker run -it --rm \ --device /dev/kfd \ --device /dev/dri \ --network=host \ --ipc=host \ --group-add=video \ --cap-add=SYS_PTRACE \ --security-opt seccomp=unconfined \ rocm/pytorch:rocm7.14_ubuntu24.04_py3.13_pytorch_release_2.10.0 \ bash
docker run -it --rm \ --device /dev/kfd \ --device /dev/dri \ --network=host \ --ipc=host \ --group-add=video \ --cap-add=SYS_PTRACE \ --security-opt seccomp=unconfined \ rocm/pytorch:rocm7.14_ubuntu24.04_py3.12_pytorch_release_2.10.0 \ bash
docker run -it --rm \ --device /dev/kfd \ --device /dev/dri \ --network=host \ --ipc=host \ --group-add=video \ --cap-add=SYS_PTRACE \ --security-opt seccomp=unconfined \ rocm/pytorch:rocm7.14_ubuntu24.04_py3.11_pytorch_release_2.10.0 \ bash
Install PyTorch using pip#
Set up your Python virtual environment.
python3.14 -m venv .venv
py -3.14 -m venv .venv
python3.13 -m venv .venv
py -3.13 -m venv .venv
python3.12 -m venv .venv
py -3.12 -m venv .venv
python3.11 -m venv .venv
py -3.11 -m venv .venv
Activate your Python virtual environment. For example:
source .venv/bin/activate
.venv\Scripts\activate
Install the appropriate ROCm-enabled PyTorch libraries for your operating system and AMD hardware architecture.
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-all]==2.12.0+rocm7.14.0" \ "torchvision[device-all]==0.27.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ "torch[device-all]==2.12.0+rocm7.14.0" "torchvision[device-all]==0.27.0+rocm7.14.0" "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-all]==2.11.0+rocm7.14.0" \ "torchvision[device-all]==0.26.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-all]==2.10.0+rocm7.14.0" \ "torchvision[device-all]==0.25.0+rocm7.14.0" \ "torchaudio==2.10.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx950]==2.12.0+rocm7.14.0" \ "torchvision[device-gfx950]==0.27.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx950]==2.11.0+rocm7.14.0" \ "torchvision[device-gfx950]==0.26.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx950]==2.10.0+rocm7.14.0" \ "torchvision[device-gfx950]==0.25.0+rocm7.14.0" \ "torchaudio==2.10.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx942]==2.12.0+rocm7.14.0" \ "torchvision[device-gfx942]==0.27.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx942]==2.11.0+rocm7.14.0" \ "torchvision[device-gfx942]==0.26.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx942]==2.10.0+rocm7.14.0" \ "torchvision[device-gfx942]==0.25.0+rocm7.14.0" \ "torchaudio==2.10.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx90a]==2.12.0+rocm7.14.0" \ "torchvision[device-gfx90a]==0.27.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx90a]==2.11.0+rocm7.14.0" \ "torchvision[device-gfx90a]==0.26.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx90a]==2.10.0+rocm7.14.0" \ "torchvision[device-gfx90a]==0.25.0+rocm7.14.0" \ "torchaudio==2.10.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx908]==2.12.0+rocm7.14.0" \ "torchvision[device-gfx908]==0.27.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx908]==2.11.0+rocm7.14.0" \ "torchvision[device-gfx908]==0.26.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx908]==2.10.0+rocm7.14.0" \ "torchvision[device-gfx908]==0.25.0+rocm7.14.0" \ "torchaudio==2.10.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx1200]==2.12.0+rocm7.14.0" \ "torchvision[device-gfx1200]==0.27.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ "torch[device-gfx1200]==2.12.0+rocm7.14.0" "torchvision[device-gfx1200]==0.27.0+rocm7.14.0" "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx1200]==2.11.0+rocm7.14.0" \ "torchvision[device-gfx1200]==0.26.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
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"
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"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx1201]==2.11.0+rocm7.14.0" \ "torchvision[device-gfx1201]==0.26.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx1100]==2.12.0+rocm7.14.0" \ "torchvision[device-gfx1100]==0.27.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ "torch[device-gfx1100]==2.12.0+rocm7.14.0" "torchvision[device-gfx1100]==0.27.0+rocm7.14.0" "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx1100]==2.11.0+rocm7.14.0" \ "torchvision[device-gfx1100]==0.26.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx1101]==2.12.0+rocm7.14.0" \ "torchvision[device-gfx1101]==0.27.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ "torch[device-gfx1101]==2.12.0+rocm7.14.0" "torchvision[device-gfx1101]==0.27.0+rocm7.14.0" "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx1101]==2.11.0+rocm7.14.0" \ "torchvision[device-gfx1101]==0.26.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx1102]==2.12.0+rocm7.14.0" \ "torchvision[device-gfx1102]==0.27.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ "torch[device-gfx1102]==2.12.0+rocm7.14.0" "torchvision[device-gfx1102]==0.27.0+rocm7.14.0" "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx1102]==2.11.0+rocm7.14.0" \ "torchvision[device-gfx1102]==0.26.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx1103]==2.12.0+rocm7.14.0" \ "torchvision[device-gfx1103]==0.27.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ "torch[device-gfx1103]==2.12.0+rocm7.14.0" "torchvision[device-gfx1103]==0.27.0+rocm7.14.0" "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx1103]==2.11.0+rocm7.14.0" \ "torchvision[device-gfx1103]==0.26.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx1030]==2.12.0+rocm7.14.0" \ "torchvision[device-gfx1030]==0.27.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ "torch[device-gfx1030]==2.12.0+rocm7.14.0" "torchvision[device-gfx1030]==0.27.0+rocm7.14.0" "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx1030]==2.11.0+rocm7.14.0" \ "torchvision[device-gfx1030]==0.26.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx1151]==2.12.0+rocm7.14.0" \ "torchvision[device-gfx1151]==0.27.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ "torch[device-gfx1151]==2.12.0+rocm7.14.0" "torchvision[device-gfx1151]==0.27.0+rocm7.14.0" "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx1151]==2.11.0+rocm7.14.0" \ "torchvision[device-gfx1151]==0.26.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx1150]==2.12.0+rocm7.14.0" \ "torchvision[device-gfx1150]==0.27.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ "torch[device-gfx1150]==2.12.0+rocm7.14.0" "torchvision[device-gfx1150]==0.27.0+rocm7.14.0" "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx1150]==2.11.0+rocm7.14.0" \ "torchvision[device-gfx1150]==0.26.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx1152]==2.12.0+rocm7.14.0" \ "torchvision[device-gfx1152]==0.27.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ "torch[device-gfx1152]==2.12.0+rocm7.14.0" "torchvision[device-gfx1152]==0.27.0+rocm7.14.0" "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx1152]==2.11.0+rocm7.14.0" \ "torchvision[device-gfx1152]==0.26.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx1153]==2.12.0+rocm7.14.0" \ "torchvision[device-gfx1153]==0.27.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ "torch[device-gfx1153]==2.12.0+rocm7.14.0" "torchvision[device-gfx1153]==0.27.0+rocm7.14.0" "torchaudio==2.11.0+rocm7.14.0"
python -m pip install --index-url https://repo.amd.com/rocm/whl-multi-arch/ \ "torch[device-gfx1153]==2.11.0+rocm7.14.0" \ "torchvision[device-gfx1153]==0.26.0+rocm7.14.0" \ "torchaudio==2.11.0+rocm7.14.0"
Verify your PyTorch installation.
python -c "import torch; print(torch.cuda.is_available())"
This prints
Trueif PyTorch and ROCm are installed properly and your AMD GPUs are detected.
Known issues#
PyTorch might display a warning when importing on Linux if the system
libnumapackage is not installed on some Radeon graphics products, such as Radeon AI PRO R9600D. As a workaround, install the systemlibnumapackage or configure the library path to use the ROCm-bundled NUMA libraries.Lower-than-expected performance might be observed in some large language model inference workloads, including vLLM FP16 decode workloads with batch sizes of 8 or greater, on AMD Radeon RX 7900 Series Graphics, AMD Radeon RX 7800 XT Graphics, and AMD Ryzen AI MAX / MAX+ Series Processors when using PyTorch versions earlier than 2.14. As a workaround, set the TORCH_BLAS_PREFER_HIPBLASLT=1 environment variable to use the hipBLASLt backend. This setting becomes the default for these architectures in PyTorch 2.14.