Auto tuning ERROR: relocation R_X86_64_32S against `.rodata.cst16\' can not be used when making a shared object


#1

I get this error after building tvm and running the tutorials/autotvm/tune_nnvm_cuda.py and the tutorials/autotvm/tune_simple_template.py. The whole error report is:

MeasureResult(costs=(RuntimeError(‘Except caught from RPC call: TVMCall CFunc Error:\nTraceback (most recent call last):\n File “tvm/_ffi/_cython/./function.pxi”, line 38, in tvm._ffi._cy2.core.tvm_callback\n File “/home/tusimple/.local/lib/python2.7/site-packages/tvm-0.5.dev0-py2.7-linux-x86_64.egg/tvm/rpc/server.py”, line 50, in load_module\n m = _load_module(path)\n File “/home/tusimple/.local/lib/python2.7/site-packages/tvm-0.5.dev0-py2.7-linux-x86_64.egg/tvm/module.py”, line 222, in load\n _cc.create_shared(path + “.so”, files)\n File “/home/tusimple/.local/lib/python2.7/site-packages/tvm-0.5.dev0-py2.7-linux-x86_64.egg/tvm/contrib/cc.py”, line 33, in create_shared\n _linux_shared(output, objects, options, cc)\n File “/home/tusimple/.local/lib/python2.7/site-packages/tvm-0.5.dev0-py2.7-linux-x86_64.egg/tvm/contrib/cc.py”, line 58, in _linux_shared\n raise RuntimeError(msg)\nRuntimeError: Compilation error:\n/usr/bin/ld: /tmp/tmpK6WhL1/lib.o: relocation R_X86_64_32S against `.rodata.cst16’ can not be used when making a shared object; ',),), error_no=4, all_cost=0.22864222526550293, timestamp=1541077761.751686)

Is it a bug report? By pdb, I find this error comes from

tuner_obj.tune(n_trial=min(n_trial, len(tsk.config_space)),
early_stopping=early_stopping,
measure_option=measure_option,
callbacks=[
autotvm.callback.progress_bar(n_trial, prefix=prefix),
autotvm.callback.log_to_file(tmp_log_file)])

What’s wrong? Maybe some shared libraries are not compiled right.


#2

I have asked quit the same question before , I fixed this problem by reinstall the llvm step by step.
You can pull the official docker directly, the problem should be solved.