算子开发报错
收藏回复举报
算子开发报错
t('forum.solved') 已解决
发表于2024-03-12 10:50:44
0 查看

环境是OrangePI ,系统是Ubuntu最新镜像

操作是按照官方教程进行的: https://www.hiascend.com/document/detail/zh/canncommercial/700/operatordev/Ascendcopdevg/atlas_ascendc_10_0026.html

输出如下:

(base) root@orangepiaipro:~/workspace/add2# ./build.sh  

Preset CMake variables: 

 
  ASCEND_CANN_PACKAGE_PATH:PATH="/usr/local/Ascend/ascend-toolkit/latest" 

  ASCEND_COMPUTE_UNIT:STRING="ascend310b4" 

  ASCEND_PYTHON_EXECUTABLE:STRING="python3" 

  CMAKE_BUILD_TYPE:STRING="Release" 

  CMAKE_CROSS_PLATFORM_COMPILER:PATH="/usr/bin/aarch64-linux-gnu-g++" 

  CMAKE_INSTALL_PREFIX:PATH="/root/workspace/add2/build_out" 

  ENABLE_BINARY_PACKAGE:BOOL="True" 

  ENABLE_CROSS_COMPILE:BOOL="False" 

  ENABLE_SOURCE_PACKAGE:BOOL="True" 

  ENABLE_TEST:BOOL="True" 

  vendor_name:STRING="customize" 

 
-- The C compiler identification is GNU 11.4.0 

-- The CXX compiler identification is GNU 11.4.0 

-- Detecting C compiler ABI info 

-- Detecting C compiler ABI info - done 

-- Check for working C compiler: /usr/bin/cc - skipped 

-- Detecting C compile features 

-- Detecting C compile features - done 

-- Detecting CXX compiler ABI info 

-- Detecting CXX compiler ABI info - done 

-- Check for working CXX compiler: /usr/bin/c++ - skipped 

-- Detecting CXX compile features 

-- Detecting CXX compile features - done 

-- Opbuild generating sources 

opbuild ops info: Generator: aclopnn 

Aclnn Generator construct! 

Aclnn GenrateCode called! 

Aclnn GenrateCode end! 

Generator: cfg 

Stub Generator construct! 

Cfg GenrateCode called! 

Generator: op_proto 

OpProto Generator construct! 

OpProto GenrateCode called! 

Invalid socVersion ascend310b4 

 
opbuild ops error:  

-- Opbuild generating sources - done 

-- Configuring done 

-- Generating done 

CMake Warning: 

  Manually-specified variables were not used by the project: 

 
    CMAKE_CROSS_PLATFORM_COMPILER 

 


-- Build files have been written to: /root/workspace/add2/build_out 

[  7%] Building CXX object framework/tf_plugin/CMakeFiles/cust_tf_parsers.dir/tensorflow_add_custom_plugin.cc.o 

[ 15%] Generating scripts/install.sh, scripts/upgrade.sh 

[ 15%] Built target gen_version_info 

[ 23%] Building CXX object op_host/CMakeFiles/cust_op_proto.dir/add_custom.cpp.o 

[ 38%] Building CXX object op_host/CMakeFiles/cust_optiling.dir/add_custom.cpp.o 

[ 38%] Building CXX object op_host/CMakeFiles/cust_opapi.dir/__/autogen/aclnn_add_custom.cpp.o 

[ 46%] Building CXX object op_host/CMakeFiles/cust_op_proto.dir/__/autogen/op_proto.cc.o 

[ 53%] Generating tbe/op_info_cfg/ai_core/ascend310b4/aic-ascend310b4-ops-info.json 

[ 61%] Generating tbe/op_info_cfg/ai_core/npu_supported_ops.json 

[ 69%] Generating tbe/.impl_timestamp 

/root/workspace/add2/build_out/autogen /root/workspace/add2/build_out/op_kernel/tbe/op_info_cfg/ai_core 

[ 69%] Built target modify_vendor 

[INFO] Succed generated /root/workspace/add2/build_out/op_kernel/tbe/op_info_cfg/ai_core/npu_supported_ops.json 

 


==============check valid for ops info start============== 

==============check valid for ops info end================ 

 


Compile op info cfg successfully. 

[ 69%] Built target npu_supported_ops 

[ 69%] Built target ascendc_impl_gen 

[ 69%] Built target ops_info_gen_ascend310b4 

/root/workspace/add2/build_out/autogen/aclnn_add_custom.cpp:37:41: error: expected primary-expression before ‘inputDesc0_0’ 

   37 | uint32_t socSupportList[] = {TensorDesc inputDesc0_0[2] = 

      |                                         ^~~~~~~~~~~~ 

/root/workspace/add2/build_out/autogen/aclnn_add_custom.cpp:37:41: error: expected ‘}’ before ‘inputDesc0_0’ 

   37 | uint32_t socSupportList[] = {TensorDesc inputDesc0_0[2] = 

      |                             ~           ^~~~~~~~~~~~ 

/root/workspace/add2/build_out/autogen/aclnn_add_custom.cpp:42:24: error: ‘inputDesc0_0’ was not declared in this scope; did you mean ‘outputDesc0_0’? 

   42 | SupportInfo list0_0 = {inputDesc0_0, 2, outputDesc0_0, 1}; 

      |                        ^~~~~~~~~~~~ 

      |                        outputDesc0_0 

/root/workspace/add2/build_out/autogen/aclnn_add_custom.cpp: In function ‘aclnnStatus aclnnAddCustomGetWorkspaceSize(const aclTensor*, const aclTensor*, const aclTensor*, uint64_t*, aclOpExecutor**)’: 

/root/workspace/add2/build_out/autogen/aclnn_add_custom.cpp:135:95: error: ‘socSupportListLen’ was not declared in this scope 

  135 |     NNOPBASE_ASSERT_OK_RETVAL(NnopbaseAddSupportList(*executor, &supportList, socSupportList, socSupportListLen)); 

      |                                                                                               ^~~~~~~~~~~~~~~~~ 

/root/workspace/add2/build_out/autogen/aclnn_add_custom.cpp:87:42: note: in definition of macro ‘NNOPBASE_ASSERT_OK_RETVAL’ 

   87 |         const aclnnStatus _chk_stutus = (v);                            \ 

      |                                          ^ 

gmake[2]: *** [op_host/CMakeFiles/cust_opapi.dir/build.make:76: op_host/CMakeFiles/cust_opapi.dir/__/autogen/aclnn_add_custom.cpp.o] Error 1 

gmake[1]: *** [CMakeFiles/Makefile2:298: op_host/CMakeFiles/cust_opapi.dir/all] Error 2 

gmake[1]: *** Waiting for unfinished jobs.... 

[ 76%] Linking CXX shared library libcust_tf_parsers.so 

[ 76%] Built target cust_tf_parsers 

[ 84%] Linking CXX shared library libcust_opsproto_rt2.0.so 

[ 92%] Linking CXX shared library libcust_opmaster_rt2.0.so 

[ 92%] Built target cust_optiling 

[ 92%] Built target cust_op_proto 

gmake: *** [Makefile:156: all] Error 2

日志里面提示: Invalid socVersion ascend310b4

另外报错是由于自动生成的代码有问题。

我要发帖子