pub struct HardwareProfile {
pub cpu_logical_cores: usize,
pub host_ram_total_bytes: u64,
pub simd: SimdCaps,
pub cuda_available: bool,
pub cuda_device_count: usize,
pub cuda_device_name: Option<String>,
pub cuda_vram_total_bytes: u64,
pub cuda_vram_free_bytes: u64,
}Expand description
A snapshot of the host’s inference-relevant capabilities. CPU/RAM
fields are always real; CUDA fields are always present but only
ever non-default when built with --features cuda on a host that
actually has a CUDA-capable device.
Fields§
§cpu_logical_cores: usize§host_ram_total_bytes: u64§simd: SimdCaps§cuda_available: bool§cuda_device_count: usize§cuda_device_name: Option<String>§cuda_vram_total_bytes: u64§cuda_vram_free_bytes: u64Free device memory at probe time (cuMemGetInfo’s first half).
Zero without --features cuda or without a device, exactly like
the other CUDA fields. A memory budget should be drawn against
this rather than the total – see
ferrox_models::device_budget.
Implementations§
Source§impl HardwareProfile
impl HardwareProfile
Sourcepub fn detect() -> Self
pub fn detect() -> Self
Probe the machine. Cheap and side-effect-free on the CPU side;
the CUDA probe (when built with --features cuda) opens a
driver context to enumerate devices and degrades to “no CUDA”
cleanly on hosts without one, in the exact form the fields
below already represent for a CPU-only build.
Trait Implementations§
Source§impl Clone for HardwareProfile
impl Clone for HardwareProfile
Source§fn clone(&self) -> HardwareProfile
fn clone(&self) -> HardwareProfile
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more