tvm android_rpc_test.py执行报错解决

执行 python3 tests/android_rpc_test.py

报错:

Run CPU test ...
Traceback (most recent call last):
  File "tests/android_rpc_test.py", line 129, in <module>
    test_rpc_module()
  File "tests/android_rpc_test.py", line 73, in test_rpc_module
    f2 = remote.load_module("cpu_lib.tar")
  File "/root/.local/lib/python3.8/site-packages/tvm-0.13.0-py3.8-linux-x86_64.egg/tvm/rpc/client.py", line 161, in load_module
    return _ffi_api.LoadRemoteModule(self._sess, path)
  File "/root/.local/lib/python3.8/site-packages/tvm-0.13.0-py3.8-linux-x86_64.egg/tvm/_ffi/_ctypes/packed_func.py", line 238, in __call__
    raise get_last_ffi_error()
tvm.error.InternalError: Traceback (most recent call last):
  4: TVMFuncCall
  3: _ZN3tvm7runtime13PackedFuncObj9ExtractorINS0_16PackedFuncSubObjIZNS0_15TypedPackedFuncIFNS0_6ModuleES5_NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEE17AssignTypedLambdaINS0_UlS5_SB_E3_EEEvT_SB_EUlRKNS0_7TVMArgsEPNS0_11TVMRetValueEE_EEE4CallEPKS1_SH_SL_
  2: tvm::runtime::RPCWrappedFunc::operator()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) const
  1: tvm::runtime::RPCClientSession::CallFunc(void*, TVMValue const*, int const*, int, std::function<void (tvm::runtime::TVMArgs)> const&)
  0: tvm::runtime::RPCEndpoint::CallFunc(void*, TVMValue const*, int const*, int, std::function<void (tvm::runtime::TVMArgs)>)
  File "/home/tt/project/docker_tvm2/tvm/src/runtime/rpc/rpc_endpoint.cc", line 808
InternalError: Check failed: (code == RPCCode::kReturn) is false: code=kShutdown
 

解决方法:

把cpu_lib.tar改为cpu_lib.so;并且在export_library添加ndk.create_shared,如下:

path_dso_cpu = temp.relpath("cpu_lib.so")

f.export_library(path_dso_cpu, ndk.create_shared)

原因:

没有添加ndk.create_shared,使用默认的编译器,在android上不能跑

相关推荐

  1. tvm android_rpc_test.py执行解决

    2024-03-16 00:24:04       20 阅读
  2. easyexcel解决

    2024-03-16 00:24:04       36 阅读
  3. Mybatis解决

    2024-03-16 00:24:04       10 阅读
  4. 2024年Ubuntu18.04执行do-release-upgrade解决方案

    2024-03-16 00:24:04       34 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-03-16 00:24:04       19 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-03-16 00:24:04       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-03-16 00:24:04       19 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-03-16 00:24:04       20 阅读

热门阅读

  1. 智能网联汽车网络安全威胁具体

    2024-03-16 00:24:04       19 阅读
  2. Nodejs引入模块运行时报错

    2024-03-16 00:24:04       21 阅读
  3. 安卓自定义ScrollView

    2024-03-16 00:24:04       19 阅读
  4. 技术问题记录

    2024-03-16 00:24:04       22 阅读
  5. Spring Cloud面试系列-01

    2024-03-16 00:24:04       24 阅读
  6. 【gpt实践】实用咒语分享

    2024-03-16 00:24:04       25 阅读
  7. uniapp内实现链接跳转到浏览器网页上

    2024-03-16 00:24:04       22 阅读
  8. jdk8与jdk17的区别。springboot2.x与springboot3.x的区别

    2024-03-16 00:24:04       23 阅读
  9. 4.Python从入门到精通—Python 基础语法详细讲解-下

    2024-03-16 00:24:04       20 阅读
  10. Reactor,Proactor,Actor网络模型

    2024-03-16 00:24:04       17 阅读