Auto-TVM failed on Android Device, with error msg of "Do not know how to handle return type code 113"


Actually, I’ve resolved this problem, just want to share as I got a hard time in search solutions here and google, but no result found. and one additional question regarding whether the solution is the best.

For my case, I’m using Android Studio, however, TVM RPC don’t print enough log info in run tab after Android Studio connected to TVM process on my device.
To see more log info, you need to open:
“View” => “Tool Windows” => “logcat”, choose “ml.dmlc.tvm.tvmrpc:RPCProcess”'s log and filter by “show only selected application”, you will be able to see more log info:

For my case, I see something like below:
[09:04:23] …/android_rpc/app/src/main/jni/…/…/…/…/…/…/3rdparty/dmlc-core/include/dmlc/logging.h:392: [09:04:23] …/android_rpc/app/src/main/jni/…/…/…/…/…/…/include/…/src/runtime/ Check failed: lib_handle_ != nullptr Failed to load dynamic shared library /data/user/0/ml.dmlc.tvm.tvmrpc/cache/tvm4j_rpc_[someid]/tmp_func_[someid].so dlopen failed: library;; not found.

Then solution is clear, in, use
APP_STL := c++_shared instead of APP_STL := c++_static, that resolved my problem.

My question is why TVM-RPC use c++_static when auto-tuning it require dynamic library? or actually I missed some more essential problem unresolved?


tvm4j does not print proper error message, which we should fix.

would you mind open a pull request for the c++_static problem?