gpu

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommandSetClockRange api.CommandType = "gpu_clock_range"
	CommandSetPowerCap   api.CommandType = "gpu_power_cap"
)
View Source
const (
	CategoryFast api.MetricCategory = "gpu_fast"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClockRangeCommand

type ClockRangeCommand struct {
	GPUIndex  int
	SMMinMHz  uint32
	SMMaxMHz  uint32
	MemMinMHz uint32
	MemMaxMHz uint32
}

type Collector

type Collector struct {
	// contains filtered or unexported fields
}

func NewCollector

func NewCollector() (*Collector, error)

func (*Collector) CollectFast

func (g *Collector) CollectFast() (*FastMetrics, error)

func (*Collector) Enabled

func (g *Collector) Enabled() bool

func (*Collector) StaticInfo

func (g *Collector) StaticInfo() []StaticInfo

type CollectorSpec

type CollectorSpec struct {
	Category string
	Interval string
}

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func NewController

func NewController(collector *Collector) *Controller

func (*Controller) SetClockRange

func (c *Controller) SetClockRange(gpuIndex int, smMinMHz, smMaxMHz, memMinMHz, memMaxMHz uint32) error

func (*Controller) SetPowerCap

func (c *Controller) SetPowerCap(gpuIndex int, milliWatt uint32) error

type ControllerSpec

type ControllerSpec struct {
	Type string
}

type DeviceFastMetrics

type DeviceFastMetrics struct {
	Index            int
	UtilizationGPU   uint32
	UtilizationMem   uint32
	MemoryUsedBytes  uint64
	TemperatureC     uint32
	PowerUsageMilliW uint32
	GraphicsClockMHz uint32
	MemoryClockMHz   uint32
	SMClockMinMHz    uint32
	SMClockMaxMHz    uint32
	MemClockMinMHz   uint32
	MemClockMaxMHz   uint32
	PowerLimitMilliW uint32
	SampledAtNano    int64
}

type FastMetrics

type FastMetrics struct {
	Devices []DeviceFastMetrics
}

type Module

type Module struct {
	// contains filtered or unexported fields
}

func New

func New(intervals config.ReportConfig) (*Module, error)

func (*Module) CollectorEntries

func (m *Module) CollectorEntries() []modules.CollectorEntry

func (*Module) ControllerEntries

func (m *Module) ControllerEntries() []modules.ControllerEntry

func (*Module) Name

func (m *Module) Name() string

func (*Module) Registration

func (m *Module) Registration() any

type PowerCapCommand

type PowerCapCommand struct {
	GPUIndex  int
	MilliWatt uint32
}

type Registration

type Registration struct {
	Static      []StaticInfo
	Collectors  []CollectorSpec
	Controllers []ControllerSpec
}

type StaticInfo

type StaticInfo struct {
	Index             int
	Name              string
	UUID              string
	MemoryTotalBytes  uint64
	PowerMinMilliWatt uint32
	PowerMaxMilliWatt uint32
	SMClockMinMHz     uint32
	SMClockMaxMHz     uint32
	MemClockMinMHz    uint32
	MemClockMaxMHz    uint32
}

Jump to

Keyboard shortcuts

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