bryanlinnan commented on issue #13724: libmxnet_predict.so runtime error
URL: 
https://github.com/apache/incubator-mxnet/issues/13724#issuecomment-450063149
 
 
   @vrakesh hi vrakesh, i finnaly made it run on my device(Sumsang exynos 5410 
arm), steps:
   1.first, i use android ndk r14b to make standalone toolchain
   cd ~/tool/android-ndk-r14b/build/tools
   python make_standalone_toolchain.py --arch arm --api 22 --install-dir 
/usr/local/android-toolchain --stl=libc++
   2.then i build openblas, everything is ok
   3. and then i build my libmxnet_predict.so,  many issues come out,  i solved 
them one by one
   1) need to modify the makefile in amalgamation, besides modify OpenBLAS 
path, need to change your export PATH to the android-toolchain/bin and export 
CXX=android-toolchain/bin/arm-linux-androideabi-clang++, and export 
CC=android-toolchain/bin/arm-linux-androideabi-clang, and add more include path 
in the CFLAGS:
   -I../include -I${TPARTYDIR}/dmlc-core/include 
-I${TPARTYDIR}/tvm/nnvm/include -I${TPARTYDIR}/mshadow \
   -I${TPARTYDIR}/dlpack/include -I${TPARTYDIR}/tvm/nnvm 
-I${TPARTYDIR}/ps-lite/include,
   also need to add c++11 support in the CFLAGS,
   2) after successfully build, i get some error when running the test program 
on the device, that's because some source code was not built into the library, 
so i check every missed symbol, then add it into the mxnet_predict0.cc, then 
rebuild the library.
   my mxnet_predict0.cc :
   #include "src/common/utils.cc"
   
   #include "src/ndarray/ndarray_function.cc"
   #include "src/ndarray/ndarray.cc"
   
   #include "src/imperative/imperative.cc"
   #include "src/imperative/cached_op.cc"
   
   #include "src/engine/engine.cc"
   #include "src/engine/naive_engine.cc"
   
   #include "src/profiler/profiler.cc"
   
   #include "src/executor/graph_executor.cc"
   #include "src/executor/attach_op_execs_pass.cc"
   #include "src/executor/attach_op_resource_pass.cc"
   #include "src/executor/inplace_addto_detect_pass.cc"
   
   #include "src/nnvm/legacy_json_util.cc"
   #include "src/nnvm/legacy_op_util.cc"
   
   #include "src/operator/operator.cc"
   #include "src/operator/operator_util.cc"
   #include "src/operator/slice_channel.cc"
   
   #include "src/operator/nn/activation.cc"
   #include "src/operator/nn/batch_norm.cc"
   #include "src/operator/nn/concat.cc"
   #include "src/operator/nn/convolution.cc"
   #include "src/operator/nn/deconvolution.cc"
   #include "src/operator/nn/dropout.cc"
   #include "src/operator/nn/fully_connected.cc"
   #include "src/operator/nn/pooling.cc"
   #include "src/operator/nn/softmax_activation.cc"
   #include "src/operator/nn/softmax.cc"
   
   #include "src/operator/softmax_output.cc"
   #include "src/operator/leaky_relu.cc"
   
   #include "src/operator/tensor/elemwise_binary_broadcast_op_basic.cc"
   #include "src/operator/tensor/elemwise_binary_op.cc"
   #include "src/operator/tensor/elemwise_binary_op_basic.cc"
   #include "src/operator/tensor/elemwise_binary_scalar_op_basic.cc"
   #include "src/operator/tensor/elemwise_unary_op_basic.cc"
   #include "src/operator/tensor/elemwise_unary_op_trig.cc"
   #include "src/operator/tensor/matrix_op.cc"
   #include "src/operator/tensor/init_op.cc"
   #include "src/operator/tensor/dot.cc"
   #include "src/operator/tensor/elemwise_sum.cc"
   #include "src/operator/tensor/elemwise_binary_scalar_op_logic.cc"
   #include "src/operator/tensor/control_flow_op.cc"
   
   #include "src/operator/contrib/multibox_detection.cc"
   #include "src/operator/contrib/multibox_prior.cc"
   //#include "src/operator/contrib/multibox_target.cc"
   #include "src/operator/contrib/bounding_box.cc"
   #include "src/operator/regression_output.cc"
   
   #include "src/storage/storage.cc"
   
   #include "src/resource.cc"
   #include "src/initialize.cc"
   
   #include "src/c_api/c_predict_api.cc"
   #include "src/c_api/c_api_symbolic.cc"
   #include "src/c_api/c_api_ndarray.cc"
   #include "src/c_api/c_api_error.cc"
   
   #include "../3rdparty/dmlc-core/src/io/filesys.cc"
   #include "../src/executor/infer_graph_attr_pass.cc"
   #include "../src/executor/graph_executor.cc"
   #include "../src/c_api/c_api_profile.cc"
   #include "../src/imperative/imperative_utils.cc"
   #include "../src/nnvm/graph_editor.cc"
   #include "../src/profiler/aggregate_stats.cc"
   #include "../src/engine/openmp.cc"
     
   4. then i push the libmxnet_predict.so and the test program to the deviece 
it will run and failed in the thread_local variant which are is_train_ and 
is_recording_, so i change them directly to bool false, then the test program 
finnally work, but the result is different with PC, and it is definitely has 
something with the support with ARM i guess, so could you please help verify 
and fix this issue? thanks a lot 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to