AMD SMI Python library
The AMD SMI Python interface offers an accessible way to interact with AMD hardware through a user-friendly API.
Online documentation
Explore the latest documentation on the ROCm documentation portal.
Install paths
The following install modes expose the same import amdsmi entry point:
| Mode | What ships | Loader resolves to |
|---|---|---|
System package (amd-smi-lib rpm/deb) |
The wrapper installed directly into the system Python's site-packages so plain import amdsmi works. The shared library lives at /opt/rocm/lib/libamd_smi.so and is registered with the dynamic linker via ldconfig. |
libamd_smi.so resolved by the dynamic linker (SONAME). |
| TheRock native package, tarball, or ROCm pip install | The wrapper under <root>/share/amd_smi/amdsmi; add <root>/share/amd_smi to PYTHONPATH for direct imports. |
<root>/lib/libamd_smi.so.<MAJOR>, resolved relative to the wrapper. |
| Community-built PyPI releases through 7.0.2 | Only the Python wrapper in <site-packages>/amdsmi/. Its version must match the ROCm release providing the library. |
Matching ROCm libamd_smi.so; the legacy loader checks ROCM_HOME before ROCM_PATH. |
Bundled-library wheel (BUILD_PYTHON_WHEEL=ON) |
The wrapper plus a SONAME-renamed libamd_smi_python.so directly inside <site-packages>/amdsmi/. |
libamd_smi_python.so next to the wrapper. |
AMD SMI 27.x wheels built by the manylinux workflow include the native library and use the AMD SMI library version, not the ROCm release number. The community-built PyPI releases through 7.0.2 predate that packaging and require a matching older ROCm library. Do not use those wrappers with arbitrary newer AMD SMI libraries. See the installation guide for the available delivery channels.
The manylinux wheel needs the dynamically loaded libdrm_amdgpu for
DRM-backed GPU queries: install libdrm-amdgpu1 on
Debian/Ubuntu, libdrm on RHEL/AlmaLinux/Rocky, or libdrm_amdgpu1 on
SLES/openSUSE. Missing it can leave some query results unavailable or incorrect
even when GPU discovery succeeds.
For raw source-built wheel dependencies, see Packaging and install paths.
When a bundled-library wheel and system package coexist, Python's import
path selects the wrapper. The wheel's wrapper loads its bundled
libamd_smi_python.so and disables system fallback. The distinct SONAME
and -Bsymbolic-functions isolate it from the system libamd_smi.so.
PYTHONPATH takes precedence over site-packages, so point it only at the
wrapper you intend to use.
Environment variables
| Variable | Purpose |
|---|---|
AMDSMI_LIB_OVERRIDE |
Absolute path to a libamd_smi*.so to load instead of the auto-detected one. Intended for local development against an in-tree build (e.g. AMDSMI_LIB_OVERRIDE=$PWD/build/libamd_smi.so python3 -c "import amdsmi") and for ABI-compatibility tests that need to point the wrapper at a curated alternate library. When set, it takes precedence over both the pip-bundled and system libraries. |
The legacy PyPI wrappers do not implement AMDSMI_LIB_OVERRIDE or the
current missing-library behavior described below.
Diagnose a load failure
If import amdsmi succeeds but the first amdsmi_* call raises
OSError, the wrapper installed a _MissingLibrary sentinel because the
shared library could not be loaded. The module still imports so that
doc/lint tooling works without a runtime ROCm install; any call into a
wrapped C symbol raises:
OSError: AMD SMI shared library could not be loaded.
Underlying error: <dlopen error from ctypes.CDLL>
Hint: install amd-smi-lib (rpm/deb) or pip-install the amdsmi wheel.
The Underlying error text is the platform-dependent OSError string
from ctypes.CDLL (e.g. cannot open shared object file: No such file or directory on glibc). To load a specific library explicitly, set
AMDSMI_LIB_OVERRIDE to its absolute path.
Metadata
Release files for amdsmi 27.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| amdsmi-27.2.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl | Python 3 | none | Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 | Details for amdsmi-27.2.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
Release files / amdsmi-27.2.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | amdsmi-27.2.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
28426ebfbd9121d41e10f214463805007eb166d17356f65388911f1d1a20dfc7
|
|
BLAKE2b-256 checksum How to use checksums |
910af1f4c1050ea6ea738f878f8c87ecc47102720cf601cf00e242c405132d95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.12
|
Security for amdsmi 27.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.