Registry / devops / pyrsmi

pyrsmi

JSON →
library1.1.0pypypi✓ verified 82d ago

Python bindings for AMD ROCm System Management Interface (SMI). Provides programmatic access to AMD GPU metrics such as temperature, power, memory usage, and PCIe status. Current version 1.1.0, released April 2025. Active development, monthly releases.

pip install pyrsmi
INSTALL
IMPORT
SIG · PYRSMI
P
pyrsmi
devopspythonv1.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

rsmi
import pyrsmi
import pyrsmi.rsmi as rsmi

Initialize RSMI, enumerate AMD GPUs, print their current temperatures, and shutdown.

import pyrsmi.rsmi as rsmi rsmi.rsmi_init(0) count = rsmi.rsmi_num_monitor_devices() print(f"Found {count} AMD GPU(s)") for i in range(count): temp, _ = rsmi.rsmi_dev_temp_metric_get(i, 0, rsmi.RSMI_TEMP_CURRENT) print(f"GPU {i} temp: {temp}°C") rsmi.rsmi_shut_down()
Debug
Known issues
gotchaMust call rsmi_init() before any other function, and rsmi_shut_down() at the end. Failure to do so leads to crashes or undefined behavior.
fix
Wrap usage with init/shutdown calls, or use context manager if available.
affects: all
gotcharsmi_init(0) expects 0 as the initialization flag. Passing other values may cause initialization failure.
fix
Always use 0 for default initialization.
affects: all
gotchaFunctions like rsmi_dev_temp_metric_get return a tuple (metric_value, err_code). Always check err_code for success (0). Ignoring return code can result in silent errors.
fix
Check return status (0 == RSMI_STATUS_SUCCESS) after each call.
affects: all
gotchaNot all AMD GPUs are supported. Older or consumer cards (e.g., Radeon RX series) may not work with RSMI. Only official ROCm-supported GPUs (mostly MI series and some Radeon Pro) are guaranteed.
fix
Verify GPU compatibility at https://rocm.docs.amd.com/en/latest/release/gpu_os_support.html
affects: all
Upgrade
Version history
1.1.0latest on PyPI · released Dec 3, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
14
Resources
pyrsmi — pip install pyrsmi · libregistry