一、问题现象(附报错日志上下文):
[WARNING] ME(366054,7f83fbb010,tensor_add_sample):2023-07-28-11:57:46.590.083 [mindspore/ccsrc/cxx_api/model/acl/model_converter.cc:40] ClearCurrentRtCtx] Call aclrtCreateContext failed, ret = 507033 [ERROR] CORE(366054,7f83fbb010,tensor_add_sample):2023-07-28-11:58:01.132.839 [mindspore/core/utils/log_adapter.cc:392] operator^] Runtime error for null exception handler. terminate called after throwing an instance of 'std::runtime_error' what(): Device 0 call aclrtSetDevice failed, ret[507033]
C++ Call Stack: (For framework developers) mindspore/ccsrc/cxx_api/graph/acl/acl_graph_impl.cc:111 InitEnv
已放弃
二、软件版本:
-- CANN 版本 (Ascend-cann-nnae_6.3.RC1.alpha001_linux-aarch64.run、Ascend-cann-kernels-310p_6.3.RC2.alpha001_linux.run、Ascend-cann-toolkit_6.3.RC1.alpha001_linux-aarch64.run) --Tensorflow/Pytorch/MindSpore 版本:MindSpore2.0.1 --Python 版本 (3.8.2): --操作系统版本 (Kylin-Desktop-V10-SP1-OEM-X100-20211117-arm64):
三、测试步骤:
- wget https://obs.dualstack.cn-north-4.myhuaweicloud.com/mindspore-website/sample_resources/ascend310_single_op_sample.zip
- unzip ascend310_single_op_sample.zip && cd ascend310_single_op_sample
- cmake . -DMINDPSORE_APTH=/root/midnspore/mindspore_ascend-2.0.1-linux_aarch64
- make
- export ASCEND_SLOG_PRINT_TO_STDOUT=1 export ASCEND_GLOBAL_LOG_LEVEL=1
- ./tensor_add_sample
四、日志信息:
https://gitee.com/ZCKX/test/blob/master/log.t
****************************************************解答*****************************************************
这个问题已经解决了,原因是没有链接python库,我修改了测试用例中的CMakeList.txt,查找python库并将之链接到可执行程序上,修改前后cmake如下图:
运行时报了新的错误