Install the AMD SMI library and CLI tool#
This page describes the system requirements for AMD SMI and explains how to
install the AMD SMI library, Python interface, and amd-smi CLI on Linux.
Supported platforms#
AMD SMI supports:
AMD GPUs on Linux bare metal systems
AMD GPUs in Linux virtual machine guests
AMD EPYC™ CPUs through the esmi_ib_library
For AMD SMI on Linux SR-IOV hosts, refer to the AMD SMI for Virtualization documentation.
AMD SMI library runs on AMD ROCm supported platforms. Refer to AMD hardware support for more information.
Requirements#
Before installing AMD SMI, make sure your system meets the following requirements.
Driver requirements#
To run AMD SMI, the following components need to be installed on your system:
The
amdgpu-dkmsdriverFor current amdgpu driver installation instructions, see the AMD GPU Driver (amdgpu) documentation.
The
amd_hsmporhsmp_acpidriverSee amd_hsmp for more information.
Also confirm that your Linux kernel version matches the system requirements described in Operating system support.
Interface prerequisites#
The following prerequisites apply to the AMD SMI library interfaces:
Python interface and
amd-smiCLI:Python 3.6.8 or later
64-bit Python
Go interface:
Go 1.20 or later
Note
During the driver installation process on Azure Linux 3, you might encounter
the ModuleNotFoundError: No module named 'more_itertools' warning. This
warning is a result of the reintroduction of python3-wheel and
python3-setuptools dependencies in the CMake of AMD SMI, which requires
more_itertools to build these Python libraries. This issue will be fixed in a
future ROCm release. As a workaround, use the following command before
installation:
sudo python3 -m pip install more_itertools
Install the ROCm Core SDK#
AMD SMI is included with most installations of the ROCm Core SDK on Linux.
For instructions, see Install AMD ROCm. Use the selector panel on that page to view instructions appropriate for your system environment.
Install AMD SMI standalone on Linux#
Alternatively, if you want to install AMD SMI without additional ROCm libraries
and tools, install the amdrocm-amdsmi package. This includes AMD SMI and
ROCm system dependencies.
Complete the ROCm installation prerequisites to install dependencies and configure GPU access permissions.
Install the AMD SMI package that matches your desired ROCm version. Package names use the following format:
amdrocm-amdsmi<rocm_version>
<rocm_version>represents the ROCm Core SDK version to install. Omit this suffix to install the latest available version.For example, to install the latest ROCm AMD SMI release for supported GPU architectures:
sudo apt install amdrocm-amdsmi
sudo dnf install amdrocm-amdsmi
sudo zypper install amdrocm-amdsmi
Prepend the
amd-smibinary to your PATH, it is not on PATH by default. Replace<major>and<minor>with the appropriate ROCm version.export PATH="/opt/rocm/core-<major>.<minor>/bin${PATH:+:${PATH}}"
To persist this across shells, append the line to your
~/.bashrc(or equivalent shell config).Verify your installation.
amd-smi version
Install a nightly build#
Nightly builds of the ROCm Core SDK (including AMD SMI) are published by TheRock to a unified pip index.
Create and activate a Python virtual environment (recommended):
python3 -m venv .venv source .venv/bin/activate
Install ROCm with the device extra matching your GPU. For example, for gfx942 (MI300X / MI325X):
pip install --index-url https://rocm.nightlies.amd.com/whl-multi-arch/ \ "rocm[libraries,device-gfx942]"
For the full list of
device-*extras and other release options, see TheRock RELEASES.md.Verify your installation:
amd-smi version
Optional and advanced installation#
Use these optional procedures for CLI autocompletion and advanced setups, such as systems with multiple ROCm instances.
Enable CLI autocompletion#
The amd-smi CLI application supports autocompletion. If argcomplete is not
installed and enabled already, do so using the following commands.
python3 -m pip install argcomplete
activate-global-python-argcomplete --user
# restart shell to enable
Install the Python library for multiple ROCm instances#
If multiple ROCm versions are installed and you are not using pyenv,
uninstall previous versions of AMD SMI before installing the desired version
from your ROCm instance.
Manually install the Python library#
Multiple ROCm installations may cause amd-smi failures.
Installing multiple versions of ROCm on the same system can result in the amd-smi CLI not functioning correctly.
Remove previous AMD SMI installation.
python3 -m pip list | grep amd python3 -m pip uninstall amdsmi
Install the AMD SMI Python library from your target ROCm instance. Replace
<major>and<minor>with the appropriate ROCm version.# Install from target ROCm instance cd /opt/rocm/core-<major>.<minor>/share/amd_smi python3 -m pip install --user .
Note:
sudomay be required. On some systems, use--break-system-packagesif pip installation fails.You should now have the AMD SMI Python library in your Python path:
~$ python3 Python 3.8.10 (default, May 26 2023, 14:05:08) [GCC 9.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import amdsmi >>>