int dcmi_get_computing_power_info(int card_id, int device_id, int type, struct dsmi_computing_power_info *pcomputing_power)
查询算力信息。
参数名称 |
输入/输出 |
类型 |
描述 |
|---|---|---|---|
card_id |
输入 |
int |
设备ID,当前实际支持的ID通过dcmi_get_card_num_list接口获取。 |
device_id |
输入 |
int |
芯片ID,通过dcmi_get_device_id_in_card接口获取。取值范围如下: NPU芯片:[0, device_id_max-1]。 说明:
device_id_max值为2,当device_id为0或1时表示NPU芯片;当device_id为2时表示MCU芯片。 |
type |
输入 |
int |
获取算力信息的类型。 取值说明:当前取值仅支持1,表示查询AIcore核数。 |
pcomputing_power |
输出 |
struct dsmi_computing_power_info* |
返回算力信息,算力信息结构体: struct dsmi_computing_power_info { unsigned int data1; unsigned int reserve[3]; }; Type输入为NPU_TYPE即1时,data1代表aicore核数。 |
类型 |
描述 |
|---|---|
int |
处理结果:
|
无。
产品形态 |
物理机场景(裸机)root用户 |
物理机场景(裸机)运行用户组(非root用户) |
物理机+普通容器场景root用户 |
物理机+容器AVI场景root用户 |
|---|---|---|---|---|
Atlas 900 A3 SuperPoD 超节点 |
Y |
Y |
Y |
NA |
Atlas 9000 A3 SuperPoD 集群算力系统 |
Y |
Y |
Y |
NA |
Atlas 800T A3 超节点 |
Y |
Y |
Y |
Y |
Atlas 800I A3 系列硬件产品 |
Y |
Y |
Y |
Y |
A200T A3 Box8 系列硬件产品 |
Y |
Y |
Y |
NA |
注:Y表示支持;N表示不支持;NA表示不涉及,当前未规划此场景。 |
||||
…
int ret = 0;
int card_id = 0x3;
int device_id = 0;
struct dsmi_computing_power_info computing_power = {0};
int type = 1;
ret = dcmi_get_computing_power_info(card_id, device_id, type, &computing_power);
if (ret != 0){
//todo:记录日志
return ret;
}
…