Installation prerequisites — ROCm installation (Linux) (original) (raw)
Contents
- Register your Enterprise Linux
- Update your Enterprise Linux
- Additional package repositories
- Additional development packages
- Configuring permissions for GPU access
- Disable integrated graphics (IGP)
- Secure Boot
Installation prerequisites#
2025-05-21
9 min read time
Applies to Linux
Before installing ROCm, complete the following prerequisites.
- Confirm the system has a supported Linux version.
- To obtain the Linux distribution information, use the following command:
uname -m && cat /etc/*release - Confirm that your Linux distribution matches a supported distribution.
Example: Running the preceding command on an Ubuntu system produces the following output:
x86_64
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.5 LTS"
- To obtain the Linux distribution information, use the following command:
- Verify the kernel version.
- To check the kernel version of your Linux system, type the following command:
Example: The preceding command lists the kernel version in the following format:
Linux 5.15.0-46-generic #44~20.04.5-Ubuntu SMP Fri Jun 24 13:27:29 UTC 2022 x86_64 - Confirm that your kernel version matches the system requirements, as listed in Supported operating systems.
- To check the kernel version of your Linux system, type the following command:
Register your Enterprise Linux#
If you’re using Red Hat Enterprise Linux (RHEL) or SUSE Linux Enterprise Server (SLES), register your operating system to ensure you’re able to download and install packages.
Ubuntu
There is no registration required for Ubuntu.
Debian
There is no registration required for Debian.
Red Hat Enterprise Linux
Typically you can register by following the step-by-step user interface. If you need to register by command line, use the following commands:
subscription-manager register --username --password subscription-manager attach --auto
More details about registering for RHEL
Oracle Linux
There is no registration required for Oracle Linux.
SUSE Linux Enterprise Server
Typically you can register by following the step-by-step user interface. If you need to register by command line, use the following commands:
sudo SUSEConnect -r
More details about registering for SLES
Azure Linux
There is no registration required for Azure Linux.
Update your Enterprise Linux#
If you are using Red Hat Enterprise Linux (RHEL) or SUSE Linux Enterprise Servers (SLES), or Oracle Linux, it is recommended that you update your operating system to the latest packages from the Linux distribution. This is a requirement for newer hardware on older versions of RHEL, SLES or OL.
Ubuntu
There is no update required for Ubuntu.
Debian
There is no update required for Debian.
Red Hat Enterprise Linux
9.6
sudo dnf update --releasever=9.6 --exclude=*release*
9.5
sudo dnf update --releasever=9.5 --exclude=*release*
9.4
sudo dnf update --releasever=9.4 --exclude=*release*
8.10
sudo dnf update --releasever=8.10 --exclude=*release*
Oracle Linux
9
sudo dnf update --releasever=9.5 --exclude=*release*
8
sudo dnf update --releasever=8.10 --exclude=*release*
SUSE Linux Enterprise Server
Azure Linux
There is no update required for Azure Linux.
Important
To apply all settings, reboot your system.
Additional package repositories#
For some distributions, the ROCm installation packages depend on packages that aren’t included in the default package repositories. These external repositories need to be sourced before installation. Use the following instructions specific to your distribution to add the necessary repositories.
Ubuntu
All ROCm installation packages are available in the default Ubuntu repositories.
Debian
All ROCm installation packages are available in the default Debian repositories.
Red Hat Enterprise Linux
- Add the EPEL repository.
RHEL 9
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
sudo rpm -ivh epel-release-latest-9.noarch.rpm
RHEL 8
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo rpm -ivh epel-release-latest-8.noarch.rpm - Enable the CodeReady Linux Builder (CRB) repository.
In order to enable CRB, you may need to installdnf-plugin-config-manager
first.
sudo dnf install dnf-plugin-config-manager
sudo crb enable
Oracle Linux
- Add the EPEL repository.
9
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
sudo rpm -ivh epel-release-latest-9.noarch.rpm
8
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
sudo rpm -ivh epel-release-latest-8.noarch.rpm - Enable the CodeReady Linux Builder (CRB) repository.
In order to enable CRB, you may need to installdnf-plugin-config-manager
first.
sudo dnf install dnf-plugin-config-manager
sudo crb enable
SUSE Linux Enterprise Server
Add a few modules with SUSEConnect, along with the Perl language, Education and science repositories.
SLES 15.6
sudo SUSEConnect -p sle-module-desktop-applications/15.6/x86_64 sudo SUSEConnect -p sle-module-development-tools/15.6/x86_64 sudo SUSEConnect -p PackageHub/15.6/x86_64 sudo zypper install zypper sudo zypper addrepo https://download.opensuse.org/repositories/devel:/languages:/perl/15.6/devel:languages:perl.repo sudo zypper addrepo https://download.opensuse.org/repositories/Education/15.6/Education.repo sudo zypper addrepo https://download.opensuse.org/repositories/science/SLE_15_SP5/science.repo
Azure Linux
Enable the the config repository for additional packages. In order to enable config, you may need to install dnf-plugin-config-manager
first.
AZL 3.0
sudo tdnf install dnf-plugin-config-manager sudo curl -o /etc/yum.repos.d/azurelinux-extended.repo https://packages.microsoft.com/azurelinux/3.0/prod/extended/x86_64/config.repo
Additional development packages#
ROCm installation requires additional packages for operation and development.
To install the required packages, use the following instructions specific to your distribution:
Ubuntu
sudo apt install python3-setuptools python3-wheel
Debian
sudo apt install python3-setuptools python3-wheel
Red Hat Enterprise Linux
sudo dnf install python3-setuptools python3-wheel
Oracle Linux
sudo dnf install python3-setuptools python3-wheel
SUSE Linux Enterprise Server
sudo zypper install python3-setuptools python3-wheel
Azure Linux
sudo tdnf install python3-setuptools python3-wheel
Optionally, if configuring the post-ROCm installation using environment-modules
, install the following:
Ubuntu
sudo apt install environment-modules
Debian
sudo apt install environment-modules
Red Hat Enterprise Linux
sudo dnf install environment-modules
Oracle Linux
sudo dnf install environment-modules
SUSE Linux Enterprise Server
sudo zypper install environment-modules
Create a link for installed modules version
version=$(rpm -qa | grep '^Modules-' | awk -F'-' '{print $2}') sudo ln -s /usr/share/Modules/$version/modulefiles /usr/share/Modules/modulefiles
Azure Linux
sudo tdnf install environment-modules
Configuring permissions for GPU access#
There are two primary methods to configure GPU access for ROCm: group membership or udev rules. Each method has its own advantages, and the choice depends on your specific requirements and system management preferences.
Using group membership#
By default, GPU access is managed through membership in the video
and render
groups. The video
and render
groups are system groups in Linux used to manage access to graphics hardware and related functionality. Traditionally, the video
group is used to control access to video devices, including graphics cards and video capture devices. The render
group is more recent and specifically controls access to GPU rendering capabilities through Direct Rendering Manager (DRM) render nodes.
- To check the groups in your system, issue the following command:
- Add yourself to the
video
andrender
groups:
sudo usermod -a -G video,render $LOGNAME - Optionally, add other users to the
video
andrender
groups:
sudo usermod -a -G video,render user1
sudo usermod -a -G video,render user2 - To add all future users to the render and video groups by default, run the following commands:
echo 'ADD_EXTRA_GROUPS=1' | sudo tee -a /etc/adduser.conf
echo 'EXTRA_GROUPS=video' | sudo tee -a /etc/adduser.conf
echo 'EXTRA_GROUPS=render' | sudo tee -a /etc/adduser.conf
Using udev rules#
A flexible way to manage device permissions is to use udev rules. They apply system-wide, can be easily deployed via configuration management tools, and eliminate the need for user group management. This method provides more granular control over GPU access.
Grant GPU access to all users on the system#
- Create a new file
/etc/udev/rules.d/70-amdgpu.rules
with the following content:
KERNEL=="kfd", MODE="0666"
SUBSYSTEM=="drm", KERNEL=="renderD*", MODE="0666" - Reload the udev rules:
sudo udevadm control --reload-rules && sudo udevadm trigger
This configuration grants all users read and write access to AMD GPU resources, including the AMD Kernel-mode GPU Driver (KMD) and Direct Rendering Manager (DRM) devices.
Grant GPU access to a custom group#
- Create a new group (e.g.,
devteam
): - Add users to the new group:
sudo usermod -a -G devteam dev1
sudo usermod -a -G devteam dev2 - Create udev rules to assign GPU devices to this group:
Create a file/etc/udev/rules.d/70-amdgpu.rules
with:
KERNEL=="kfd", GROUP="devteam", MODE="0660"
SUBSYSTEM=="drm", KERNEL=="renderD*", GROUP="devteam", MODE="0660" - Reload the udev rules:
sudo udevadm control --reload-rules && sudo udevadm trigger
This configuration grants all users in the devteam
group read and write access to AMD GPU resources, including the AMD Kernel-mode GPU Driver (KMD) and Direct Rendering Manager (DRM) devices.
Disable integrated graphics (IGP)#
ROCm doesn’t currently support integrated graphics. If your system has an AMD IGP installed, disable it in the BIOS prior to using ROCm. If the driver can enumerate the IGP, the ROCm runtime might crash the system, even when omission was specified via HIP_VISIBLE_DEVICES.
Secure Boot#
When installing the AMDGPU driver with Secure Boot enabled, you must sign amdgpu-dkms
to prevent potential system loading issues. For more information, see Secure Boot Support. If you prefer not to sign the AMDGPU driver, you can disable Secure Boot from the BIOS settings instead.