concerto_gpu/lib.rs
1//! # concerto-gpu
2//!
3//! GPU monitoring abstractions for Concerto.
4//!
5//! This crate provides the [`GpuMonitor`] trait, which abstracts over the source
6//! of GPU telemetry (NVML, mock, or anything else), and two implementations:
7//!
8//! - [`MockGpuMonitor`] — a configurable in-memory monitor used in all tests and
9//! for development without real GPU hardware.
10//! - `NvmlMonitor` — a real NVML-backed monitor, gated behind the `nvml`
11//! feature and only available on Linux. See the `nvml` module for platform
12//! caveats.
13//!
14//! The trait is deliberately minimal: callers drive snapshots from the outside,
15//! which keeps the implementation trivially testable and leaves caching/interval
16//! policy to higher layers.
17
18pub mod health;
19pub mod mock;
20pub mod monitor;
21
22#[cfg(feature = "nvml")]
23pub mod nvml;
24
25pub use health::{classify_health, HealthThresholds};
26pub use mock::MockGpuMonitor;
27pub use monitor::{GpuMonitor, GpuMonitorError, GpuSnapshot};
28
29#[cfg(all(feature = "nvml", target_os = "linux"))]
30pub use nvml::NvmlMonitor;