File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
gpustack_runtime/detector/pyrocmsmi Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change 4646 rocmsmi_bindings_path = p
4747 break
4848
49+ # Refer to https://github.com/ROCm/rocm_smi_lib/blob/amd-staging_deprecated/python_smi_tools/rsmiBindings.py.
50+ # Add bindings path to sys.path for importing rsmiBindings
51+ if rocmsmi_bindings_path and rocmsmi_bindings_path .exists ():
52+ if str (rocmsmi_bindings_path ) not in sys .path :
53+ sys .path .append (str (rocmsmi_bindings_path ))
54+ try :
55+ from rsmiBindings import *
56+ except ImportError :
57+ pass
58+
4959## Enums ##
5060ROCMSMI_IOLINK_TYPE_UNDEFINED = 0
5161ROCMSMI_IOLINK_TYPE_PCIE = 1
@@ -78,13 +88,6 @@ def _LoadRocmSmiLibrary():
7888 and rocmsmi_lib_loc .is_file ()
7989 ):
8090 try :
81- # Refer to https://github.com/ROCm/rocm_smi_lib/blob/amd-staging_deprecated/python_smi_tools/rsmiBindings.py.
82- # Add bindings path to sys.path for importing rsmiBindings
83- if rocmsmi_bindings_path and rocmsmi_bindings_path .exists ():
84- if str (rocmsmi_bindings_path ) not in sys .path :
85- sys .path .append (str (rocmsmi_bindings_path ))
86- from rsmiBindings import *
87-
8891 rocmsmiLib = CDLL (str (rocmsmi_lib_loc ))
8992 except OSError :
9093 pass
You can’t perform that action at this time.
0 commit comments