Fix crash when running without CUDA

This commit is contained in:
Charles Goddard
2023-08-13 13:19:48 -07:00
committed by Aman Gupta Karmani
parent 729c299256
commit 15f6e57eaa

View File

@@ -28,6 +28,9 @@ def gpu_memory_usage_smi(device=0):
def log_gpu_memory_usage(log, msg, device):
if not torch.cuda.is_available():
return (0, 0, 0)
usage, cache, misc = gpu_memory_usage_all(device)
extras = []
if cache > 0: