Documentation ¶
Overview ¶
Package gohlml is a Go package serves as a bridge to work with hlml C library. It allows access to native Habana device commands and information.
Index ¶
- Constants
- Variables
- func DeleteEventSet(es EventSet)
- func DeviceCount() (uint, error)
- func FWVersion(idx uint) (kernel string, uboot string, err error)
- func GetDeviceTypeName() (string, error)
- func InitWithLogs() error
- func Initialize() error
- func RegisterEventForDevice(es EventSet, event int, uuid string) error
- func Shutdown() error
- func SystemDriverVersion() (string, error)
- type Device
- func (d Device) BoardID() (uint, error)
- func (d Device) ClockThrottleReasons() (uint64, error)
- func (d Device) ECCMode() (uint, uint, error)
- func (d Device) EnergyConsumptionCounter() (uint64, error)
- func (d Device) HLRevision() (int, error)
- func (d Device) ICClockMax() (uint, error)
- func (d Device) IsReplacedRowsPendingStatus() (int, error)
- func (d Device) MMEClockMax() (uint, error)
- func (d Device) MacAddressInfo() (map[int]string, error)
- func (d Device) MemoryInfo() (uint64, uint64, uint64, error)
- func (d Device) MinorNumber() (uint, error)
- func (d Device) ModuleID() (uint, error)
- func (d Device) Name() (string, error)
- func (d Device) NicLinkStatus(port uint) (uint, error)
- func (d Device) NumaNode() (*uint, error)
- func (d Device) PCBAssemblyVersion() (string, error)
- func (d Device) PCBVersion() (string, error)
- func (d Device) PCIBus() (uint, error)
- func (d Device) PCIBusID() (string, error)
- func (d Device) PCIDomain() (uint, error)
- func (d Device) PCIID() (uint, error)
- func (d Device) PCILinkSpeed() (uint, error)
- func (d Device) PCILinkWidth() (uint, error)
- func (d Device) PCIReplayCounter() (uint, error)
- func (d Device) PCIeLinkGeneration() (uint, error)
- func (d Device) PCIeLinkWidth() (uint, error)
- func (d Device) PCIeRX() (uint, error)
- func (d Device) PCIeTX() (uint, error)
- func (d Device) PowerManagementDefaultLimit() (uint, error)
- func (d Device) PowerUsage() (uint, error)
- func (d Device) ReplacedRowDoubleBitECC() (uint, error)
- func (d Device) ReplacedRowSingleBitECC() (uint, error)
- func (d Device) SOCClockInfo() (uint, error)
- func (d Device) SOCClockMax() (uint, error)
- func (d Device) SerialNumber() (string, error)
- func (d Device) TPCClockMax() (uint, error)
- func (d Device) TemperatureOnBoard() (uint, error)
- func (d Device) TemperatureOnChip() (uint, error)
- func (d Device) TemperatureThresholdGPU() (uint, error)
- func (d Device) TemperatureThresholdMemory() (uint, error)
- func (d Device) TemperatureThresholdShutdown() (uint, error)
- func (d Device) TemperatureThresholdSlowdown() (uint, error)
- func (d Device) UUID() (string, error)
- func (d Device) UtilizationInfo() (uint, error)
- type Event
- type EventSet
- type PCIInfo
Constants ¶
const ( // HlmlCriticalError indicates a critical error in the device HlmlCriticalError = C.HLML_EVENT_CRITICAL_ERR // HLDriverPath indicates on habana device dir HLDriverPath = "/sys/class/accel" // HLModulePath indicates on habana module dir HLModulePath = "/sys/module/habanalabs" // BITSPerLong repsenets 64 bits in logs BITSPerLong = 64 )
Variables ¶
var ( ErrNotIntialized = errors.New("hlml not initialized") ErrInvalidArgument = errors.New("invalid argument") ErrNotSupported = errors.New("not supported") ErrAlreadyInitialized = errors.New("hlml already initialized") ErrNotFound = errors.New("not found") ErrInsufficientSize = errors.New("insufficient size") ErrDriverNotLoaded = errors.New("driver not loaded") ErrAipIsLost = errors.New("aip is lost") ErrMemoryError = errors.New("memory error") ErrNoData = errors.New("no data") ErrUnknownError = errors.New("unknown error") )
Functions ¶
func DeleteEventSet ¶
func DeleteEventSet(es EventSet)
func DeviceCount ¶
DeviceCount gets number of Habana devices in the system
func GetDeviceTypeName ¶ added in v1.14.0
func InitWithLogs ¶
func InitWithLogs() error
InitWithLogs initializes the HLML library with logging on
func RegisterEventForDevice ¶
func SystemDriverVersion ¶
SystemDriverVersion returns the driver version on the system
Types ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device struct maps to C HLML structure
func DeviceHandleByIndex ¶
DeviceHandleByIndex gets a handle to a particular device by index
func DeviceHandleBySerial ¶
DeviceHandleBySerial gets a handle to a particular device by serial number
func DeviceHandleByUUID ¶
DeviceHandleByUUID gets a handle to a particular device by UUIC
func (Device) ClockThrottleReasons ¶
ClockThrottleReasons returns current clock throttle reasons
func (Device) ECCMode ¶ added in v1.14.0
ECCMode retrieves the current and pending ECC modes for the device
1 - ECCMode enabled 0 - ECCMode disabled
func (Device) EnergyConsumptionCounter ¶
EnergyConsumptionCounter returns energy consumption
func (Device) HLRevision ¶
HLRevision returns the revision of the HL library
func (Device) ICClockMax ¶ added in v1.14.0
ICClockMax returns the maximum IC clock frequency for a given device
func (Device) IsReplacedRowsPendingStatus ¶ added in v1.14.0
IsReplacedRowsPendingStatus return 0 (false) or 1 (true) if there are any rows need of replacement in a power cycle
func (Device) MMEClockMax ¶ added in v1.14.0
MMEClockMax returns the maximum MME clock frequency for a given device
func (Device) MacAddressInfo ¶ added in v1.14.0
MacAddressInfo retrieves the masks for supported ports and external ports.
func (Device) MemoryInfo ¶
MemoryInfo returns the current memory usage in bytes for total, used, free
func (Device) MinorNumber ¶
MinorNumber returns Minor number.
func (Device) NicLinkStatus ¶ added in v1.14.0
NicLinkStatus gets a port and checks its status. return 1 (up) or 0 (down)
func (Device) PCBAssemblyVersion ¶
PCBAssemblyVersion returns the PCB Assembly info
func (Device) PCBVersion ¶
PCBVersion returns the PCB version
func (Device) PCILinkSpeed ¶
PCILinkSpeed returns the current PCI link speed for a given device
func (Device) PCILinkWidth ¶
PCILinkWidth returns the current PCI link width for a given device
func (Device) PCIReplayCounter ¶
PCIReplayCounter returns PCIe replay count
func (Device) PCIeLinkGeneration ¶
PCIeLinkGeneration returns PCIe replay count MUST run with SUDO/priviledged
func (Device) PCIeLinkWidth ¶
PCIeLinkWidth returns PCIe link width
func (Device) PowerManagementDefaultLimit ¶ added in v1.14.0
PowerManagementDefaultLimit Retrieves default power management limit on this device, in milliwatts. Default power management limit is a power management limit that the device boots with.
func (Device) PowerUsage ¶
PowerUsage returns the power usage in milliwatts for a given device
func (Device) ReplacedRowDoubleBitECC ¶ added in v1.14.0
ReplacedRowDoubleBitECC returns the number of rows with double-bit ecc errors
func (Device) ReplacedRowSingleBitECC ¶ added in v1.14.0
ReplacedRowSingleBitECC returns the number of rows with single-bit ecc errors
func (Device) SOCClockInfo ¶
SOCClockInfo returns the SoC clock frequency for a given device
func (Device) SOCClockMax ¶ added in v1.14.0
SOCClockMax returns the maximum SoC clock frequency for a given device
func (Device) SerialNumber ¶
SerialNumber returns the device serial number
func (Device) TPCClockMax ¶ added in v1.14.0
TPCClockMax returns the maximum TPC clock frequency for a given device
func (Device) TemperatureOnBoard ¶ added in v1.14.0
TemperatureOnBoard returns the temperature in celsius for a device board
func (Device) TemperatureOnChip ¶ added in v1.14.0
TemperatureOnChip returns the temperature in celsius for a the device chip
func (Device) TemperatureThresholdGPU ¶ added in v1.14.0
TemperatureThresholdGPU Retrieves the known temperature threshold for the AIP with the specified threshold type in degrees
func (Device) TemperatureThresholdMemory ¶ added in v1.14.0
TemperatureThresholdMemory Retrieves the known temperature threshold for the AIP with the specified threshold type in degrees
func (Device) TemperatureThresholdShutdown ¶ added in v1.14.0
TemperatureThresholdShutdown Retrieves the known temperature threshold for the AIP with the specified threshold type in degrees
func (Device) TemperatureThresholdSlowdown ¶ added in v1.14.0
TemperatureThresholdSlowdown Retrieves the known temperature threshold for the AIP with the specified threshold type in degrees
func (Device) UtilizationInfo ¶
UtilizationInfo returns the utilization aip rate for a given device
type EventSet ¶
type EventSet struct {
// contains filtered or unexported fields
}
EventSet is a cast of the C type of the hlml event set
func NewEventSet ¶
func NewEventSet() EventSet