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§
- Device
Id - 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. - Dynamic
Sample - One per-tick sample of a device (nvtop’s
refresh_dynamic_infosplit). - Process
Sample - Per-process attribution (nvtop’s
refresh_running_processessplit). - Static
Info - Queried once per device at startup (nvtop’s
populate_static_infosplit). - Throttle
Reasons - Decoded throttle/clocks-event reasons. Decoding is tolerant: unknown future bits land in
otherinstead of failing (NVML renamed/extended these bits across versions).
Enums§
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 reports00000000:01:00.0while sysfs and D3DKMT-derived ids report0000: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). ReturnsNonefor anything that isn’t a PCI address (mock:…,wddm:…,apple:…,nvml:0fallback ids) — those are never deduped: wrongly merging two distinct devices is worse than listing one twice. - now_ms