Skip to content

Commit 27430b9

Browse files
committed
refactor: catch all exepctions during supported testing
Signed-off-by: thxCode <thxcode0824@gmail.com>
1 parent c905656 commit 27430b9

File tree

8 files changed

+9
-9
lines changed

8 files changed

+9
-9
lines changed

gpustack_runtime/detector/amd.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def is_supported() -> bool:
5959
try:
6060
pyamdsmi.amdsmi_init()
6161
supported = True
62-
except pyamdsmi.AmdSmiException:
62+
except Exception:
6363
debug_log_exception(logger, "Failed to initialize AMD SMI")
6464

6565
return supported
@@ -99,7 +99,7 @@ def detect(self) -> Devices | None:
9999
pyamdsmi.amdsmi_init()
100100
try:
101101
pyrocmsmi.rsmi_init()
102-
except pyrocmsmi.ROCMSMIError:
102+
except Exception:
103103
debug_log_exception(logger, "Failed to initialize ROCm SMI")
104104

105105
sys_runtime_ver_original = pyrocmcore.getROCmVersion()

gpustack_runtime/detector/ascend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def is_supported() -> bool:
7272
try:
7373
pydcmi.dcmi_init()
7474
supported = True
75-
except pydcmi.DCMIError:
75+
except Exception:
7676
debug_log_exception(logger, "Failed to initialize DCMI")
7777

7878
return supported

gpustack_runtime/detector/hygon.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def is_supported() -> bool:
5959
try:
6060
pyrocmsmi.rsmi_init()
6161
supported = True
62-
except pyrocmsmi.ROCMSMIError:
62+
except Exception:
6363
debug_log_exception(logger, "Failed to initialize ROCM SMI")
6464

6565
return supported

gpustack_runtime/detector/iluvatar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def is_supported() -> bool:
6060
try:
6161
pyixml.nvmlInit()
6262
supported = True
63-
except pyixml.NVMLError:
63+
except Exception:
6464
debug_log_exception(logger, "Failed to initialize IXML")
6565

6666
return supported

gpustack_runtime/detector/metax.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def is_supported() -> bool:
7373
try:
7474
pymxsml.mxSmlInit()
7575
supported = True
76-
except pymxsml.MXSMLError:
76+
except Exception:
7777
debug_log_exception(logger, "Failed to initialize MXSML")
7878

7979
return supported

gpustack_runtime/detector/mthreads.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def is_supported() -> bool:
6969
try:
7070
pymtml.mtmlLibraryInit()
7171
supported = True
72-
except pymtml.MTMLError:
72+
except Exception:
7373
debug_log_exception(logger, "Failed to initialize MTML")
7474

7575
return supported

gpustack_runtime/detector/nvidia.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def is_supported() -> bool:
5959
try:
6060
pynvml.nvmlInit()
6161
supported = True
62-
except pynvml.NVMLError:
62+
except Exception:
6363
debug_log_exception(logger, "Failed to initialize NVML")
6464

6565
return supported

gpustack_runtime/detector/thead.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def is_supported() -> bool:
6363
try:
6464
pyhgml.hgmlInit()
6565
supported = True
66-
except pyhgml.HGMLError:
66+
except Exception:
6767
debug_log_exception(logger, "Failed to initialize HGML")
6868

6969
return supported

0 commit comments

Comments
 (0)