×

签到

分享到微信

打开微信,使用扫一扫进入页面后,点击右上角菜单,

点击“发送给朋友”或“分享到朋友圈”完成分享

cnrtInit失败,error: 632029 解决中 magicx2024-06-13 15:09:34 回复 2 查看 使用求助
cnrtInit失败,error: 632029
分享到:

代码如下:

```

#include <iostream>


int main(int argc, char **argv)

{


cnrtRet_t ret;

int major;

int minor;

int patch;

   // ret = cnrtGetLibVersion(&major, &minor, &patch);

   // if (ret != cnrtSuccess) {

   //     std::cerr << "########cnrtGetLibVersion failed: " << ret << std::endl;

   //     return 1;

   // }

   // std::cout << "########################cnrtGetLibVersion: " << major << "." << minor << "." << patch << std::endl;



ret = cnrtInit(0);

if (ret != cnrtSuccess) {

std::cerr << "########cnrtInit failed: " << ret << std::endl;

return 1;

}


   // // 获取device数量

unsigned int deviceCount = 0;

ret = cnrtGetDeviceCount(&deviceCount);

if (ret != cnrtSuccess) {

std::cerr << "########cnrtGetDeviceCount failed: " << ret << std::endl;

return 1;

}

std::cout << "ret: " << ret <<   "   deviceCount: " << deviceCount << std::endl;


cnrtDestroy();

return 0;

}

```

执行时初始化报错,能帮忙看一下什么原因么?

image.png

版权所有 © 2024 寒武纪 Cambricon.com 备案/许可证号:京ICP备17003415号-1
关闭