Spaces:
Running on Zero
Running on Zero
Z User commited on
Commit ·
5b1e26f
1
Parent(s): ee68165
Fix: AttributeError total_mem -> total_memory in system monitor
Browse files- torch.cuda.get_device_properties() returns SimpleNamespace with .total_memory (not .total_mem)
- Fixes crash when opening System Monitor tab
app.py
CHANGED
|
@@ -1383,7 +1383,7 @@ def get_system_info() -> dict:
|
|
| 1383 |
"torch_version": torch.__version__,
|
| 1384 |
"cuda_available": torch.cuda.is_available(),
|
| 1385 |
"gpu_name": torch.cuda.get_device_name(0) if torch.cuda.is_available() else "N/A",
|
| 1386 |
-
"gpu_memory_total": f"{torch.cuda.get_device_properties(0).
|
| 1387 |
"gpu_memory_allocated": f"{torch.cuda.memory_allocated() / 1024**3:.2f} GB" if torch.cuda.is_available() else "N/A",
|
| 1388 |
"gpu_memory_reserved": f"{torch.cuda.memory_reserved() / 1024**3:.2f} GB" if torch.cuda.is_available() else "N/A",
|
| 1389 |
"is_zero_gpu": IS_ZERO_GPU,
|
|
|
|
| 1383 |
"torch_version": torch.__version__,
|
| 1384 |
"cuda_available": torch.cuda.is_available(),
|
| 1385 |
"gpu_name": torch.cuda.get_device_name(0) if torch.cuda.is_available() else "N/A",
|
| 1386 |
+
"gpu_memory_total": f"{torch.cuda.get_device_properties(0).total_memory / 1024**3:.1f} GB" if torch.cuda.is_available() else "N/A",
|
| 1387 |
"gpu_memory_allocated": f"{torch.cuda.memory_allocated() / 1024**3:.2f} GB" if torch.cuda.is_available() else "N/A",
|
| 1388 |
"gpu_memory_reserved": f"{torch.cuda.memory_reserved() / 1024**3:.2f} GB" if torch.cuda.is_available() else "N/A",
|
| 1389 |
"is_zero_gpu": IS_ZERO_GPU,
|