Documentation
¶
Overview ¶
Package infiniband provides utilities to query infiniband status.
Index ¶
- Variables
- func CountInfinibandClass() int
- func CountInfinibandClassBySubDir(dir string) int
- func CountInfinibandPCIBuses(ctx context.Context) (int, error)
- func SupportsInfinibandPortRate(gpuProductName string) int
- func SupportsInfinibandProduct(gpuProductName string) bool
- func ValidateIbstatOutput(s string) error
- type IBStatCard
- type IBStatCards
- type IBStatPort
- type IbstatOutput
Constants ¶
This section is empty.
Variables ¶
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 CountInfinibandClassBySubDir ¶ added in v0.4.0
Count the sub-directories under the specified directory.
func CountInfinibandPCIBuses ¶ added in v0.2.3
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 SupportsInfinibandPortRate ¶ added in v0.2.1
Returns the default non-zero per-port rate in GB/sec if the product supports infiniband.
func SupportsInfinibandProduct ¶
Returns true if the product supports infiniband. e.g., "NVIDIA A100" "NVIDIA H100"
func ValidateIbstatOutput ¶
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) CheckPortsAndRate ¶ added in v0.3.4
func (cards IBStatCards) CheckPortsAndRate(atLeastPorts int, atLeastRate int) error
CheckPortsAndRate checks if the number of active IB ports matches expectations
func (IBStatCards) Match ¶ added in v0.3.4
func (cards IBStatCards) Match(expectedPhysicalState string, expectedState string, atLeastRate int) []string
Match returns the IB port names whose physical state, state, and "Port 1"."Rate" match the expected values. The specified rate is the threshold for "Port 1"."Rate", where it evaluates with ">=" operator (e.g., count all the cards whose rate is >= 400).
If the `expectedPhysicalState` is empty, it matches all states. If the `expectedState` is empty, it matches all states.
type IBStatPort ¶
type IbstatOutput ¶
type IbstatOutput struct { Parsed IBStatCards `json:"parsed,omitempty"` Raw string `json:"raw"` Errors []string `json:"errors,omitempty"` }
func GetIbstatOutput ¶ added in v0.4.0
func GetIbstatOutput(ctx context.Context, ibstatCommands []string) (*IbstatOutput, error)