Skip to main content

vram_threshold_warning

Function vram_threshold_warning 

Source
pub fn vram_threshold_warning(caps: &WorkerCapabilities) -> Option<String>
Expand description

Operator-facing warning when the configured VRAM threshold exceeds the GPU VRAM the worker actually detected.

The studio matches jobs to a worker purely by its advertised vram_threshold_gb, so a threshold set above the card’s real capacity — e.g. the default 12 GB on an 8 GB consumer GPU — makes the worker accept jobs its GPU can’t fit: they load, exhaust VRAM, and fail with an OOM the operator then has to trace back to a config value. Surfacing it on the handshake (one line next to the capability summary) turns a silent OOM-on-claim into an actionable “lower your threshold” breadcrumb.

Only fires when the VRAM probe returned a real positive total: a detected 0 GB means the probe failed (no nvidia-smi / sysfs tree, or a non-NVIDIA GPU we can’t size), where the threshold is the only capacity signal we have and second-guessing it would be wrong. The boundary is strict (threshold > total), so a threshold that exactly matches the card stays silent. Pure so the wording + boundary are unit-tested without a live GPU.