Skip to content

Commit b2811f0

Browse files
committed
Fix 0 GPUs bug
1 parent 01f8c0b commit b2811f0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

simvue/eco/emissions_monitor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def __init__(self, *args, **kwargs) -> None:
108108
)
109109

110110
if not isinstance(kwargs.get("thermal_design_power_per_gpu"), float):
111-
kwargs["thermal_design_power_per_gpu"] = 80.0
111+
kwargs["thermal_design_power_per_gpu"] = 130.0
112112
_logger.warning(
113113
"⚠️ No TDP value provided for current GPUs, will use arbitrary value of 130W."
114114
)

simvue/metrics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ def to_dict(self) -> dict[str, float]:
177177

178178
@property
179179
def gpu_percent(self) -> float:
180-
return sum(m[0] for m in self.gpus) / (len(self.gpus) or 1)
180+
return sum(m[0] for m in self.gpus or []) / (len(self.gpus or []) or 1)
181181

182182
@property
183183
def gpu_memory(self) -> float:
184-
return sum(m[1] for m in self.gpus) / (len(self.gpus) or 1)
184+
return sum(m[1] for m in self.gpus or []) / (len(self.gpus or []) or 1)

0 commit comments

Comments
 (0)