pyefml
¶
Module Contents¶
Classes¶
Structure base class |
|
Structure base class |
|
Structure base class |
|
Structure base class |
|
Structure base class |
|
Structure base class |
|
Structure base class |
|
Structure base class |
|
Structure base class |
|
Structure base class |
|
Structure base class |
|
Structure base class |
|
Structure base class |
Functions¶
|
|
|
|
|
Init efml libary |
Close efml libary, release allocated resource |
|
|
Translate returned error code to string |
Get KMD (kernel mode driver) version info |
|
Get EFML lib version info |
|
|
Select current device by index |
Get total DTU device numbers in the system |
|
|
Get DTU device name |
|
Get DTU device UUID(Universally Unique Identifier) |
|
Get DTU device SN info(Serial Number) |
|
Get DTU device PN info(Part Number) |
|
Get DTU firmware version |
|
Get DTU/MEM temperature |
|
Get DTU voltage |
|
Get DTU power consumption |
|
Get DTU DPM(Dynamic Power Managerment) level |
|
Get DTU usage |
|
Get DTU/Mem clock frequency |
Dump device list in system |
|
|
Get detailed DTU information |
|
Get device memory information |
|
Get device memory information |
|
Get device memory ECC status |
|
Get device PCIe link speed |
|
Get device PCIe link width |
|
Get device PCIe link information |
Get device PCIe link throughput info. It will collect information in 10ms |
|
|
Get device ESL port number |
|
Get device ESL port info |
|
Get device ESL port link info |
|
Get device ESL port throughput info |
Get total DTU device cluster numbers in the dtu |
|
|
Get DTU usage |
|
Get DTU usage |
|
Get virtual GCU numbers in the GCU. |
|
Get vGCU mem info. |
|
Get vGCU usage |
Attributes¶
- 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 initializedEFML_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 initializedEFML_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 initializedEFML_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 initializedEFML_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 initializedEFML_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 initializedEFML_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 initializedEFML_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 initializedEFML_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 initializedEFML_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 initializedEFML_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 initializedEFML_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
Error
EFML_ERROR_UNINITIALIZED: library not initializedEFML_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 initializedEFML_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 initializedEFML_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 initializedEFML_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 initializedEFML_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 initializedEFML_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 initializedEFML_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 initializedEFML_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 initializedEFML_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 initializedEFML_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 initializedEFML_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 initializedEFML_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 initializedEFML_ERROR_INVALID_ARGUMENT: invalid input parametersEFML_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 initializedEFML_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 initializedEFML_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 initializedEFML_ERROR_INVALID_ARGUMENT: invalid input parameters