Skip to content

Commit e9aa17f

Browse files
committed
handle no nvidia-smi
1 parent 1ef9713 commit e9aa17f

2 files changed

Lines changed: 15 additions & 12 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "fishfeats"
7-
version = "1.4.2"
7+
version = "1.4.3"
88
description = "Napari plugin for RNA-Fish+cells analysis pipeline"
99
license.file = "LICENSE"
1010
readme = "README.md"

src/fish_feats/Utils.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -803,17 +803,20 @@ def get_env_name():
803803
def get_cuda_feature():
804804
""" Get the drivers cuda version through nvidia-smi and build the relevant feature for pixi """
805805
import subprocess, re
806-
result = subprocess.run(['nvidia-smi'], capture_output=True, text=True)
807-
match = re.search(r'CUDA Version:\s+([\d.]+)', result.stdout)
808-
if match:
809-
cuda_version = match.group(1)
810-
811-
## get only major version
812-
if cuda_version.split( "." )[0] == "12":
813-
return "cu126"
814-
if cuda_version.split( "." )[0] == "13":
815-
return "cu130"
816-
return "cpu"
806+
try:
807+
result = subprocess.run(['nvidia-smi'], capture_output=True, text=True)
808+
match = re.search(r'CUDA Version:\s+([\d.]+)', result.stdout)
809+
if match:
810+
cuda_version = match.group(1)
811+
812+
## get only major version
813+
if cuda_version.split( "." )[0] == "12":
814+
return "cu126"
815+
if cuda_version.split( "." )[0] == "13":
816+
return "cu130"
817+
return "cpu"
818+
except:
819+
return "cpu"
817820

818821
#### Handle versions of napari
819822
def version_napari_above( compare_version ):

0 commit comments

Comments
 (0)