Install PyTorch on ROCm 7.13.0

Install PyTorch on ROCm 7.13.0#

This topic guides you through installing PyTorch with ROCm support on AMD hardware. It applies to supported AMD GPUs and platforms.

Device family
Operating system
Operating system
PyTorch version
PyTorch version

Prerequisites#

  • 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 for instructions.

Install PyTorch using pip#

  1. Set up your Python virtual environment. For example, run the following command to create one with Python 3.13:

  2. Activate your Python virtual environment. For example:

  3. Install the appropriate ROCm-enabled PyTorch libraries for your operating system and AMD hardware architecture.

  4. Verify your PyTorch installation.

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

    This prints True if PyTorch and ROCm are installed properly.