This folder contains a simple recipe to make RPC server in c++.
- Build tvm runtime
- Make the rpc executable Makefile.
make CXX=/path/to/cross compiler g++/ TVM_RUNTIME_DIR=/path/to/tvm runtime library directory/ OS=Linux
if you want to compile it for embedded Linux, you should addOS=Linux
. if the target os is Android, you doesn't need to pass OS argument. You could cross compile the TVM runtime like this:
cd tvm
mkdir arm_runtime
cp cmake/config.cmake arm_runtime
cd arm_runtime
cmake .. -DCMAKE_CXX_COMPILER="/path/to/cross compiler g++/"
make runtime
- Use
./tvm_rpc server
to start the RPC server
- The tvm runtime dll is linked along with this executable and when the RPC server starts it will load the tvm runtime library.
Command line usage
server - Start the server
--host - The hostname of the server, Default=0.0.0.0
--port - The port of the RPC, Default=9090
--port-end - The end search port of the RPC, Default=9199
--tracker - The RPC tracker address in host:port format e.g. 10.1.1.2:9190 Default=""
--key - The key used to identify the device type in tracker. Default=""
--custom-addr - Custom IP Address to Report to RPC Tracker. Default=""
--silent - Whether to run in silent mode. Default=False
Example
./tvm_rpc server --host=0.0.0.0 --port=9000 --port-end=9090 --tracker=127.0.0.1:9190 --key=rasp
Currently support is only there for Linux / Android environment and proxy mode doesn't be supported currently.