Skip to content

Commit 783ca59

Browse files
yasinBursaliclaude
andcommitted
fix: guard VRAM division by zero in Dashboard and Models pages
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 29a5265 commit 783ca59

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

dream-server/extensions/services/dashboard-api/routers/voice.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ async def voice_status(api_key: str = Depends(verify_api_key)):
2929
result = await check_service_health(svc_key, cfg)
3030
services_status[display_name] = {"status": result.status}
3131
except Exception:
32+
logger.warning("Health check failed for %s", svc_key)
3233
services_status[display_name] = {"status": "unavailable"}
3334
else:
3435
services_status[display_name] = {"status": "not_configured"}
@@ -40,6 +41,7 @@ async def voice_status(api_key: str = Depends(verify_api_key)):
4041
result = await check_service_health("livekit", livekit_cfg)
4142
services_status["livekit"] = {"status": result.status}
4243
except Exception:
44+
logger.warning("Health check failed for livekit")
4345
services_status["livekit"] = {"status": "unavailable"}
4446
else:
4547
services_status["livekit"] = {"status": "not_configured"}

dream-server/extensions/services/dashboard/src/pages/Dashboard.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ export default function Dashboard({ status, loading }) {
263263
label: 'VRAM',
264264
value: `${status.gpu.vramUsed.toFixed(1)} GB`,
265265
subvalue: `of ${status.gpu.vramTotal} GB`,
266-
percent: (status.gpu.vramUsed / status.gpu.vramTotal) * 100,
266+
percent: status.gpu.vramTotal > 0 ? (status.gpu.vramUsed / status.gpu.vramTotal) * 100 : 0,
267267
})
268268
}
269269
}

dream-server/extensions/services/dashboard/src/pages/Models.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ export default function Models() {
6969
<div className="h-2 bg-theme-border rounded-full overflow-hidden">
7070
<div
7171
className={`h-full rounded-full transition-all ${
72-
(gpu.vramUsed / gpu.vramTotal) > 0.9 ? 'bg-red-500' :
73-
(gpu.vramUsed / gpu.vramTotal) > 0.7 ? 'bg-yellow-500' : 'bg-theme-accent'
72+
(gpu.vramTotal > 0 ? gpu.vramUsed / gpu.vramTotal : 0) > 0.9 ? 'bg-red-500' :
73+
(gpu.vramTotal > 0 ? gpu.vramUsed / gpu.vramTotal : 0) > 0.7 ? 'bg-yellow-500' : 'bg-theme-accent'
7474
}`}
75-
style={{ width: `${(gpu.vramUsed / gpu.vramTotal) * 100}%` }}
75+
style={{ width: `${gpu.vramTotal > 0 ? (gpu.vramUsed / gpu.vramTotal) * 100 : 0}%` }}
7676
/>
7777
</div>
7878
<p className="text-xs text-theme-text-muted mt-2">

0 commit comments

Comments
 (0)