infiniband

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package infiniband monitors the infiniband status of the system. Optional, enabled if the host has NVIDIA GPUs.

Index

Constants

View Source
const (
	StateNameIbstat = "ibstat"

	StateKeyIbstatData           = "data"
	StateKeyIbstatEncoding       = "encoding"
	StateValueIbstatEncodingJSON = "json"
)

Variables

This section is empty.

Functions

func New

Types

type Config

type Config struct {
	Query query_config.Config `json:"query"`

	ExpectedPortStates
}

func ParseConfig

func ParseConfig(b any, db *sql.DB) (*Config, error)

func (*Config) Validate

func (cfg *Config) Validate() error

type ExpectedPortStates added in v0.2.0

type ExpectedPortStates struct {
	// The number of ports expected to be "Active" and "LinkUp".
	// If not set, it defaults to the number of GPUs.
	PortCount int `json:"port_count"`

	// The expected rate in Gb/sec.
	// If not set, it defaults to 200.
	Rate int `json:"rate"`
}

Configures the expected state of the ports.

type Output

type Output struct {
	// GPUProductName is the product name of the GPU.
	// Useful to ignore infiniband states for non-infiniband supported GPUs (e.g., GTX 4090).
	GPUProductName string `json:"gpu_product_name"`

	// Represents the number of GPUs in the system.
	// This is used to determine how many ibstat cards at certain rate are expected.
	GPUCount int `json:"gpu_count"`

	InfinibandClassExists bool                    `json:"infiniband_class_exists"`
	IbstatExists          bool                    `json:"ibstat_exists"`
	Ibstat                infiniband.IbstatOutput `json:"ibstat"`
}

func ParseOutputJSON

func ParseOutputJSON(data []byte) (*Output, error)

func ParseStateIbstat

func ParseStateIbstat(m map[string]string) (*Output, error)

func ParseStatesToOutput

func ParseStatesToOutput(states ...components.State) (*Output, error)

func ToOutput

func ToOutput(i *nvidia_query.Output) *Output

ToOutput converts nvidia_query.Output to Output. It returns an empty non-nil object, if the input or the required field is nil (e.g., i.SMI).

func (*Output) Evaluate

func (o *Output) Evaluate(cfg Config) (string, bool, error)

Returns the output evaluation reason and its healthy-ness.

func (*Output) JSON

func (o *Output) JSON() ([]byte, error)

func (*Output) States

func (o *Output) States(cfg Config) ([]components.State, error)

Directories

Path Synopsis
Package id provides the ID for the NVIDIA InfiniBand component.
Package id provides the ID for the NVIDIA InfiniBand component.

Jump to

Keyboard shortcuts

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