C API

The Habana Labs Management Library (HLML) is a C-based programmatic interface for monitoring and managing various states within Intel® Gaudi® AI accelerators. HLML can be used as a platform for building 3rd party applications and is also the underlying library used for the hl-smi tool (see System Management Interface Tool section).

All APIs, structures and enums used are defined in the public header file. APIs that provide information about a specific device require a handle as a parameter. This handle can be retrieved using the device’s index or PCI address.

Return Value

The return value of all the APIs is the following enum:

typedef enum hlml_return {

    HLML_SUCCESS = 0,

    HLML_ERROR_UNINITIALIZED = 1,

    HLML_ERROR_INVALID_ARGUMENT = 2,

    HLML_ERROR_NOT_SUPPORTED = 3,

    HLML_ERROR_ALREADY_INITIALIZED = 5,

    HLML_ERROR_NOT_FOUND = 6,

    HLML_ERROR_INSUFFICIENT_SIZE = 7,

    HLML_ERROR_DRIVER_NOT_LOADED = 9,

    HLML_ERROR_TIMEOUT = 10,

    HLML_ERROR_AIP_IS_LOST = 15,

    HLML_ERROR_MEMORY = 20,

    HLML_ERROR_NO_DATA = 21,

    HLML_ERROR_UNKNOWN = 49,

} hlml_return_t;