pyefml

Module Contents

Classes

efmlDeviceInfo_t

Structure base class

efmlDevPowerInfo_t

Structure base class

efmlDriverInfo_t

Structure base class

efmlDevMemInfo_t

Structure base class

efmlClusterHbmMemInfo_t

Structure base class

efmlDevClkInfo_t

Structure base class

efmlDevThermalInfo_t

Structure base class

efmlDevVoltInfo_t

Structure base class

efmlPcieLinkInfo_t

Structure base class

efmlPcieThroughputInfo_t

Structure base class

efmlEslLinkInfo_t

Structure base class

efmlEslThroughputInfo_t

Structure base class

efmlEslPortInfo_t

Structure base class

Functions

efmlError(err_code)

efmlLoadLibrary()

efmlGetFunctionEntry(entry_str)

efmlInit(no_driver=False)

Init efml libary

efmlShutdown()

Close efml libary, release allocated resource

efmlErrorString(ret_val)

Translate returned error code to string

efmlDriverVer()

Get KMD (kernel mode driver) version info

efmlLibVer()

Get EFML lib version info

efmlSelDevByIndex(idx)

Select current device by index

efmlGetDevCount()

Get total DTU device numbers in the system

efmlGetDevName(idx)

Get DTU device name

efmlGetDevUuid(idx)

Get DTU device UUID(Universally Unique Identifier)

efmlGetDevSn(idx)

Get DTU device SN info(Serial Number)

efmlGetDevPn(idx)

Get DTU device PN info(Part Number)

efmlGetFwVersion(idx)

Get DTU firmware version

efmlGetDevTemp(idx)

Get DTU/MEM temperature

efmlGetDevVolt(idx)

Get DTU voltage

efmlGetDevPwr(idx)

Get DTU power consumption

efmlGetDevDpmLevel(idx)

Get DTU DPM(Dynamic Power Managerment) level

efmlGetDevDtuUsage(idx)

Get DTU usage

efmlGetDevClk(idx)

Get DTU/Mem clock frequency

efmlDumpDevList()

Dump device list in system

efmlGetDevInfo(idx)

Get detailed DTU information

efmlGetDevMem(idx)

Get device memory information

efmlGetClusterMem(idx, cluster_idx)

Get device memory information

efmlGetEccStatus(idx)

Get device memory ECC status

efmlGetPcieLinkSpeed(idx)

Get device PCIe link speed

efmlGetPcieLinkWidth(idx)

Get device PCIe link width

efmlGetPcieLinkInfo(idx)

Get device PCIe link information

efmlGetPcieThroughput(idx)

Get device PCIe link throughput info. It will collect information in 10ms

efmlGetEslPortNum(idx)

Get device ESL port number

efmlGetEslPortInfo(idx, port_id)

Get device ESL port info

efmlGetEslLinkInfo(idx, port_id)

Get device ESL port link info

efmlGetEslThroughput(idx, port_id)

Get device ESL port throughput info

efmlGetDevClusterCount(idx)

Get total DTU device cluster numbers in the dtu

efmlGetDevClusterUsage(idx, cluster_idx)

Get DTU usage

efmlGetDevHealth(idx)

Get DTU usage

efmlGetVdevCount(idx)

Get virtual GCU numbers in the GCU.

efmlGetVdevDtuMem(idx, vdev_idx)

Get vGCU mem info.

efmlGetVdevDtuUsage(idx, vdev_idx)

Get vGCU usage

Attributes

efmlReturn

EFML_SUCCESS

EFML_ERROR_MAX

efmlLinkSpeed_t

EFML_LINK_SPEED_GEN1

EFML_LINK_SPEED_GEN2

EFML_LINK_SPEED_GEN3

EFML_LINK_SPEED_GEN4

EFML_LINK_SPEED_GEN5

efmlEslLinkSpeed_t

EFML_ESL_LINK_SPEED_GEN1

EFML_ESL_LINK_SPEED_GEN2

EFML_ESL_LINK_SPEED_GEN3

EFML_ESL_LINK_SPEED_GEN4

EFML_ESL_LINK_SPEED_GEN5

EFML_ESL_LINK_SPEED_ESM_2P5GT

EFML_ESL_LINK_SPEED_ESM_5GT

EFML_ESL_LINK_SPEED_ESM_8GT

EFML_ESL_LINK_SPEED_ESM_16GT

EFML_ESL_LINK_SPEED_ESM_20GT

EFML_ESL_LINK_SPEED_ESM_25GT

efmlLinkWidth_t

EFML_LINK_WIDTH_X1

EFML_LINK_WIDTH_X2

EFML_LINK_WIDTH_X4

EFML_LINK_WIDTH_X8

EFML_LINK_WIDTH_X16

efmlEslLinkWidth_t

EFML_ESL_LINK_WIDTH_X1

EFML_ESL_LINK_WIDTH_X2

EFML_ESL_LINK_WIDTH_X4

EFML_ESL_LINK_WIDTH_X8

EFML_ESL_LINK_WIDTH_X16

efmlEslPortType_t

EFML_ESL_PORT_RC

EFML_ESL_PORT_EP

EFML_DRIVER_VER_LEN

EFML_MAX_CHAR_BUFF_LEN

efmlLib

efmlFunctionEntryList_cache

pyefml.efmlReturn[source]
pyefml.EFML_SUCCESS = 0[source]
pyefml.EFML_ERROR_MAX = 255[source]
pyefml.efmlLinkSpeed_t[source]
pyefml.efmlEslLinkSpeed_t[source]
pyefml.efmlLinkWidth_t[source]
pyefml.efmlEslLinkWidth_t[source]
pyefml.efmlEslPortType_t[source]
pyefml.EFML_ESL_PORT_RC = 0[source]
pyefml.EFML_ESL_PORT_EP = 1[source]
pyefml.EFML_DRIVER_VER_LEN = 128[source]
pyefml.EFML_MAX_CHAR_BUFF_LEN = 128[source]
class pyefml.efmlDeviceInfo_t[source]

Bases: ctypes.Structure

Structure base class

_fields_ = [None, None, None, None, None, None, None, None][source]
class pyefml.efmlDevPowerInfo_t[source]

Bases: ctypes.Structure

Structure base class

_fields_ = [None, None][source]
class pyefml.efmlDriverInfo_t[source]

Bases: ctypes.Structure

Structure base class

_fields_ = [None][source]
class pyefml.efmlDevMemInfo_t[source]

Bases: ctypes.Structure

Structure base class

_fields_ = [None, None][source]
class pyefml.efmlClusterHbmMemInfo_t[source]

Bases: ctypes.Structure

Structure base class

_fields_ = [None, None][source]
class pyefml.efmlDevClkInfo_t[source]

Bases: ctypes.Structure

Structure base class

_fields_ = [None, None][source]
class pyefml.efmlDevThermalInfo_t[source]

Bases: ctypes.Structure

Structure base class

_fields_ = [None, None, None][source]
class pyefml.efmlDevVoltInfo_t[source]

Bases: ctypes.Structure

Structure base class

_fields_ = [None, None, None, None, None][source]
class pyefml.efmlPcieLinkInfo_t[source]

Bases: ctypes.Structure

Structure base class

_fields_ = [None, None, None, None][source]
class pyefml.efmlPcieThroughputInfo_t[source]

Bases: ctypes.Structure

Structure base class

_fields_ = [None, None, None, None][source]
class pyefml.efmlEslLinkInfo_t[source]

Bases: ctypes.Structure

Structure base class

_fields_ = [None, None, None, None][source]
class pyefml.efmlEslThroughputInfo_t[source]

Bases: ctypes.Structure

Structure base class

_fields_ = [None, None, None, None][source]
class pyefml.efmlEslPortInfo_t[source]

Bases: ctypes.Structure

Structure base class

_fields_ = [None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None,...[source]
pyefml.efmlLib[source]
pyefml.efmlError(err_code)[source]
pyefml.efmlLoadLibrary()[source]
pyefml.efmlFunctionEntryList_cache[source]
pyefml.efmlGetFunctionEntry(entry_str)[source]
pyefml.efmlInit(no_driver=False)[source]

Init efml libary

Parameters

no_driver (bool) – not use kmd

Returns

EFML_SUCCESS

pyefml.efmlShutdown()[source]

Close efml libary, release allocated resource

Parameters

None

Returns

None

pyefml.efmlErrorString(ret_val)[source]

Translate returned error code to string

Parameters

ret_val (efmlReturn) – function return value

Returns

string of return value

pyefml.efmlDriverVer()[source]

Get KMD (kernel mode driver) version info

Parameters

None

Returns

string of driver version

pyefml.efmlLibVer()[source]

Get EFML lib version info

Parameters

None

Returns

string of efml lib version

pyefml.efmlSelDevByIndex(idx)[source]

Select current device by index

Parameters

idx (int) – selected device index

Returns

None

Error

EFML_ERROR_UNINITIALIZED: library not initialized
EFML_ERROR_INVALID_ARGUMENT: invalid input parameters
pyefml.efmlGetDevCount()[source]

Get total DTU device numbers in the system

Parameters

None

Returns

total device numbers

Error

EFML_ERROR_UNINITIALIZED: library not initialized

pyefml.efmlGetDevName(idx)[source]

Get DTU device name

Parameters

idx (int) – selected device index

Returns

device name in string

Error

EFML_ERROR_UNINITIALIZED: library not initialized
EFML_ERROR_INVALID_ARGUMENT: invalid input parameters
pyefml.efmlGetDevUuid(idx)[source]

Get DTU device UUID(Universally Unique Identifier)

Parameters

idx (int) – selected device index

Returns

device UUID in string

Error

EFML_ERROR_UNINITIALIZED: library not initialized
EFML_ERROR_INVALID_ARGUMENT: invalid input parameters
pyefml.efmlGetDevSn(idx)[source]

Get DTU device SN info(Serial Number)

Parameters

idx (int) – selected device index

Returns

device SN in string

Error

EFML_ERROR_UNINITIALIZED: library not initialized
EFML_ERROR_INVALID_ARGUMENT: invalid input parameters
pyefml.efmlGetDevPn(idx)[source]

Get DTU device PN info(Part Number)

Parameters

idx (int) – selected device index

Returns

device PN in string

Error

EFML_ERROR_UNINITIALIZED: library not initialized
EFML_ERROR_INVALID_ARGUMENT: invalid input parameters
pyefml.efmlGetFwVersion(idx)[source]

Get DTU firmware version

Parameters

idx (int) – selected device index

Returns

DTU firmware version in string

Error

EFML_ERROR_UNINITIALIZED: library not initialized
EFML_ERROR_INVALID_ARGUMENT: invalid input parameters
pyefml.efmlGetDevTemp(idx)[source]

Get DTU/MEM temperature

Parameters

idx (int) – selected device index

Returns

cur_dev_temp(float): DTU temperature,[1,95] celsius | efmlDevThermalInfo_t:cur_hbm0_temp(float): MEM0 temperature,[1,95] celsius | efmlDevThermalInfo_t:cur_hbm1_temp(float): MEM1 temperature,[1,95] celsius

Return type

efmlDevThermalInfo_t

Error

EFML_ERROR_UNINITIALIZED: library not initialized
EFML_ERROR_INVALID_ARGUMENT: invalid input parameters
pyefml.efmlGetDevVolt(idx)[source]

Get DTU voltage

Parameters

idx (int) – selected device index

Returns

vdd_dtu(float): DTU voltage | efmlDevVoltInfo_t:vdd_soc(float): soc voltage | efmlDevVoltInfo_t:vdd_hbmqc(float): HBMQC voltage | efmlDevVoltInfo_t:vdd_1v8(float): VDD 1V8 voltage | efmlDevVoltInfo_t:vdd_vddp(float): VDD VDDP voltage

Return type

efmlDevVoltInfo_t

Error

EFML_ERROR_UNINITIALIZED: library not initialized
EFML_ERROR_INVALID_ARGUMENT: invalid input parameters
pyefml.efmlGetDevPwr(idx)[source]

Get DTU power consumption

Parameters

idx (int) – selected device index

Returns

pwr_capability(float): DTU power capability,225 watt | efmlDevPowerInfo_t:cur_pwr_consumption(float): DTU current power consumption,[1,225] watt

Return type

efmlDevPowerInfo_t

Error

EFML_ERROR_UNINITIALIZED: library not initialized
EFML_ERROR_INVALID_ARGUMENT: invalid input parameters
pyefml.efmlGetDevDpmLevel(idx)[source]

Get DTU DPM(Dynamic Power Managerment) level

Parameters

idx (int) – selected device index

Returns

DPM level in int

Error

EFML_ERROR_UNINITIALIZED: library not initialized
EFML_ERROR_INVALID_ARGUMENT: invalid input parameters
pyefml.efmlGetDevDtuUsage(idx)[source]

Get DTU usage

Parameters

idx (int) – selected device index

Returns

DTU usage value in float

Error

EFML_ERROR_UNINITIALIZED: library not initialized
EFML_ERROR_INVALID_ARGUMENT: invalid input parameters
pyefml.efmlGetDevClk(idx)[source]

Get DTU/Mem clock frequency

Parameters

idx (int) – selected device index

Returns

cur_hbm_clock (int): memory clock frequency efmlDevClkInfo_t:cur_dtu_clock (int): DTU clock frequency

Return type

efmlDevClkInfo_t

Error

EFML_ERROR_UNINITIALIZED: library not initialized
EFML_ERROR_INVALID_ARGUMENT: invalid input parameters
pyefml.efmlDumpDevList()[source]

Dump device list in system

Parameters

None

Returns

None

Error

EFML_ERROR_UNINITIALIZED: library not initialized

pyefml.efmlGetDevInfo(idx)[source]

Get detailed DTU information

Parameters

idx (int) – selected device index

Returns

name (char []): device name | efmlDeviceInfo_t:vendor_id (c_uint): PCIe Vendor ID | efmlDeviceInfo_t:device_id (c_uint): PCIe Device ID | efmlDeviceInfo_t:domain_id (c_uint): PCIe Domain ID | efmlDeviceInfo_t:bus_id (c_uint): PCIe Bus number | efmlDeviceInfo_t:dev_id (c_uint): PCIe Device number | efmlDeviceInfo_t:func_id (c_uint): PCIe Function number | efmlDeviceInfo_t:logic_id (c_uint): device logic id

Return type

efmlDeviceInfo_t

Error

EFML_ERROR_UNINITIALIZED: library not initialized
EFML_ERROR_INVALID_ARGUMENT: invalid input parameters
pyefml.efmlGetDevMem(idx)[source]

Get device memory information

Parameters

idx (int) – selected device index

Returns

mem_total_size (c_uint): memory size | efmlDevMemInfo_t:mem_used (c_uint): memory usage

Return type

efmlDevMemInfo_t

Error

EFML_ERROR_UNINITIALIZED: library not initialized
EFML_ERROR_INVALID_ARGUMENT: invalid input parameters
pyefml.efmlGetClusterMem(idx, cluster_idx)[source]

Get device memory information

Parameters
  • idx (int) – selected device index

  • cluster_idx (int) – selected cluster index

Returns

mem_total_size (c_uint): memory size | efmlClusterHbmMemInfo_t:mem_used (c_uint): memory usage

Return type

efmlClusterHbmMemInfo_t

Error

EFML_ERROR_UNINITIALIZED: library not initialized
EFML_ERROR_INVALID_ARGUMENT: invalid input parameters
pyefml.efmlGetEccStatus(idx)[source]

Get device memory ECC status

Parameters

idx (int) – selected device index

Returns

ECC enablement status in int

Error

EFML_ERROR_UNINITIALIZED: library not initialized
EFML_ERROR_INVALID_ARGUMENT: invalid input parameters
pyefml.efmlGetPcieLinkSpeed(idx)[source]

Get device PCIe link speed

Parameters

idx (int) – selected device index

Returns

link speed info in efmlPcieSpeed_t

Error

EFML_ERROR_UNINITIALIZED: library not initialized
EFML_ERROR_INVALID_ARGUMENT: invalid input parameters
pyefml.efmlGetPcieLinkWidth(idx)[source]

Get device PCIe link width

Parameters

idx (int) – selected device index

Returns

link width info in efmlPcieWidth_t

Error

EFML_ERROR_UNINITIALIZED: library not initialized
EFML_ERROR_INVALID_ARGUMENT: invalid input parameters
pyefml.efmlGetPcieLinkInfo(idx)[source]

Get device PCIe link information

Parameters

idx (int) – selected device index

Returns

link_speed : PCIe link speed | efmlPcieLinkInfo_t:max_link_speed : PCIe supported max link speed | efmlPcieLinkInfo_t:link_width : PCIe link width | efmlPcieLinkInfo_t:max_link_width : PCIe supported max link width

Return type

efmlPcieLinkInfo_t

Error

EFML_ERROR_UNINITIALIZED: library not initialized
EFML_ERROR_INVALID_ARGUMENT: invalid input parameters
pyefml.efmlGetPcieThroughput(idx)[source]

Get device PCIe link throughput info. It will collect information in 10ms

Parameters

idx (int) – selected device index

Returns

tx_throughput(float) : PCIe link Tx throughput | efmlPcieThroughputInfo_t:rx_throughput(float) : PCIe link Rx throughput | efmlPcieThroughputInfo_t:tx_nak(uint64) : PCIe link Tx NAK counts | efmlPcieThroughputInfo_t:rx_nak(uint64) : PCIe link Rx NAK counts

Return type

efmlPcieThroughputInfo_t

Error

EFML_ERROR_UNINITIALIZED: library not initialized
EFML_ERROR_INVALID_ARGUMENT: invalid input parameters
pyefml.efmlGetEslPortNum(idx)[source]

Get device ESL port number

Parameters

idx (int) – selected device index

Returns

ESL port number in int

Error

EFML_ERROR_UNINITIALIZED: library not initialized
EFML_ERROR_INVALID_ARGUMENT: invalid input parameters
pyefml.efmlGetEslPortInfo(idx, port_id)[source]

Get device ESL port info

Parameters
  • idx (|) – selected device index

  • port_id (|) – selected ESL port ID

Returns

connected(c_uint) : port connected status | efmlEslPortInfo_t:vendor_id(char [16]) : port vendor id | efmlEslPortInfo_t:device_id(c_uint) : port device id | efmlEslPortInfo_t:domain_id(c_uint) : port domain id | efmlEslPortInfo_t:bus_id(char [16]) : port bus id | efmlEslPortInfo_t:dev_id(c_uint) : port device id | efmlEslPortInfo_t:func_id(c_uint) : port function id | efmlEslPortInfo_t:port_id(c_uint) : port id | efmlEslPortInfo_t:port_type(efmlEslPortType_t) : port type | efmlEslPortInfo_t:remote_card_id(c_uint) : remote port card id | efmlEslPortInfo_t:remote_vendor_id(char [16]) :remote port vendor id | efmlEslPortInfo_t:remote_device_id(c_uint) :remote port device id | efmlEslPortInfo_t:remote_domain_id(c_uint) :remote port domain id | efmlEslPortInfo_t:remote_bus_id(char [16]) :remote port bus id | efmlEslPortInfo_t:remote_dev_id(c_uint) :remote port device id | efmlEslPortInfo_t:remote_func_id(c_uint) :remote port function id | efmlEslPortInfo_t:remote_port_id(c_uint) :remote port id | efmlEslPortInfo_t:remote_port_type(efmlEslPortType_t) :remote port type

Return type

efmlEslPortInfo_t

Error

EFML_ERROR_UNINITIALIZED: library not initialized
EFML_ERROR_INVALID_ARGUMENT: invalid input parameters
pyefml.efmlGetEslLinkInfo(idx, port_id)[source]

Get device ESL port link info

Parameters
  • idx (|) – selected device index

  • port_id (|) – selected ESL port ID

Returns

link_speed(efmlEslSpeed_t) : port link speed | efmlEslLinkInfo_t:max_link_speed(efmlEslSpeed_t) : port max supported link speed | efmlEslLinkInfo_t:link_width(efmlEslWidth_t) : port link width | efmlEslLinkInfo_t:max_link_width(efmlEslWidth_t) : port max supported link width

Return type

efmlEslLinkInfo_t

Error

EFML_ERROR_UNINITIALIZED: library not initialized
EFML_ERROR_INVALID_ARGUMENT: invalid input parameters
pyefml.efmlGetEslThroughput(idx, port_id)[source]

Get device ESL port throughput info

Parameters
  • idx (|) – selected device index

  • port_id (|) – selected ESL port ID

Returns

tx_throughput(float) : port tx throughput | efmlEslThroughputInfo_t:rx_throughput(float) : port rx throughput | efmlEslThroughputInfo_t:tx_nak(uint64) : port tx total NAK counts | efmlEslThroughputInfo_t:rx_nak(uint64) : port rx total NAK counts

Return type

efmlEslThroughputInfo_t

Error

EFML_ERROR_UNINITIALIZED: library not initialized
EFML_ERROR_INVALID_ARGUMENT: invalid input parameters
EFML_ERROR_ESL_PORT_NUMBER_ERR: ESL port number error
pyefml.efmlGetDevClusterCount(idx)[source]

Get total DTU device cluster numbers in the dtu

Parameters

idx (|) – selected device index

Returns

total device cluster numbers

Error

EFML_ERROR_UNINITIALIZED: library not initialized

pyefml.efmlGetDevClusterUsage(idx, cluster_idx)[source]

Get DTU usage

Parameters

idx (int) – selected device index

Returns

DTU usage value in float

Error

EFML_ERROR_UNINITIALIZED: library not initialized
EFML_ERROR_INVALID_ARGUMENT: invalid input parameters
pyefml.efmlGetDevHealth(idx)[source]

Get DTU usage

Parameters

idx (int) – selected device index

Returns

DTU usage value in float

Error

EFML_ERROR_UNINITIALIZED: library not initialized
EFML_ERROR_INVALID_ARGUMENT: invalid input parameters
pyefml.efmlGetVdevCount(idx)[source]

Get virtual GCU numbers in the GCU.

Parameters

idx (int) – selected device index

Returns

total virtual GCU per GCU.

Error

EFML_ERROR_UNINITIALIZED: library not initialized

pyefml.efmlGetVdevDtuMem(idx, vdev_idx)[source]

Get vGCU mem info.

Parameters
  • idx (int) – selected device index

  • vdev_idx (int) – selected vGCU index

Returns

mem_total_size (c_uint): memory size | efmlDevMemInfo_t:mem_used (c_uint): memory usage

Return type

efmlDevMemInfo_t

Error

EFML_ERROR_UNINITIALIZED: library not initialized
EFML_ERROR_INVALID_ARGUMENT: invalid input parameters
pyefml.efmlGetVdevDtuUsage(idx, vdev_idx)[source]

Get vGCU usage

Parameters
  • idx (int) – selected device index

  • vdev_idx (int) – selected vGCU index

Returns

vGCU usage value in float

Error

EFML_ERROR_UNINITIALIZED: library not initialized
EFML_ERROR_INVALID_ARGUMENT: invalid input parameters