Snakepit.Telemetry.GPUProfiler (Snakepit v0.8.7)
View SourceGPU memory and utilization profiler.
Periodically samples GPU metrics and emits telemetry events. Supports NVIDIA CUDA GPUs via nvidia-smi.
Summary
Functions
Returns a specification to start this module under a supervisor.
Disables GPU sampling.
Enables GPU sampling.
Returns profiler statistics.
Triggers an immediate GPU sample.
Updates the sampling interval.
Starts the GPU profiler.
Types
@type state() :: %{ interval_ms: pos_integer(), enabled: boolean(), sample_count: non_neg_integer(), last_sample_time: integer() | nil, timer_ref: reference() | nil, devices: [Snakepit.Hardware.Selector.device()] }
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec disable(GenServer.server()) :: :ok
Disables GPU sampling.
@spec enable(GenServer.server()) :: :ok
Enables GPU sampling.
@spec get_stats(GenServer.server()) :: map()
Returns profiler statistics.
@spec sample_now(GenServer.server()) :: :ok | {:error, :no_gpu}
Triggers an immediate GPU sample.
@spec set_interval(GenServer.server(), pos_integer()) :: :ok | {:error, :invalid_interval}
Updates the sampling interval.
@spec start_link(keyword()) :: GenServer.on_start()
Starts the GPU profiler.
Options
:interval_ms- Sampling interval in milliseconds (default: 5000):enabled- Whether to start sampling immediately (default: true):name- GenServer name (default: MODULE)