TVM build/connect RPC server in Docker image

Hello everyone:

I am trying to use RPC for cross-complication. However, my company uses docker to manage the servers. I got some troubles that the devices can not be found when the host machine is a docker image.

host machine Ifconfig

device ifconfig

.

I followed the tutorial https://docs.tvm.ai/tutorials/autotvm/tune_relay_arm.html

Start RPC tracker on host machine image

Register device image

Check on host machine

.

I also checked the network connecting, I can ping device from host…

Do you have suggestions of how to solve this problem. Thank you very much!

hi, I just solved this issue, android device wifi ip is transpond to 192.168.x.y, it can’t socket to docker containers. So you should map the inner ip:port to external access. For example,

  1. container’s ip:port is 192.168.12.6:6006, which is transpond to 172.17.xx.yy:ttt.
  2. Then, you can ping the android ip(in wifi settings menu) pass in host container.
  3. Start the tracker in container with 192.168.12.6:6006
  4. In RPC app, type the tracker 172.17.xx.yy, ttt, key.
  5. tvm.exec.query_rpc_tracker with 192.168.12.6:6006, sever list is correct.
  6. But, there is a bug I met:Local .py is not send package to android server. Because android device wifi ip 172.17.ttt.zz is transpond to 192.168.x.y.
  7. I rewrite the code tracker.py

From:

conn, addr = self._sock.accept() 
TCPEventHandler(self, conn, addr)

To:

conn, addr = self._sock.accept() 
addr_list  = list(addr)
addr_list[0] = "172.17.ttt.zz"
addr = tuple(addr_list)
TCPEventHandler(self, conn, addr)
2 Likes