pub struct Hardware {
pub gpu: String,
pub driver: String,
pub sm_clock_mhz: Option<f64>,
pub gpu_count: Option<u32>,
pub source: String,
}Expand description
2026-09-26: A box’s fingerprint, as its serving endpoint reported it or
as Hardware::probe read it.
Fields§
§gpu: String2026-09-26: Device model, e.g. “NVIDIA GB10”, or pci:<vendor>:<device>
from sysfs. Empty when unknown.
driver: String2026-09-26: Driver version, e.g. “580.126.09”. Empty when unknown.
sm_clock_mhz: Option<f64>2026-09-26: GPU clock in MHz at probe time: nvidia-smi’s clocks.sm,
or the clock rocm-smi --showclocks reports. None for [N/A], an
unparseable cell, and every sysfs reading.
gpu_count: Option<u32>2026-09-26: How many GPUs the box exposed at probe time, counted from
nvidia-smi -L (parse::gpu_count); gpu names only the first. None
means unmeasured, never one: rocm-smi and sysfs leave it None, and it
is left out of the JSON.
source: String2026-09-26: Where the reading came from (“nvidia-smi”, “rocm-smi”, “sysfs”). Empty when unknown.
Implementations§
Source§impl Hardware
impl Hardware
pub fn unknown() -> Self
Sourcepub fn gate_key(&self) -> String
pub fn gate_key(&self) -> String
2026-09-26: The box-class key a gate baseline is indexed by, e.g.
"gb10": a class, not a host.
A name with a token in the SKU table (ids::hardware_id_from_gpu_name)
gets that id, so "NVIDIA H100 80GB HBM3" is h100. Any other name is
lowercased with nvidia and amd removed and only alphanumerics kept.
An empty gpu, or a name that leaves nothing, gives "unknown", which
no baseline defines; fetch_hardware returns Hardware::unknown on
every error path without surfacing one.
Sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
2026-09-26: True when gpu, driver and sm_clock_mhz are all empty;
gpu_count and source are not consulted.
Sourcepub fn one_line(&self) -> String
pub fn one_line(&self) -> String
2026-09-26: One-line summary for reports, e.g. “NVIDIA GB10 · driver
580.126.09 · sm 208 MHz”; a GPU count above one follows the part as
×n.
Sourcepub fn probe() -> Self
pub fn probe() -> Self
2026-09-26: Probe the local box: nvidia-smi, then rocm-smi, then
sysfs, returning the first that answers, or Hardware::unknown.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Hardware
impl<'de> Deserialize<'de> for Hardware
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for Hardware
Auto Trait Implementations§
impl Freeze for Hardware
impl RefUnwindSafe for Hardware
impl Send for Hardware
impl Sync for Hardware
impl Unpin for Hardware
impl UnwindSafe for Hardware
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more