TVM C++ deploy core dumped

I’m going through the tutorial Deploy TVM Module using C++ API — tvm 0.12.dev0 documentation, trying to run the C++ deploy example. The demo is here <tvm_path>/apps/howto_deploy.

I run the shell script run_example.sh, unluckily, I got an error: Check failed: (f != nullptr)

Detial:

An error occurred during the execution of TVM.
For more information, please see: https://tvm.apache.org/docs/errors.html
---------------------------------------------------------------
  Check failed: (f != nullptr) is false:
Stack trace:
  [bt] (0) lib/cpp_deploy_pack(+0x141c7) [0x7f45054141c7]
  [bt] (1) lib/cpp_deploy_pack(+0xf94e) [0x7f450540f94e]
  [bt] (2) lib/cpp_deploy_pack(+0xc40c) [0x7f450540c40c]
  [bt] (3) lib/cpp_deploy_pack(+0xcb90) [0x7f450540cb90]
  [bt] (4) lib/cpp_deploy_pack(+0x6d79) [0x7f4505406d79]
  [bt] (5) /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f4504241c87]
  [bt] (6) lib/cpp_deploy_pack(+0xbb1a) [0x7f450540bb1a]


./run_example.sh: line 26: 26761 Aborted                 (core dumped) lib/cpp_deploy_pack
Run the cpp deployment with all in normal library...
[10:20:49] cpp_deploy.cc:77: Verify dynamic loading from test_addone_dll.so
[10:20:49] cpp_deploy.cc:69: Finish verification...
[10:20:49] cpp_deploy.cc:81: Verify load function from system lib
terminate called after throwing an instance of 'tvm::runtime::InternalError'
  what():  [10:20:49] cpp_deploy.cc:34:

---------------------------------------------------------------
An error occurred during the execution of TVM.
For more information, please see: https://tvm.apache.org/docs/errors.html
---------------------------------------------------------------
  Check failed: (f != nullptr) is false:
Stack trace:
  0: Verify(tvm::runtime::Module, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)
  1: DeploySingleOp()
  2: main
  3: __libc_start_main
  4: _start
  5: 0xffffffffffffffff


./run_example.sh: line 29: 26762 Aborted                 (core dumped) lib/cpp_deploy_normal

And I try this demo with TVM version 0.10.0 and 0.11.0,both failed.

The line numbers in the error message show some evidence :slight_smile:

In your particular case, it looks like “runtime.SystemLib” or “addonesys” don’t exist. Would you like to double check?

According to your advice,
I can find “runtime.SystemLib” is registed in src/runtime/system_library.cc:

TVM_REGISTER_GLOBAL("runtime.SystemLib").set_body_typed([]() {
  static auto mod = CreateModuleFromLibrary(SystemLibrary::Global());
  return mod;
});

And I also find “addonesys” in howto_deploy/lib/test_addone_sys.o:

nm test_addone_sys.o | c++filt -t

image

By the way, I switch my work to another Linux machine, the problem is still not solved.

Things become more strange. :joy: