Documentation
¶
Overview ¶
This file implements the NVML collectors (cgo; requires a dynamically linked binary). Per device:
- hw.gpu.utilization and nvidia.gpu.memory_copy.utilization (sampled, with a current-state fallback)
- hw.gpu.memory.usage, hw.gpu.memory.limit, hw.gpu.memory.utilization
- hw.power and nvidia.gpu.power.limit
- hw.temperature
- nvidia.gpu.clock.speed per clock domain
- nvidia.gpu.pcie.throughput per direction
and per process, on the process's own resource:
- nvidia.gpu.process.utilization
- nvidia.gpu.process.memory_copy.utilization
It is kept apart from package gpumetrics so that only parca-agent built with the gpumetrics tag links go-nvml: binaries that do must bind lazily (see build-gpu in the Makefile), which plain `go test` binaries don't.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector collects NVIDIA GPU metrics via NVML into a gpumetrics.Producer.
func NewCollector ¶
NewCollector initializes NVML and enumerates the available NVIDIA devices. It returns an error if NVML is unavailable (e.g. no driver / no GPU), which the caller should treat as "GPU metrics disabled on this node" rather than fatal.
func (*Collector) Collect ¶
Collect runs the background collection loops, recording into rec, until ctx is cancelled. A failing collector is logged and retried on its next tick rather than stopping collection.
func (*Collector) DeviceCount ¶
DeviceCount reports how many NVIDIA devices were enumerated.