RuntimeError: Compilation error: Relocations in generic ELF (EM: 183)


#1

QUESTION:
when I was deploying my model,and try to load module, this error happens:

upload the library to remote device and load it

remote.upload(lib_fname)
rlib = remote.load_module(‘net.tar’)

ERROR:

RuntimeError Traceback (most recent call last)
in
1 # upload the library to remote device and load it
2 remote.upload(lib_fname)
----> 3 rlib = remote.load_module(‘net.tar’)

/home/liqiang/tvm_proj/tvm/python/tvm/rpc/client.py in load_module(self, path)
205
206 def load_module(self, path):
–> 207 return _load_module(self._temp.relpath(path))
208
209

/home/liqiang/tvm_proj/tvm/python/tvm/module.py in load(path, fmt)
255 _tar.untar(path, tar_temp.temp_dir)
256 files = [tar_temp.relpath(x) for x in tar_temp.listdir()]
–> 257 _cc.create_shared(path + “.so”, files)
258 path += “.so”
259 # Redirect to the load API

/home/liqiang/tvm_proj/tvm/python/tvm/contrib/cc.py in create_shared(output, objects, options, cc)
47 “”"
48 if sys.platform == “darwin” or sys.platform.startswith(“linux”):
—> 49 _linux_shared(output, objects, options, cc)
50 elif sys.platform == “win32”:
51 _windows_shared(output, objects, options)

/home/liqiang/tvm_proj/tvm/python/tvm/contrib/cc.py in _linux_shared(output, objects, options, cc)
104 msg = “Compilation error:\n”
105 msg += py_str(out)
–> 106 raise RuntimeError(msg)
107
108

RuntimeError: Compilation error:
/usr/bin/ld: /tmp/tmpr062b0nu/lib.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/tmpr062b0nu/lib.o: Relocations in generic ELF (EM: 183)
/tmp/tmpr062b0nu/lib.o: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status

HOW can I slove this problem? Please help if you know


#2

It’s a linker error, it seems that you are linking objects in different formats.
It can happens when you are during cross compilation if you compile something for an architecture and try linking it with some code for other architecture.
Have you managed running some modules remotely before?