Device configurations
Overview
These APIs are for configuration More…
// global functions XPUM_API xpum_result_t xpumGetDeviceStandbys( xpum_device_id_t deviceId, xpum_standby_data_t dataArray[], uint32_t* count ); XPUM_API xpum_result_t xpumSetDeviceStandby( xpum_device_id_t deviceId, const xpum_standby_data_t standby ); XPUM_API xpum_result_t xpumGetDevicePowerLimits( xpum_device_id_t deviceId, int32_t tileId, xpum_power_limits_t* pPowerLimits ); XPUM_API xpum_result_t xpumSetDevicePowerSustainedLimits( xpum_device_id_t deviceId, int32_t tileId, const xpum_power_sustained_limit_t sustained_limit ); XPUM_API xpum_result_t xpumGetDeviceFrequencyRanges( xpum_device_id_t deviceId, xpum_frequency_range_t* dataArray, uint32_t* count ); XPUM_API xpum_result_t xpumSetDeviceFrequencyRange( xpum_device_id_t deviceId, const xpum_frequency_range_t frequency ); XPUM_API xpum_result_t xpumGetDeviceSchedulers( xpum_device_id_t deviceId, xpum_scheduler_data_t dataArray[], uint32_t* count ); XPUM_API xpum_result_t xpumSetDeviceSchedulerTimeoutMode( xpum_device_id_t deviceId, const xpum_scheduler_timeout_t sched_timeout ); XPUM_API xpum_result_t xpumGetDevicePowerProps( xpum_device_id_t deviceId, xpum_power_prop_data_t dataArray[], uint32_t* count ); XPUM_API xpum_result_t xpumSetDeviceSchedulerTimesliceMode( xpum_device_id_t deviceId, const xpum_scheduler_timeslice_t sched_timeslice ); XPUM_API xpum_result_t xpumSetDeviceSchedulerExclusiveMode( xpum_device_id_t deviceId, const xpum_scheduler_exclusive_t sched_exclusive ); XPUM_API xpum_result_t xpumSetDeviceSchedulerDebugMode( xpum_device_id_t deviceId, const xpum_scheduler_debug_t sched_debug ); XPUM_API xpum_result_t xpumGetFreqAvailableClocks( xpum_device_id_t deviceId, uint32_t tileId, double dataArray[], uint32_t* count ); XPUM_API xpum_result_t xpumGetDeviceProcessState( xpum_device_id_t deviceId, xpum_device_process_t dataArray[], uint32_t* count ); XPUM_API xpum_result_t xpumApplyPPR( xpum_device_id_t deviceId, xpum_diag_result_t* diagResult, xpum_health_status_t* healthState ); XPUM_API xpum_result_t xpumResetDevice(xpum_device_id_t deviceId, bool force); XPUM_API xpum_result_t xpumGetDeviceComponentOccupancyRatio( xpum_device_id_t deviceId, xpum_device_tile_id_t tileId, xpum_sampling_interval_t samplingInterval, xpum_device_components_ratio_t dataArray[], uint32_t* count ); XPUM_API xpum_result_t xpumGetDeviceUtilizationByProcess( xpum_device_id_t deviceId, uint32_t utilInterval, xpum_device_util_by_process_t dataArray[], uint32_t* count ); XPUM_API xpum_result_t xpumGetAllDeviceUtilizationByProcess( uint32_t utilInterval, xpum_device_util_by_process_t dataArray[], uint32_t* count ); XPUM_API xpum_result_t xpumGetPerformanceFactor( xpum_device_id_t deviceId, xpum_device_performancefactor_t dataArray[], uint32_t* count ); XPUM_API xpum_result_t xpumSetPerformanceFactor( xpum_device_id_t deviceId, xpum_device_performancefactor_t performanceFactor ); XPUM_API xpum_result_t xpumGetFabricPortConfig( xpum_device_id_t deviceId, xpum_fabric_port_config_t dataArray[], uint32_t* count ); XPUM_API xpum_result_t xpumSetFabricPortConfig( xpum_device_id_t deviceId, xpum_fabric_port_config_t fabricPortConfig ); XPUM_API xpum_result_t xpumGetEccState( xpum_device_id_t deviceId, bool* available, bool* configurable, xpum_ecc_state_t* current, xpum_ecc_state_t* pending, xpum_ecc_action_t* action ); XPUM_API xpum_result_t xpumSetEccState( xpum_device_id_t deviceId, xpum_ecc_state_t newState, bool* available, bool* configurable, xpum_ecc_state_t* current, xpum_ecc_state_t* pending, xpum_ecc_action_t* action );
Detailed Documentation
These APIs are for configuration
Global Functions
XPUM_API xpum_result_t xpumGetDeviceStandbys( xpum_device_id_t deviceId, xpum_standby_data_t dataArray[], uint32_t* count )
Get device standby mode.
This function is used to get the standby mode of device
Support Platform: Linux
Parameters:
deviceId |
IN: The device Id |
dataArray |
IN/OUT: First pass NULL to query raw data count. Then pass array with desired length to store raw data. |
count |
IN/OUT: When dataArray is NULL, count will be filled with the number of available entries, and return. When dataArray is not NULL, count denotes the length of dataArray, count should be equal to or larger than the number of available entries, when return, the count will store real number of entries returned by dataArray |
Returns:
xpum_result_t
XPUM_OK if query successfully
XPUM_BUFFER_TOO_SMALL if count is smaller than needed
XPUM_API xpum_result_t xpumSetDeviceStandby( xpum_device_id_t deviceId, const xpum_standby_data_t standby )
Set device standby mode.
This function is used to set the standby mode of device
Support Platform: Linux, Windows
Parameters:
deviceId |
IN: The device Id |
standby |
IN: The standby mode need to be set |
Returns:
xpum_result_t
XPUM_OK if set successfully
XPUM_GENERIC_ERROR if set failure
XPUM_API xpum_result_t xpumGetDevicePowerLimits( xpum_device_id_t deviceId, int32_t tileId, xpum_power_limits_t* pPowerLimits )
Get device power limit.
This function is used to get the power limit of device
Support Platform: Linux, Windows
Parameters:
deviceId |
IN: The device Id |
tileId |
IN: The tile Id. if tileId is -1, return device’s powerlimit; otherwise return tile’s powerlimit. |
pPowerLimits |
IN/OUT: The detailed power limit data. Parameter 'interval' has been obsoleted. |
Returns:
xpum_result_t
XPUM_OK if query successfully
XPUM_GENERIC_ERROR if set failure
XPUM_API xpum_result_t xpumSetDevicePowerSustainedLimits( xpum_device_id_t deviceId, int32_t tileId, const xpum_power_sustained_limit_t sustained_limit )
Set device sustained power limit.
This function is used to set the sustained power limit of device
Support Platform: Linux, Windows
Parameters:
deviceId |
IN: The device Id |
tileId |
IN: The tile Id |
sustained_limit |
IN: The sustained power limit need to be set. Parameter 'interval' will be ignored. |
Returns:
xpum_result_t
XPUM_OK if query successfully
XPUM_GENERIC_ERROR if set failure
XPUM_API xpum_result_t xpumGetDeviceFrequencyRanges( xpum_device_id_t deviceId, xpum_frequency_range_t* dataArray, uint32_t* count )
Get device frequency ranges.
This function is used to get the frequency ranges
Support Platform: Linux, Windows
Parameters:
deviceId |
IN: The device Id |
dataArray |
IN/OUT: First pass NULL to query raw data count. Then pass array with desired length to store raw data. |
count |
IN/OUT: When dataArray is NULL, count will be filled with the number of available entries, and return. When dataArray is not NULL, count denotes the length of dataArray, count should be equal to or larger than the number of available entries, when return, the count will store real number of entries returned by dataArray |
Returns:
xpum_result_t
XPUM_OK if query successfully
XPUM_BUFFER_TOO_SMALL if count is smaller than needed
XPUM_API xpum_result_t xpumSetDeviceFrequencyRange( xpum_device_id_t deviceId, const xpum_frequency_range_t frequency )
Set device frequency ranges.
This function is used to set the frequency ranges
Support Platform: Linux, Windows
Parameters:
deviceId |
IN: The device Id |
frequency |
IN: The frequency ranges need to be set |
Returns:
xpum_result_t
XPUM_OK if query successfully
XPUM_GENERIC_ERROR if set failure
XPUM_API xpum_result_t xpumGetDeviceSchedulers( xpum_device_id_t deviceId, xpum_scheduler_data_t dataArray[], uint32_t* count )
Get device scheduler mode.
This function is used to get the scheduler mode
Support Platform: Linux
Parameters:
deviceId |
IN: The device Id |
dataArray |
IN/OUT: First pass NULL to query raw data count. Then pass array with desired length to store raw data. |
count |
IN/OUT: When dataArray is NULL, count will be filled with the number of available entries, and return. When dataArray is not NULL, count denotes the length of dataArray, count should be equal to or larger than the number of available entries, when return, the count will store real number of entries returned by dataArray |
Returns:
xpum_result_t
XPUM_OK if query successfully
XPUM_BUFFER_TOO_SMALL if count is smaller than needed
XPUM_API xpum_result_t xpumSetDeviceSchedulerTimeoutMode( xpum_device_id_t deviceId, const xpum_scheduler_timeout_t sched_timeout )
Set device the scheduler(timeout) mode.
This function is used to set the scheduler (timeout) mode
Support Platform: Linux
Parameters:
deviceId |
IN: The device Id |
sched_timeout |
IN: The scheduler timeout mode need to be set |
Returns:
xpum_result_t
XPUM_OK if query successfully
XPUM_GENERIC_ERROR if set failure
XPUM_API xpum_result_t xpumGetDevicePowerProps( xpum_device_id_t deviceId, xpum_power_prop_data_t dataArray[], uint32_t* count )
Get device the power props mode.
This function is used to get the power props
Support Platform: Linux, Windows
Parameters:
deviceId |
IN: The device Id |
dataArray |
IN/OUT: First pass NULL to query raw data count. Then pass array with desired length to store raw data. |
count |
IN/OUT: When dataArray is NULL, count will be filled with the number of available entries, and return. When dataArray is not NULL, count denotes the length of dataArray, count should be equal to or larger than the number of available entries, when return, the count will store real number of entries returned by dataArray |
Returns:
xpum_result_t
XPUM_OK if query successfully
XPUM_GENERIC_ERROR if set failure
XPUM_API xpum_result_t xpumSetDeviceSchedulerTimesliceMode( xpum_device_id_t deviceId, const xpum_scheduler_timeslice_t sched_timeslice )
Set device the scheduler(time slice) mode.
This function is used to set the scheduler (time slice) mode
Support Platform: Linux, Windows
Parameters:
deviceId |
IN: The device Id |
sched_timeslice |
IN: The scheduler time slice mode need to be set |
Returns:
xpum_result_t
XPUM_OK if query successfully
XPUM_GENERIC_ERROR if set failure
XPUM_API xpum_result_t xpumSetDeviceSchedulerExclusiveMode( xpum_device_id_t deviceId, const xpum_scheduler_exclusive_t sched_exclusive )
Set device the scheduler(exclusive) mode.
This function is used to set the scheduler (exclusive) mode. Caution: It calls xpumShutdown internally.Please make sure other API calls are finished before calling the API, the behaviour of calling other APIs during setting is undefined. And it is recommended to stop current process and use a new process to initialize XPUM after setting.
Support Platform: Linux, Windows
Parameters:
deviceId |
IN: The device Id |
sched_exclusive |
IN: The scheduler time slice mode need to be set |
Returns:
xpum_result_t
XPUM_OK if query successfully
XPUM_GENERIC_ERROR if set failure
XPUM_API xpum_result_t xpumSetDeviceSchedulerDebugMode( xpum_device_id_t deviceId, const xpum_scheduler_debug_t sched_debug )
Set device the scheduler(debug) mode.
This function is used to set the scheduler (debug) mode. It is not supported since 1.2.25
Support Platform: Linux
Parameters:
deviceId |
IN: The device Id |
sched_debug |
IN: The scheduler debug mode need to be set |
Returns:
xpum_result_t
XPUM_OK if query successfully
XPUM_GENERIC_ERROR if set failure
XPUM_API xpum_result_t xpumGetFreqAvailableClocks( xpum_device_id_t deviceId, uint32_t tileId, double dataArray[], uint32_t* count )
Get device available frequency clocks.
This function is used to get available frequency clocks
Support Platform: Linux, Windows
Parameters:
deviceId |
IN: The device Id |
tileId |
IN: The tile Id |
dataArray |
IN/OUT: First pass NULL to query raw data count. Then pass array with desired length to store raw data. |
count |
IN/OUT: When dataArray is NULL, count will be filled with the number of available entries, and return. When dataArray is not NULL, count denotes the length of dataArray, count should be equal to or larger than the number of available entries, when return, the count will store real number of entries returned by dataArray |
Returns:
xpum_result_t
XPUM_OK if query successfully
XPUM_BUFFER_TOO_SMALL if count is smaller than needed
XPUM_API xpum_result_t xpumGetDeviceProcessState( xpum_device_id_t deviceId, xpum_device_process_t dataArray[], uint32_t* count )
Get the client processes of the device.
This function is used to get the client processes of the device
Support Platform: Linux
Parameters:
deviceId |
IN: The device Id |
dataArray |
IN/OUT: First pass NULL to query raw data count. Then pass array with desired length to store raw data. |
count |
IN/OUT: When dataArray is NULL, count will be filled with the number of available entries, and return. When dataArray is not NULL, count denotes the length of dataArray, count should be equal to or larger than the number of available entries, when return, the count will store real number of entries returned by dataArray |
Returns:
xpum_result_t
XPUM_OK if query successfully
XPUM_BUFFER_TOO_SMALL if count is smaller than needed
XPUM_API xpum_result_t xpumApplyPPR( xpum_device_id_t deviceId, xpum_diag_result_t* diagResult, xpum_health_status_t* healthState )
Apply PPR to the device.
This function is used to apply PPR to the device. Caution: xpumApplyPPR calls xpumShutdown internally, please make sure other API calls are finished before calling xpumApplyPPR, the behaviour of calling other APIs during applying ppr is undefined. And it is recommended to stop current process and use a new process to initialize XPUM after resetting.
Support Platform: Linux
Parameters:
deviceId |
IN: The device Id |
diagResult |
OUT: PPR diag test result |
healthStete |
OUT: memory health state after running PPR |
Returns:
xpum_result_t
XPUM_OK if query successfully
XPUM_UPDATE_FIRMWARE_TASK_RUNNING if device is updating firmware
XPUM_API xpum_result_t xpumResetDevice(xpum_device_id_t deviceId, bool force)
Reset the device.
This function is used to reset the device. Caution: xpumResetDevice calls xpumShutdown internally, please make sure other API calls are finished before calling xpumResetDevice, the behaviour of calling other APIs during resetting is undefined. And it is recommended to stop current process and use a new process to initialize XPUM after resetting.
Support Platform: Linux
Parameters:
deviceId |
IN: The device Id |
force |
IN: force to reset the device or not |
Returns:
xpum_result_t
XPUM_OK if query successfully
XPUM_UPDATE_FIRMWARE_TASK_RUNNING if device is updating firmware
XPUM_API xpum_result_t xpumGetDeviceComponentOccupancyRatio( xpum_device_id_t deviceId, xpum_device_tile_id_t tileId, xpum_sampling_interval_t samplingInterval, xpum_device_components_ratio_t dataArray[], uint32_t* count )
Get the GPU function component occupancy ratio of the device.
This function is used to get the gpu function component occupancy ratio of the device
Support Platform: Linux
Parameters:
deviceId |
IN: The device Id |
tileId |
IN: The tile Id |
samplingInterval |
IN: The sampling interval |
dataArray |
IN/OUT: First pass NULL to query raw data count. Then pass array with desired length to store raw data. |
count |
IN/OUT: When dataArray is NULL, count will be filled with the number of tile, and return. When dataArray is not NULL, count denotes the length of dataArray, count should be equal to or larger than the number of available entries, when return, the count will store real number of entries returned by dataArray |
Returns:
xpum_result_t
XPUM_OK if query successfully
XPUM_BUFFER_TOO_SMALL if count is smaller than needed
XPUM_API xpum_result_t xpumGetDeviceUtilizationByProcess( xpum_device_id_t deviceId, uint32_t utilInterval, xpum_device_util_by_process_t dataArray[], uint32_t* count )
Get the device utiliztions by processes.
This function is used to get the device utiliztions by process
Support Platform: Linux
Parameters:
deviceId |
IN: The device Id |
utilInterval |
IN: The interval in microseond to caculate utilization, range (0, 1000 * 1000] |
dataArray |
IN/OUT: The array to store raw data. |
count |
IN/OUT: The count denotes the length of dataArray, count should be equal to or larger than the number of available entries, when return, the count will store real number of entries returned by dataArray |
Returns:
xpum_result_t
XPUM_OK if query successfully
XPUM_BUFFER_TOO_SMALL if count is smaller than needed
XPUM_INTERVAL_INVALID if interval is not in (0, 1000 * 1000]
XPUM_API xpum_result_t xpumGetAllDeviceUtilizationByProcess( uint32_t utilInterval, xpum_device_util_by_process_t dataArray[], uint32_t* count )
Get the device (all) utiliztions by processes.
This function is used to get the device utiliztions by process
Support Platform: Linux
Parameters:
utilInterval |
IN: The interval in microseond to caculate utilization, range (0, 1000 * 1000] |
dataArray |
IN/OUT: The array to store raw data. |
count |
IN/OUT: The count denotes the length of dataArray, count should be equal to or larger than the number of available entries, when return, the count will store real number of entries returned by dataArray |
Returns:
xpum_result_t
XPUM_OK if query successfully
XPUM_BUFFER_TOO_SMALL if count is smaller than needed
XPUM_INTERVAL_INVALID if interval is not in (0, 1000 * 1000]
XPUM_API xpum_result_t xpumGetPerformanceFactor( xpum_device_id_t deviceId, xpum_device_performancefactor_t dataArray[], uint32_t* count )
Get the performance factor of the device.
This function is used to get the performance factor of device
Support Platform: Linux
Parameters:
deviceId |
IN: The device Id |
dataArray |
IN/OUT: First pass NULL to query raw data count. Then pass array with desired length to store raw data. |
count |
IN/OUT: When dataArray is NULL, count will be filled with the number of available entries, and return. When dataArray is not NULL, count denotes the length of dataArray, count should be equal to or larger than the number of available entries, when return, the count will store real number of entries returned by dataArray |
Returns:
xpum_result_t
XPUM_OK if query successfully
XPUM_BUFFER_TOO_SMALL if count is smaller than needed
XPUM_API xpum_result_t xpumSetPerformanceFactor( xpum_device_id_t deviceId, xpum_device_performancefactor_t performanceFactor )
Set the performance factor of the device.
This function is used to set the performance factor of device
Support Platform: Linux
Parameters:
deviceId |
IN: The device Id |
performanceFactor |
IN: The performanceFactor to be set |
Returns:
xpum_result_t
XPUM_OK if query successfully
XPUM_GENERIC_ERROR if set failure
XPUM_API xpum_result_t xpumGetFabricPortConfig( xpum_device_id_t deviceId, xpum_fabric_port_config_t dataArray[], uint32_t* count )
Get the fabric port configuration of the device.
This function is used to get the fabric port configuration of the device
Support Platform: Linux
Parameters:
deviceId |
IN: The device Id |
dataArray |
IN/OUT: First pass NULL to query raw data count. Then pass array with desired length to store raw data. |
count |
IN/OUT: When dataArray is NULL, count will be filled with the number of available entries, and return. When dataArray is not NULL, count denotes the length of dataArray, count should be equal to or larger than the number of available entries, when return, the count will store real number of entries returned by dataArray |
Returns:
xpum_result_t
XPUM_OK if query successfully
XPUM_BUFFER_TOO_SMALL if count is smaller than needed
XPUM_API xpum_result_t xpumSetFabricPortConfig( xpum_device_id_t deviceId, xpum_fabric_port_config_t fabricPortConfig )
Set the fabric port configuration of the device.
This function is used to set the fabric port configuration of the device
Support Platform: Linux
Parameters:
deviceId |
IN: The device Id |
fabricPortConfig |
IN: The fabric port configuration to be set |
Returns:
xpum_result_t
XPUM_OK if query successfully
XPUM_GENERIC_ERROR if set failure
XPUM_API xpum_result_t xpumGetEccState( xpum_device_id_t deviceId, bool* available, bool* configurable, xpum_ecc_state_t* current, xpum_ecc_state_t* pending, xpum_ecc_action_t* action )
Get the memory ECC state of the device.
This function is used to get the memory ECC state of the device
Support Platform: Linux, Windows
Parameters:
deviceId |
IN: The device Id |
available |
OUT: memory ECC is available, or not |
configurable |
OUT: memory ECC is configurable, or not |
current |
OUT: the current state of memory ECC |
pending |
OUT: the pending state of memory ECC |
action |
OUT: the action need to do to switch to the pending state |
Returns:
xpum_result_t
XPUM_OK if query successfully
XPUM_GENERIC_ERROR if set failure
XPUM_API xpum_result_t xpumSetEccState( xpum_device_id_t deviceId, xpum_ecc_state_t newState, bool* available, bool* configurable, xpum_ecc_state_t* current, xpum_ecc_state_t* pending, xpum_ecc_action_t* action )
Set the memory ECC state of the device.
This function is used to set the memory ECC state of the device
Support Platform: Linux, Windows
Parameters:
deviceId |
IN: The device Id |
newState |
IN: new state to set |
available |
OUT: memory ECC is available, or not |
configurable |
OUT: memory ECC is configurable, or not |
current |
OUT: the current state of memory ECC |
pending |
OUT: the pending state of memory ECC |
action |
OUT: the action need to do to switch to the pending state |
Returns:
xpum_result_t
XPUM_OK if query successfully
XPUM_GENERIC_ERROR if set failure