Installing multiple ROCm versions#
2024-12-06
9 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.
Note
You cannot install single-version and multi-version ROCm packages together on the same machine. The conflicting package versions might result in unpredictable behavior.
The following diagram illustrates the difference between single-version and multi-version ROCm installations.
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.
Set up your package signing key following the steps in Package signing key.
Register the kernel-mode driver.
Add the AMDGPU repository for the driver.
ver = 6.3 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.3 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
Register ROCm packages.
Add the ROCm repository.
for ver in 6.3 6.2.4; 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.3 6.2.4; 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
Install ROCm.
Install the kernel driver.
sudo apt install amdgpu-dkms sudo reboot
Install the registered ROCm packages.
for ver in 6.3.0 6.2.4; do sudo apt install rocm$ver done
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.
Register the kernel-mode driver.
ver = 6.3 sudo tee /etc/yum.repos.d/amdgpu.repo <<EOF [amdgpu] name=amdgpu baseurl=https://repo.radeon.com/amdgpu/$ver/el/9.5/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.3 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.3 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
Register ROCm packages.
for ver in 6.3 6.2.4; 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.3 6.2.4; 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
Install ROCm.
Install kernel driver.
sudo dnf install amdgpu-dkms sudo reboot
Install the registered ROCm packages.
for ver in 6.3.0 6.2.4; do sudo dnf install rocm$ver done
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.
Register the kernel-mode driver.
for ver in 6.3 6.2.4; do 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 done sudo dnf clean all
Register ROCm packages.
for ver in 6.3 6.2.4; do sudo tee --append /etc/yum.repos.d/rocm.repo <<EOF [ROCm-$ver] name=ROCm6.3 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
Install ROCm.
Install kernel driver.
sudo dnf install amdgpu-dkms sudo reboot
Install the registered ROCm packages.
for ver in 6.3.0 6.2.4; do sudo dnf install rocm$ver done
Complete the Post-installation instructions.
Tip
For a single-version installation of the latest ROCm version on OL, use the steps in Register repositories and Installing.
Register the kernel-mode driver.
ver = 6.3 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.3 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
Register ROCm packages.
Install ROCm.
Install kernel driver.
sudo zypper --gpg-auto-import-keys install amdgpu-dkms sudo reboot
Install the registered ROCm packages.
for ver in 6.3.0 6.2.4; do sudo zypper --gpg-auto-import-keys install rocm$ver done
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.