Skip to content

Commit 7bfe32a

Browse files
authored
Merge pull request #62 from WojtekKowaluk/no-cuda-fix
skip cuda mem_get_info if cuda is not available
2 parents a4cc8df + e00dfcc commit 7bfe32a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: src/ui_blocks/settings.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
def update_info():
1313
torch_version = torch.__version__
1414
cuda_version = torch.version.cuda
15-
torch_free, torch_total = torch.cuda.mem_get_info()
15+
if torch.cuda.is_available():
16+
torch_free, torch_total = torch.cuda.mem_get_info()
17+
else:
18+
torch_free, torch_total = 0, 0
1619
vmem = psutil.virtual_memory()
1720
ram_total = vmem.total
1821
ram_available = vmem.available

0 commit comments

Comments
 (0)