[solved] Querying rpc tracker returns empty list (Android device)


#1

Hello,

I am following the instructions from android_rpc,
after launching the tracker on my machine

$ python -m tvm.exec.rpc_tracker --port 9090
INFO:RPCTracker:bind to 0.0.0.0:9090

I run the app and enter the address (tried 0.0.0.0 and real ip), tracker port (here 9090), and key (I use android as recommended), then I query the tracker but get an empty list:

Tracker address localhost:9090

Server List
----------------------------
server-address	key
----------------------------
----------------------------

Queue Status
---------------------------
key   total  free  pending
---------------------------
---------------------------

I am running ubuntu 16.04 in a company (internet proxy, etc.).
I can see that the ports 9090 are listening on both machine, I guess I have missed something but that should not be a tvm problem, however, I still need your help.
Thank you.


#2

Is the tracker accessible from the phone (e.g., are they on the same NAT, etc.).


Android_rpc_test.py does not return anything
#3

What port is your RPC server (on Android) listening on? Run the RPC server app and do “netstat -a” from adb shell.
Assume that your tracker (on Linux) listens on 9090, and the RPC server (on a phone) listens on 5001. The server will attempt to connect to the tracker via 9090, so connections to 9090 on the phone need to be forwarded to port 9090 on Linux, and connections to port 5001 on Linux will need to be forwarded to port 5001 on the phone. To make it work, run

adb forward tcp:5001 tcp:5001
adb reverse tcp:9090 tcp:9090

Then start the tracker, then the server app. Now, the query should show that the server is registered with the tracker.


[AutoTVM] Cannot get remote devices from the tracker
#4

Thank you that was the problem.
Now trying to run nnvm/tutorials/deploy_model_on_mali_gpu.py in which I modified the fields related to backend and device connection, I am getting:

TVMError: Check failed: sock.Connect(addr): Connect to 192.168.123.107:9090

Context:
I am running an rpc server on my linux machine binded to 9090.
I am running the android rcp server port 5001 forwarded (fron netstat -a) as previously mentioned, 9090 reverse forwarded as well, I set the key in the app to “android”.
In the script I have set the host to the ip address of the android phone (in settings>status>ip address, only available when wifi is activated, 192.168.123.107 here), and the port to 9090.
I have replaced rpc.connect(host, port) by rpc.connect(host, port, key) where key = "android".
And that’s it.

I can move my question to a new discussion if that makes more sense.
Thank you in advance for your help.


#5

I have just checked and in fact no, there are not on the same NAT. They are connected with USB so forwarding port with local address nay be the solution. Does 0.0.0.0 correspond to localhost or is it better to replace it with ifconfig result?


#6

On some systems 0.0.0.0 is aliased to localhost. You should not set the ip address on the device to 0.0.0.0, as telling it that it itself is the tracker.

You can try port forwarding, but I have not tested that approach.


#7

Thanks for the reply.
Port forwarding seems to work. Strange thing is that it works with localhost address in the phone but not the real address.
I am speaking in term of results of the query_rpc_tracker script, I can see the device in the list with localhost address on the phone but empty list with true address.
I did the port forwarding as mentionned by kparzysz previously.


#8

0.0.0.0 means “any network interface” and when it’s used in a listening socket (i.e. in a server), it will listen at a given port on all TCPv4 interfaces.


#9

After some reconfigurations/compilations and better understanding, port forwarding is working now.
Thanks