dsmi_query_errorstring
Prototype
int dsmi_query_errorstring(int device_id,unsigned int errorcode, unsigned char *perrorinfo,int buffsize)
Description
Queries the error code description of a device after calling dsmi_get_device_errorcode.
For the Ascend 310 AI Processor, this API supports mini modules (EP) and standard PCIe cards.
Parameters
Parameter |
Input/Output |
Description |
---|---|---|
device_id |
Input |
Device ID For the Ascend 310 AI Processor, the value range is 0–63. Obtain the actual device ID by calling dsmi_list_device. |
errorcode |
Input |
Error code to be queried. For details, see Black Box Error Codes. |
perrorinfo |
Output |
Error code description |
buffsize |
Input |
Buffer size, fixed at 48 bytes |
Returns
Type |
Description |
---|---|
int |
0 on success; else, failure |
Restrictions
None
Example
#define ERROR_CODE_MAX_NUM (128) #define BUFF_SIZE (48) ... int ret = 0; int errorcount = 0; unsigned char perrorinfo[BUFF_SIZE] = {0}; unsigned int perrorcode [ERROR_CODE_MAX_NUM] = {0}; ret = dsmi_get_device_errorcode(0, &errorcount, perrorcode); if((ret != 0) || (errorcount == 0)) { //To-do: records logs. return ret; } ret = dsmi_query_errorstring(0, perrorcode[0], perrorinfo, BUFF_SIZE); if(ret != 0) { //To-do: records logs. return ret; } ...