Expand description
Host-system probes: hostname, OS user, VRAM.
Every probe emits a structured tracing breadcrumb so an operator can
tell from the logs why a worker reports the values it does (in
particular, why VRAM came back as 0.0 — was the sysfs tree missing,
present-but-unparseable, or is the worker running on a non-Linux
host?). Silent 0.0 makes “this worker claims nothing” impossible
to diagnose from logs alone.
Functions§
- detect_
vram_ gb - Detect physical VRAM on the host, in GB. Returns 0.0 when we can’t probe (no NVIDIA GPU, no driver) — the engine still runs in synthetic mode for low-end / CI machines.
- detect_
vram_ gb_ from_ amd_ sysfs - Sum VRAM across every AMD/Intel-discrete GPU exposed under the DRM
sysfs tree (
<root>/card*/device/mem_info_vram_total, a byte count). Integrated GPUs and drivers that don’t publish the file simply contribute nothing, so an iGPU-only box returns 0 and the caller keeps the configured threshold as its only signal. - detect_
vram_ gb_ from_ sysfs - VRAM probe driven by a configurable sysfs root. Public-in-crate so
the integration tests can exercise both the “missing root” and
“populated root” branches without a real
/proc/driver/nvidiatree. - machine_
name - parse_
amd_ vram_ total_ bytes - Parse an AMD
mem_info_vram_totalfile: a single decimal byte count, possibly with trailing whitespace. - parse_
sysctl_ memsize - Parse
sysctl -n hw.memsize(total RAM in bytes) into a usable VRAM figure for Apple unified memory.fractionis the share of unified memory we treat as GPU-addressable (macOS lets the GPU use most of it; 0.75 is a conservative, widely-cited figure). - parse_
wmic_ adapter_ ram - Sum the
AdapterRAMvalues from a Windows CIM/WMICWin32_VideoControllerdump (one integer per adapter, bytes). Ignores non-numeric lines (headers, blanks) so it tolerates bothwmicand PowerShellGet-CimInstanceoutput shapes. - username