Skip to content

Commit 12ed0b2

Browse files
committed
Fix regression caused by previous commit
Fixes the problem: Command ‘[‘C:/Users/Akmal/AppData/Local/NA-MIC/Slicer 5.2.1/bin/…/bin\PythonSlicer.EXE’, ‘-m’, ‘light_the_torch’, ‘install’, ‘torch’]’ returned non-zero exit status 1.
1 parent 2efe0c7 commit 12ed0b2

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

PyTorchUtils/PyTorchUtils.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ def nvidiaDriverVersionInformation(self):
110110
import light_the_torch._cb as computationBackend
111111
return f"installed version {str(computationBackend._detect_nvidia_driver_version())}"
112112
except Exception as e:
113+
# Don't install light-the-torch just for getting the NVIDIA driver version
113114
return ""
114115

115116
@property
@@ -177,6 +178,12 @@ def installTorch(self, askConfirmation=False, forceComputationBackend=None):
177178
logging.info('Installation of PyTorch aborted by user')
178179
return None
179180

181+
try:
182+
import light_the_torch._patch
183+
except:
184+
PyTorchUtilsLogic._installLightTheTorch()
185+
import light_the_torch._patch
186+
180187
slicer.util._executePythonModule('light_the_torch', args)
181188
import torch
182189
logging.info(f'PyTorch {torch.__version__} installed successfully.')

0 commit comments

Comments
 (0)