This is not the latest version of ROCm documentation. See ROCm documentation for the latest version.

Installing multiple ROCm versions

Installing multiple ROCm versions#

Applies to Linux

2024-07-22

8 min read time

A multi-version ROCm installation covers situations where you need multiple versions of ROCm on the same machine – for compatibility with different applications and hardware, testing, and other use cases.

A multi-version ROCm installation involves the following.

  • Installing multiple instances of the ROCm stack on a system.

  • Using versioned ROCm meta-packages. ROCm packages are versioned with both a ROCm release version and package-specific semantic versioning. Extending a package name and its dependencies with the release version adds the ability to support multiple versions of packages simultaneously.

A single-version ROCm installation involves the following.

  • Installing a single instance of the ROCm release on a system.

  • Using non-versioned ROCm meta-packages.

See Quick start installation guide or ROCm on Linux detailed installation overview for a standard single-version installation.

The following diagram illustrates the difference between single-version and multi-version ROCm installations.

ROCm Installation Types

Note

Multi-version install is not available for the kernel driver module, also referred to as AMDGPU.

Using your package manager#

Before proceeding with a multi-version ROCm installation, you must remove ROCm packages that were previously installed from a single-version installation to avoid conflicts.

  1. Set up your package signing key following the steps in Package signing key.

  2. Register the kernel-mode driver.

    Add the AMDGPU repository for the driver.

    ver = 6.2.2
    echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/amdgpu/$ver/ubuntu noble main" \
        | sudo tee /etc/apt/sources.list.d/amdgpu.list
    sudo apt update
    
    ver = 6.2.2
    echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/amdgpu/$ver/ubuntu jammy main" \
        | sudo tee /etc/apt/sources.list.d/amdgpu.list
    sudo apt update
    
  1. Register ROCm packages.

    Add the ROCm repository.

    for ver in 6.2.2 6.2.1; do
    echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/$ver noble main" \
        | sudo tee --append /etc/apt/sources.list.d/rocm.list
    done
    echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' \
        | sudo tee /etc/apt/preferences.d/rocm-pin-600
    sudo apt update
    
    for ver in 6.2.2 6.2.1; do
    echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/$ver jammy main" \
        | sudo tee --append /etc/apt/sources.list.d/rocm.list
    done
    echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' \
        | sudo tee /etc/apt/preferences.d/rocm-pin-600
    sudo apt update
    
  2. Install ROCm.

    1. Install the kernel driver.

      sudo apt install amdgpu-dkms
      sudo reboot
      
    2. Install the registered ROCm packages.

      for ver in 6.2.2 6.2.1; do
          sudo apt install rocm$ver
      done
      
  3. Complete the Post-installation instructions.

Tip

For a single-version installation of the latest ROCm version on Ubuntu, use the steps in Registering ROCm repositories and Installing.

  1. Register the kernel-mode driver.

    ver = 6.2.2
    sudo tee /etc/yum.repos.d/amdgpu.repo <<EOF
    [amdgpu]
    name=amdgpu
    baseurl=https://repo.radeon.com/amdgpu/$ver/el/9.4/main/x86_64/
    enabled=1
    priority=50
    gpgcheck=1
    gpgkey=https://repo.radeon.com/rocm/rocm.gpg.key
    EOF
    sudo dnf clean all
    
    ver = 6.2.2
    sudo tee /etc/yum.repos.d/amdgpu.repo <<EOF
    [amdgpu]
    name=amdgpu
    baseurl=https://repo.radeon.com/amdgpu/$ver/el/9.3/main/x86_64/
    enabled=1
    priority=50
    gpgcheck=1
    gpgkey=https://repo.radeon.com/rocm/rocm.gpg.key
    EOF
    sudo dnf clean all
    
    ver = 6.2.2
    sudo tee /etc/yum.repos.d/amdgpu.repo <<EOF
    [amdgpu]
    name=amdgpu
    baseurl=https://repo.radeon.com/amdgpu/$ver/el/8.10/main/x86_64/
    enabled=1
    priority=50
    gpgcheck=1
    gpgkey=https://repo.radeon.com/rocm/rocm.gpg.key
    EOF
    sudo dnf clean all
    
    ver = 6.2.2
    sudo tee /etc/yum.repos.d/amdgpu.repo <<EOF
    [amdgpu]
    name=amdgpu
    baseurl=https://repo.radeon.com/amdgpu/$ver/el/8.9/main/x86_64/
    enabled=1
    priority=50
    gpgcheck=1
    gpgkey=https://repo.radeon.com/rocm/rocm.gpg.key
    EOF
    sudo dnf clean all
    
  1. Register ROCm packages.

    for ver in 6.2.2 6.2.1; do
    sudo tee --append /etc/yum.repos.d/rocm.repo <<EOF
    [ROCm-$ver]
    name=ROCm$ver
    baseurl=https://repo.radeon.com/rocm/el9/$ver/main
    enabled=1
    priority=50
    gpgcheck=1
    gpgkey=https://repo.radeon.com/rocm/rocm.gpg.key
    EOF
    done
    sudo dnf clean all
    
    for ver in 6.2.2 6.2.1; do
    sudo tee --append /etc/yum.repos.d/rocm.repo <<EOF
    [ROCm-$ver]
    name=ROCm$ver
    baseurl=https://repo.radeon.com/rocm/el8/$ver/main
    enabled=1
    priority=50
    gpgcheck=1
    gpgkey=https://repo.radeon.com/rocm/rocm.gpg.key
    EOF
    done
    sudo dnf clean all
    
  2. Install ROCm.

    1. Install kernel driver.

      sudo dnf install amdgpu-dkms
      sudo reboot
      
    2. Install the registered ROCm packages.

      for ver in 6.2.2 6.2.1; do
          sudo dnf install rocm$ver
      done
      
  3. Complete the Post-installation instructions.

Tip

For a single-version installation of the latest ROCm version on RHEL, use the steps in Registering ROCm repositories and Installing.

  1. Register the kernel-mode driver.

    ver = 6.2.2
    sudo tee /etc/zypp/repos.d/amdgpu.repo <<EOF
    [amdgpu]
    name=amdgpu
    baseurl=https://repo.radeon.com/amdgpu/$ver/sle/15.6/main/x86_64/
    enabled=1
    gpgcheck=1
    gpgkey=https://repo.radeon.com/rocm/rocm.gpg.key
    EOF
    sudo zypper ref
    
    ver = 6.2.2
    sudo tee /etc/zypp/repos.d/amdgpu.repo <<EOF
    [amdgpu]
    name=amdgpu
    baseurl=https://repo.radeon.com/amdgpu/$ver/sle/15.5/main/x86_64/
    enabled=1
    gpgcheck=1
    gpgkey=https://repo.radeon.com/rocm/rocm.gpg.key
    EOF
    sudo zypper ref
    
  1. Register ROCm packages.

  2. Install ROCm.

    1. Install kernel driver.

      sudo zypper --gpg-auto-import-keys install amdgpu-dkms
      sudo reboot
      
    2. Install the registered ROCm packages.

      for ver in 6.2.2 6.2.1; do
          sudo zypper --gpg-auto-import-keys install rocm$ver
      done
      
  3. Complete the Post-installation instructions.

Tip

For a single-version installation of the latest ROCm version on SLES, use the steps in Registering ROCm repositories and Installing.

Using the AMDGPU installer#

By default (without the --rocmrelease option), the amdgpu-install script installs packages in the single-version layout. See Installation via AMDGPU installer for an overview of the AMDGPU installer.

For a multi-version ROCm installation, you must use the installer script from the latest ROCm release you want to install.

For example, to install ROCm releases 5.5.3, 5.6.1, and 5.7 simultaneously, you must download the ROCm 5.7 installer. Then, you must manually add the ROCm repositories for all ROCm releases you want to install except for the latest one. The amdgpu-install script automatically adds the required repositories for the latest release.

Refer to Register ROCm packages for guidance on manually adding ROCm repositories.