Skip to content

Commit

Permalink
Check for amdsmi.
Browse files Browse the repository at this point in the history
  • Loading branch information
bethune-bryant committed Aug 2, 2024
1 parent 3e0c2b1 commit 173d144
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
30 changes: 29 additions & 1 deletion gpustat/rocml.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,35 @@
from collections import namedtuple


from amdsmi import *



try:
# Check for amdsmi.
from amdsmi import *
except (ImportError, SyntaxError, RuntimeError) as e:
_amdsmi = sys.modules.get('amdsmi', None)

raise ImportError(textwrap.dedent(
"""\
amdsmi is missing or an outdated version is installed.
The root cause: """ + str(e) +
"""
Your pynvml installation: """ + repr(_amdsmi) +
"""
-----------------------------------------------------------
(Suggested Fix) Please install amdsmi.
It should be installed with amdgpu. But if not, please see:
https://github.com/ROCm/amdsmi#manualmultiple-rocm-instance-python-library-install
apt install amd-smi-lib
cd /opt/rocm/share/amd_smi
python3 -m pip install --upgrade pip
python3 -m pip install --user .
""")) from e

NVML_TEMPERATURE_GPU = 1

Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ def run(self):

install_requires = [
'nvidia-ml-py>=12.535.108', # see #107, #143, #161
'amdsmi', #137
'psutil>=5.6.0', # GH-1447
'blessed>=1.17.1', # GH-126
'typing_extensions',
Expand Down

0 comments on commit 173d144

Please sign in to comment.