File tree Expand file tree Collapse file tree
gpustack_runtime/detector/pyrocmsmi Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55# https://rocm.docs.amd.com/projects/rocm_smi_lib/en/latest/doxygen/html/rocm__smi_8h.html.
66from __future__ import annotations as __future_annotations__
77
8+ import contextlib
89import os
910import sys
1011import threading
2526if not rocmsmi_lib_path :
2627 rocm_path = Path (os .getenv ("ROCM_HOME" , os .getenv ("ROCM_PATH" ) or "/opt/rocm" ))
2728 rocmsmi_lib_path = str (rocm_path / "lib" )
28- if not Path (rocmsmi_lib_path ).exists ():
29+ if not ( Path (rocmsmi_lib_path ) / "librocm_smi64.so" ).exists ():
2930 rocmsmi_lib_path = str (rocm_path / "rocm_smi" / "lib" )
3031else :
3132 rocm_path = Path (
5455 if str (rocmsmi_bindings_path ) not in sys .path :
5556 sys .path .append (str (rocmsmi_bindings_path ))
5657 try :
57- from rsmiBindings import *
58+ with (
59+ Path (os .devnull ).open ("w" ) as dev_null ,
60+ contextlib .redirect_stdout (dev_null ),
61+ ):
62+ from rsmiBindings import *
5863 except ImportError :
5964 pass
6065
You can’t perform that action at this time.
0 commit comments