Skip to content

Commit ebeaeab

Browse files
committed
fix ci
Signed-off-by: YunLiu <[email protected]>
1 parent b72220a commit ebeaeab

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

monai/utils/module.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -655,16 +655,12 @@ def compute_capabilities_after(major: int, minor: int = 0, current_ver_string: s
655655
pynvml, has_pynvml = optional_import("pynvml")
656656
if not has_pynvml: # assuming that the user has Ampere and later GPU
657657
return True
658-
659-
try:
660-
pynvml.nvmlInit()
661-
handle = pynvml.nvmlDeviceGetHandleByIndex(0) # get the first GPU
662-
major_c, minor_c = pynvml.nvmlDeviceGetCudaComputeCapability(handle)
663-
current_ver_string = f"{major_c}.{minor_c}"
664-
except BaseException:
665-
pass
666-
finally:
667-
pynvml.nvmlShutdown()
658+
659+
pynvml.nvmlInit()
660+
handle = pynvml.nvmlDeviceGetHandleByIndex(0) # get the first GPU
661+
major_c, minor_c = pynvml.nvmlDeviceGetCudaComputeCapability(handle)
662+
current_ver_string = f"{major_c}.{minor_c}"
663+
pynvml.nvmlShutdown()
668664

669665
ver, has_ver = optional_import("packaging.version", name="parse")
670666
if has_ver:

0 commit comments

Comments
 (0)