Hi, I just found my RPC did not work with SSH tunnel. I ran the RPC tracker on my own Mac:
python -m tvm.exec.rpc_tracker --host=0.0.0.0 --port=9190
and created the ssh tunnel on my Jetson Nano in the same local area network:
ssh -C -N -L 9190:0.0.0.0:9190 limuyang@192.168.99.136 #192.168.99.136 is the intranet IP of my Mac
and ran the RPC server on it with the mapped port:
python3 -m tvm.exec.rpc_server --tracker=localhost:9190 --key=nano --no-fork
Then I ran
python -m tvm.exec.query_rpc_tracker --host 0.0.0.0 --port 9190
on my Mac and found my Nano was successfully registered to the tracker as follows:
Tracker address 0.0.0.0:9190
Server List
----------------------------
server-address key
----------------------------
127.0.0.1:39544 server:nano
----------------------------
Queue Status
----------------------------
key total free pending
----------------------------
nano 1 1 0
----------------------------
However, when I checked the remote device with the following python script on my Mac
from tvm import auto_scheduler
if __name__ == '__main__':
auto_scheduler.measure.check_remote('nano', '0.0.0.0', 9190, 1)
I found my Mac could not connect to my Nano. On my Mac, it said
Exception in thread Thread-1:
Traceback (most recent call last):
File "/opt/conda/envs/inference/lib/python3.9/threading.py", line 954, in _bootstrap_inner
self.run()
File "/opt/conda/envs/inference/lib/python3.9/threading.py", line 892, in run
self._target(*self._args, **self._kwargs)
File "/opt/conda/envs/inference/lib/python3.9/site-packages/tvm-0.8.dev1010+g711a603db-py3.9-linux-x86_64.egg/tvm/auto_scheduler/utils.py", line 389, in _check
request_remote(device_key, host, port, priority)
File "/opt/conda/envs/inference/lib/python3.9/site-packages/tvm-0.8.dev1010+g711a603db-py3.9-linux-x86_64.egg/tvm/auto_scheduler/utils.py", line 359, in request_remote
remote = tracker.request(device_key, priority=priority, session_timeout=timeout)
File "/opt/conda/envs/inference/lib/python3.9/site-packages/tvm-0.8.dev1010+g711a603db-py3.9-linux-x86_64.egg/tvm/rpc/client.py", line 400, in request
raise RuntimeError(
RuntimeError: Cannot request nano after 5 retry, last_error:Traceback (most recent call last):
3: TVMFuncCall
2: std::_Function_handler<void (tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*), tvm::runtime::{lambda(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)#1}>::_M_invoke(std::_Any_data const&, tvm::runtime::TVMArgs&&, tvm::runtime::TVMRetValue*&&)
1: tvm::runtime::RPCClientConnect(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, tvm::runtime::TVMArgs)
0: tvm::runtime::RPCConnect(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, tvm::runtime::TVMArgs)
File "/home/lmxyy1999/tvm/src/runtime/rpc/rpc_socket_impl.cc", line 73
TVMError:
---------------------------------------------------------------
An error occurred during the execution of TVM.
For more information, please see: https://tvm.apache.org/docs/errors.html
---------------------------------------------------------------
Check failed: (sock.Connect(addr)) is false: Connect to 127.0.0.1:9090 failed
and on my Nano, the server log was
INFO:RPCServer:bind to 0.0.0.0:9090
INFO:RPCServer:no incoming connections, regenerate key ...
INFO:RPCServer:no incoming connections, regenerate key ...
INFO:RPCServer:no incoming connections, regenerate key ...
INFO:RPCServer:no incoming connections, regenerate key ...
INFO:RPCServer:no incoming connections, regenerate key ...