Skip to main content

GpuMetrics

Struct GpuMetrics 

Source
pub struct GpuMetrics {
Show 13 fields pub uuid: String, pub name: String, pub device_type: String, pub host_id: String, pub detail: HashMap<String, String>, pub utilization_pct: f64, pub vram_total_bytes: u64, pub vram_used_bytes: u64, pub vram_used_pct: f64, pub temperature_celsius: u32, pub power_watts: f64, pub frequency_mhz: u32, pub core_count: Option<u32>,
}
Expand description

Per-GPU metrics sourced from all-smi (NVIDIA NVML / AMD / TPU / …). Populated only when a supported GPU library is detected at runtime; an empty Vec means no GPUs are present or no driver is installed.

Fields§

§uuid: String

Vendor-assigned device UUID (stable across reboots for physical GPUs).

§name: String

Human-readable device name, e.g. “NVIDIA GeForce RTX 4090”.

§device_type: String

Device class reported by all-smi: “GPU”, “NPU”, “TPU”, etc. Equivalent to the “kind” of accelerator.

§host_id: String

Host-level device identifier (slot, bus address, or platform index).

§detail: HashMap<String, String>

Additional platform-specific identity fields keyed by the driver. For NVIDIA these typically include PCI device/vendor IDs and the driver version; for AMD, the ASIC name and PCIe topology; for TPU, the chip revision. Keys and values vary by vendor.

§utilization_pct: f64

Core utilisation (0.0–100.0).

§vram_total_bytes: u64

Total VRAM in bytes.

§vram_used_bytes: u64

Used VRAM in bytes.

§vram_used_pct: f64

Fraction of VRAM in use (0.0–100.0).

§temperature_celsius: u32

Die temperature in degrees Celsius.

§power_watts: f64

Power draw in watts.

§frequency_mhz: u32

Core clock frequency in MHz.

§core_count: Option<u32>

Number of shader/compute cores, if reported by the driver.

Trait Implementations§

Source§

impl Clone for GpuMetrics

Source§

fn clone(&self) -> GpuMetrics

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GpuMetrics

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for GpuMetrics

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for GpuMetrics

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,