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: 11 Imported by: 0

Documentation

Overview

Package infiniband provides utilities to query infiniband status.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIbstatOutputBrokenStateDown        = errors.New("ibstat output unexpected; found State: Down (check the physical switch)")
	ErrIbstatOutputBrokenPhysicalDisabled = errors.New("ibstat output unexpected; found Physical state: Disabled (check the physical switch)")
)

Functions

func CountInfinibandClass added in v0.2.3

func CountInfinibandClass() int

Counts the directories in "/sys/class/infiniband". Returns 0 if the directory does not exist.

func CountInfinibandPCIBuses added in v0.2.3

func CountInfinibandPCIBuses(ctx context.Context) (int, error)

lspci | grep -i infiniband 1a:00.0 Infiniband controller: Mellanox Technologies MT2910 Family [ConnectX-7] 3c:00.0 Infiniband controller: Mellanox Technologies MT2910 Family [ConnectX-7] 1a:00.0 Ethernet controller: Mellanox Technologies MT2910 Family [ConnectX-7] 1b:00.0 Ethernet controller: Mellanox Technologies MT2892 Family [ConnectX-6 Dx]

func IbstatExists

func IbstatExists() bool

func SupportsInfinibandPortRate added in v0.2.1

func SupportsInfinibandPortRate(gpuProductName string) int

Returns the default non-zero per-port rate in GB/sec if the product supports infiniband.

func SupportsInfinibandProduct

func SupportsInfinibandProduct(gpuProductName string) bool

Returns true if the product supports infiniband. e.g., "NVIDIA A100" "NVIDIA H100"

func ValidateIbstatOutput

func ValidateIbstatOutput(s string) error

Types

type IBStatCard

type IBStatCard struct {
	Name            string     `json:"CA name"`
	Type            string     `json:"CA type"`
	NumPorts        string     `json:"Number of ports"`
	FirmwareVersion string     `json:"Firmware version"`
	HardwareVersion string     `json:"Hardware version"`
	NodeGUID        string     `json:"Node GUID"`
	SystemImageGUID string     `json:"System image GUID"`
	Port1           IBStatPort `json:"Port 1"`
}

type IBStatCards

type IBStatCards []IBStatCard

func ParseIBStat

func ParseIBStat(input string) (IBStatCards, error)

ParseIBStat parses ibstat output and returns YAML representation

func (IBStatCards) CountByRates

func (cards IBStatCards) CountByRates(rate int, expectedState string, expectedPhysicalState string) int

Counts the number of cards whose "Port 1"."Rate" is equal to or greater than the specified rate (e.g., count all the cards whose rate is >= 400). If `expectedState` is not empty, it only counts the cards whose "Port 1"."State" is equal to the expected state. If `expectedPhysicalState` is not empty, it only counts the cards whose "Port 1"."Physical state" is equal to the expected physical state.

type IBStatPort

type IBStatPort struct {
	State         string `json:"State"`
	PhysicalState string `json:"Physical state"`
	Rate          int    `json:"Rate"`
	BaseLid       int    `json:"Base lid"`
	LinkLayer     string `json:"Link layer"`
}

type IbstatOutput

type IbstatOutput struct {
	Parsed IBStatCards `json:"parsed,omitempty"`
	Raw    string      `json:"raw"`
	Errors []string    `json:"errors,omitempty"`
}

func RunIbstat

func RunIbstat(ctx context.Context) (*IbstatOutput, error)

Jump to

Keyboard shortcuts

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