firmware

package
v0.13.11 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package firmware reads the firmware and host software versions that operators compare against a release bundle: GPU VBIOS, ConnectX-8 and BlueField-3 NIC firmware, the Grace host BIOS and the DOCA host package.

Every source is read without exec. A source that fails is skipped so it never hides the versions read from the other sources.

Index

Constants

View Source
const DefaultCollectInterval = 4 * time.Hour

DefaultCollectInterval is how often a running GPUd re-reads firmware versions. A new version shows up only after a flash plus a reset or reboot, so a slow refresh is enough.

Variables

This section is empty.

Functions

func Latest

func Latest() []apiv1.MachineFirmware

Latest returns a copy of the last collected entries, or nil before the first collection or when nothing was found.

func Refresh

func Refresh(ctx context.Context, opts Options)

Refresh collects once and replaces the cached entries. The cache is kept when ctx is done before the collection finished.

A source or GPU that fails drops its entries until the next refresh. Its previous entries are not carried over: they would need their own read time inside an entry that groups instances read now.

func RefreshWithin

func RefreshWithin(ctx context.Context, opts Options, timeout time.Duration) bool

RefreshWithin is Refresh for one-shot commands, bounded by timeout. NVML reads ignore ctx, so a hung GPU would otherwise block the command; such a read is left behind and its result is not published. It reports whether the collection finished in time.

func RunPeriodic

func RunPeriodic(ctx context.Context, opts Options, interval time.Duration)

RunPeriodic refreshes every interval until ctx is done. It does not collect immediately; call Refresh first for that.

func Start

func Start(ctx context.Context, opts Options, interval time.Duration) <-chan struct{}

Start collects in the background now and then every interval until ctx is done. The returned channel is closed when the first collection finished.

func WaitFirst

func WaitFirst(ctx context.Context, ready <-chan struct{}, timeout time.Duration) bool

WaitFirst waits for ready to close, at most timeout. It returns false on timeout or when ctx is done first. NVML calls cannot be canceled, so the wait must be bounded rather than block on a slow GPU.

Types

type Options

type Options struct {
	// NVMLInstance reads the GPU VBIOS versions.
	// Nil or a NoOp instance yields no GPU entries; the other sources still run.
	NVMLInstance nvidianvml.Instance
	// InfinibandClassRootDir overrides the InfiniBand class directory
	// (default /sys/class/infiniband), matching the infiniband component.
	InfinibandClassRootDir string
	// contains filtered or unexported fields
}

Options selects the inputs of one collection.

Jump to

Keyboard shortcuts

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