power

package
v0.12.13 Latest Latest
Warning

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

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

Documentation

Overview

Package power tracks the NVIDIA per-GPU power usage.

Index

Constants

View Source
const Name = "accelerator-nvidia-power"

Name is the name of the NVIDIA power component.

View Source
const SubSystem = "accelerator_nvidia_power"

SubSystem is the Prometheus subsystem name for the NVIDIA power component.

Variables

This section is empty.

Functions

func New

func New(gpudInstance *components.GPUdInstance) (components.Component, error)

New creates a NVIDIA power component.

Types

type Power added in v0.9.0

type Power struct {
	// Represents the GPU UUID.
	UUID string `json:"uuid"`

	// BusID is the GPU bus ID from the nvml API.
	//  e.g., "0000:0f:00.0"
	BusID string `json:"bus_id"`

	UsageMilliWatts           uint32 `json:"usage_milli_watts"`
	EnforcedLimitMilliWatts   uint32 `json:"enforced_limit_milli_watts"`
	ManagementLimitMilliWatts uint32 `json:"management_limit_milli_watts"`

	UsedPercent string `json:"used_percent"`

	GetPowerUsageSupported           bool `json:"get_power_usage_supported"`
	GetPowerLimitSupported           bool `json:"get_power_limit_supported"`
	GetPowerManagementLimitSupported bool `json:"get_power_management_limit_supported"`
}

Power reports NVIDIA GPU power readings and support flags.

func GetPower added in v0.9.0

func GetPower(uuid string, dev device.Device) (Power, error)

GetPower queries power usage and power limits for a device.

func (Power) GetUsedPercent added in v0.9.0

func (power Power) GetUsedPercent() (float64, error)

GetUsedPercent parses the cached percentage of used power.

Jump to

Keyboard shortcuts

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