config

package
v0.0.0-...-e70f483 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package config provides the GPU monitoring config.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotSupported = errors.New("GPU Monitoring is not supported")

ErrNotSupported is the error returned if GPU monitoring is not supported on this platform

View Source
var MinimumKernelVersion kernel.Version

MinimumKernelVersion indicates the minimum kernel version required for GPU monitoring

Functions

func CheckGPUSupported

func CheckGPUSupported() error

CheckGPUSupported checks if the host's kernel supports GPU monitoring

Types

type Config

type Config struct {
	ebpf.Config
	// Enabled indicates whether the GPU monitoring probe is enabled.
	Enabled bool
	// EnableEBPFProbes indicates whether the GPU monitoring eBPF probes should be loaded.
	EnableEBPFProbes bool
	// PRMEndpointEnabled indicates whether the privileged PRM endpoint should be exposed.
	PRMEndpointEnabled bool
	// ScanProcessesInterval is the interval at which the probe scans for new or terminated processes.
	ScanProcessesInterval time.Duration
	// InitialProcessSync indicates whether the probe should sync the process list on startup.
	InitialProcessSync bool
	// ConfigureCgroupPerms indicates whether the probe should configure cgroup permissions for GPU monitoring
	ConfigureCgroupPerms bool
	// EnableFatbinParsing indicates whether the probe should enable fatbin parsing.
	EnableFatbinParsing bool
	// KernelCacheQueueSize is the size of the kernel cache queue for parsing requests
	KernelCacheQueueSize int
	// RingBufferSizePagesPerDevice is the number of pages to use for the ring buffer per device.
	RingBufferSizePagesPerDevice int
	// RingBufferWakeupSize is the number of bytes that need to be available in the ring buffer before waking up userspace.
	RingBufferWakeupSize int
	// RingBufferFlushInterval is the interval at which the ring buffer should be flushed
	RingBufferFlushInterval time.Duration
	// StreamConfig is the configuration for the streams.
	StreamConfig StreamConfig
	// AttacherDetailedLogs indicates whether the probe should enable detailed logs for the uprobe attacher.
	AttacherDetailedLogs bool
	// DeviceCacheRefreshInterval is the interval at which the probe scans for the latest devices
	DeviceCacheRefreshInterval time.Duration
	// CgroupReapplyInterval is the interval at which to re-apply cgroup device configuration. 0 means no re-application.
	// Defaults to 30 seconds. It is used to fix race conditions between systemd and the system-probe permission patching.
	CgroupReapplyInterval time.Duration
	// CgroupReapplyInfinitely controls whether the cgroup device configuration should be reapplied infinitely (true) or only once (false).
	// Defaults to false. When true, the configuration will be reapplied every CgroupReapplyInterval interval.
	CgroupReapplyInfinitely bool
}

Config holds the configuration for the GPU monitoring probe.

func New

func New() *Config

New generates a new configuration for the GPU monitoring probe.

type StreamConfig

type StreamConfig struct {
	// MaxActiveStreams is the maximum number of streams that can be processed concurrently.
	MaxActiveStreams int
	// Timeout is the maximum time to wait for a stream to be inactive before flushing it.
	Timeout time.Duration
	// MaxKernelLaunches is the maximum number of kernel launches to process per stream before forcing a sync.
	MaxKernelLaunches int
	// MaxMemAllocEvents is the maximum number of memory allocation events to process per stream before evicting the oldest events.
	MaxMemAllocEvents int
	// MaxPendingKernelSpans is the maximum number of pending kernel spans to keep in each stream handler.
	MaxPendingKernelSpans int
	// MaxPendingMemorySpans is the maximum number of pending memory allocation spans to keep in each stream handler.
	MaxPendingMemorySpans int
}

StreamConfig is the configuration for the streams.

Directories

Path Synopsis
Package consts provides constants for the GPU monitoring config, so that they can be imported by other packages without importing the entire config package, which includes ebpf config
Package consts provides constants for the GPU monitoring config, so that they can be imported by other packages without importing the entire config package, which includes ebpf config

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL