Skip to main content

Module model

Module model 

Source
Expand description

Core data model. Every metric is Option<T>: absence (NOT_SUPPORTED, missing sysfs file, privilege wall) is a normal per-metric outcome, never an error.

Structs§

DeviceId
Stable device identity. For PCI devices this is the PCI address (0000:01:00.0) so the same physical GPU dedupes across backends; platform devices (Apple) use a platform key.
DynamicSample
One per-tick sample of a device (nvtop’s refresh_dynamic_info split).
ProcessSample
Per-process attribution (nvtop’s refresh_running_processes split).
StaticInfo
Queried once per device at startup (nvtop’s populate_static_info split).
ThrottleReasons
Decoded throttle/clocks-event reasons. Decoding is tolerant: unknown future bits land in other instead of failing (NVML renamed/extended these bits across versions).

Enums§

ProcessKind
Vendor

Functions§

fmt_bytes
Human formatting helpers shared by frontends.
normalize_pci_id
Normalize a PCI address (domain:bus:dev.func) for cross-backend dedupe: NVML reports 00000000:01:00.0 while sysfs and D3DKMT-derived ids report 0000:01:00.0 — the same physical GPU. Lowercase everything; trim/zero-pad the domain to 4 hex digits (a genuinely >16-bit domain keeps its extra digits — all sources print those the same way). Returns None for anything that isn’t a PCI address (mock:…, wddm:…, apple:…, nvml:0 fallback ids) — those are never deduped: wrongly merging two distinct devices is worse than listing one twice.
now_ms