[AutoTVM]Cannot get remote devices from the tracker

I’m trying to run the auto-tuning example from here.I don’t know why this error happen.

Extract tasks...
[Task  1/12]  Current/Best:    0.00/   0.00 GFLOPS | Progress: (0/800) | 0.00 s
Process Process-1:
Traceback (most recent call last):
  File "/home/liu/anaconda3/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
    self.run()
  File "/home/liu/anaconda3/lib/python3.7/multiprocessing/process.py", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "/home/liu/tvm/python/tvm/rpc/tracker.py", line 362, in _tracker_server
    handler.run()
  File "/home/liu/tvm/python/tvm/rpc/tracker.py", line 357, in run
    self._ioloop.start()
  File "/home/liu/anaconda3/lib/python3.7/site-packages/tornado/platform/asyncio.py", line 153, in start
    self.asyncio_loop.run_forever()
  File "/home/liu/anaconda3/lib/python3.7/asyncio/base_events.py", line 525, in run_forever
    raise RuntimeError('This event loop is already running')
RuntimeError: This event loop is already running
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-5-585d2a656ce1> in <module>
     36 # Uncomment the following line to run it by yourself.
     37 
---> 38 tune_and_evaluate(tuning_option)

<ipython-input-5-585d2a656ce1> in tune_and_evaluate(tuning_opt)
      8 
      9     # run tuning tasks
---> 10     tune_kernels(tasks, **tuning_opt)
     11     tune_graph(mod["main"], data_shape, log_file, graph_opt_sch_file)
     12 

<ipython-input-4-74abc8a67d9f> in tune_kernels(tasks, measure_option, tuner, early_stopping, log_filename)
     40             callbacks=[
     41                 autotvm.callback.progress_bar(n_trial, prefix=prefix),
---> 42                 autotvm.callback.log_to_file(log_filename),
     43             ],
     44         )

~/tvm/python/tvm/autotvm/tuner/tuner.py in tune(self, n_trial, measure_option, early_stopping, callbacks, si_prefix)
    110             One of tvm.autotvm.utils.SI_PREFIXES. The SI prefix to use when reporting FLOPS.
    111         """
--> 112         measure_batch = create_measure_batch(self.task, measure_option)
    113         n_parallel = getattr(measure_batch, "n_parallel", 1)
    114         early_stopping = early_stopping or 1e9

~/tvm/python/tvm/autotvm/measure/measure.py in create_measure_batch(task, option)
    255     runner = option["runner"]
    256 
--> 257     attach_objects = runner.set_task(task)
    258 
    259     # feed device related information from runner to builder

~/tvm/python/tvm/autotvm/measure/measure_methods.py in set_task(self, task)
    422         self.port = tracker.port
    423 
--> 424         super(LocalRunner, self).set_task(task)
    425         return server, tracker
    426 

~/tvm/python/tvm/autotvm/measure/measure_methods.py in set_task(self, task)
    250         else:
    251             raise RuntimeError(
--> 252                 "Cannot get remote devices from the tracker. "
    253                 "Please check the status of tracker by "
    254                 "'python -m tvm.exec.query_rpc_tracker --port [THE PORT YOU USE]' "

RuntimeError: Cannot get remote devices from the tracker. Please check the status of tracker by 'python -m tvm.exec.query_rpc_tracker --port [THE PORT YOU USE]' and make sure you have free devices on the queue status.

I’d appreciate any help on how to avoid this error so the tuning can finish.

i met the same error when i run the tutorial on NVIDIA gpu

I have solved this problem. You should install nest_asyncio and add the following code at the head of the project.

import nest_asyncio

nest_asyncio.apply()