discover

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

* Copyright (c) 2022, HabanaLabs Ltd. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoDevices = errors.New("no habanalabs devices found. driver might not be loaded")
View Source
var SysClassAccel = "/sys/class/accel/accel"

Functions

func AcceleratorDevices

func AcceleratorDevices() []string

AcceleratorDevices finds the Habanalabs infiniband cards for the accelerators, and their control units, i.e accel0 and accel_controlD0

func AcceleratorModuleID

func AcceleratorModuleID(acceleratorID string) (string, error)

AcceleratorModuleID returns the module ID (OAM) of the requested accelerator.

func CharDevices

func CharDevices(prefixes []string) ([]string, error)

func DevicesIDs

func DevicesIDs(devices []string) []string

DevicesIDs returns the unique device ids on the system

func ExternalInterfaces

func ExternalInterfaces(absHlibDevicePaths []string) ([]string, error)

Extract network interfaces names from hlib device.

func InfinibandDevices

func InfinibandDevices() []string

InfinibandDevices finds the related Habanalabs infiniband cards for the accelerators.

func UverbsForAccelerators

func UverbsForAccelerators(deviceIDs []string) ([]string, error)

UverbsForAccelerators returns list of infiniband char devices attached to each accelerator provided.

Types

type DevInfo

type DevInfo struct {
	Path     string
	Major    uint32
	Minor    uint32
	Mode     uint32
	Uid      uint32
	Gid      uint32
	FileMode os.FileMode
}

func DeviceInfo

func DeviceInfo(filepath string) (*DevInfo, error)

Jump to

Keyboard shortcuts

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