Error when run pynq-z1 test


#1

Hello, there is a error when I run the tests test_benchmark_topi_conv2d.py on FPGA pynq-Z1.
My setting is completely follow the VTA FPGA pynq-z1 setup.
However, when I run the test test_benchmark_topi_conv2d.py from my host, I get the following errors:

key=resnet-cfg[1]
Conv2DWorkload(batch=1, height=56, width=56, in_filter=64, out_filter=64, hkernel=3, wkernel=3, hpad=1, wpad=1, hstride=1, wstride=1)
----- CONV2D CPU End-to-End Test-------

Traceback (most recent call last):
File “test_benchmark_topi_conv2d.py”, line 268, in
test_cpu_conv2d()
File “test_benchmark_topi_conv2d.py”, line 134, in test_cpu_conv2d
vta.testing.run(_run)
File “/home/fdsoc/Documents/tvm/vta/python/vta/testing/util.py”, line 45, in run
run_func(env, remote)
File “test_benchmark_topi_conv2d.py”, line 129, in _run
run_cpu_conv2d(env, remote, key, batch_size, wl)
File “test_benchmark_topi_conv2d.py”, line 103, in run_cpu_conv2d
conv_normal(False)
File “test_benchmark_topi_conv2d.py”, line 99, in conv_normal
cost = verify(s, True)
File “test_benchmark_topi_conv2d.py”, line 72, in verify
f = remote.load_module(“conv2d.o”)
File “/home/fdsoc/Documents/tvm/python/tvm/rpc/client.py”, line 119, in load_module
return base._LoadRemoteModule(self._sess, path)
File “/home/fdsoc/Documents/tvm/python/tvm/_ffi/_ctypes/function.py”, line 185, in call
ctypes.byref(ret_val), ctypes.byref(ret_tcode)))
File “/home/fdsoc/Documents/tvm/python/tvm/_ffi/base.py”, line 68, in check_call
raise TVMError(py_str(_LIB.TVMGetLastError()))
tvm._ffi.base.TVMError: Except caught from RPC call: TVMCall CFunc Error:
Traceback (most recent call last):
File “/home/xilinx/tvm/python/tvm/_ffi/_ctypes/function.py”, line 55, in cfun
rv = local_pyfunc(*pyargs)
File “/home/xilinx/tvm/vta/python/vta/exec/rpc_server.py”, line 44, in load_module
return _load_module(file_name)
File “/home/xilinx/tvm/python/tvm/_ffi/_ctypes/function.py”, line 185, in call
ctypes.byref(ret_val), ctypes.byref(ret_tcode)))
File “/home/xilinx/tvm/python/tvm/_ffi/base.py”, line 68, in check_call
raise TVMError(py_str(_LIB.TVMGetLastError()))
tvm._ffi.base.TVMError: TVMCall CFunc Error:
Traceback (most recent call last):
File “/home/xilinx/tvm/python/tvm/_ffi/_ctypes/function.py”, line 55, in cfun
rv = local_pyfunc(*pyargs)
File “/home/xilinx/tvm/python/tvm/rpc/server.py”, line 50, in load_module
m = _load_module(path)
File “/home/xilinx/tvm/python/tvm/module.py”, line 216, in load
_cc.create_shared(path + “.so”, path)
File “/home/xilinx/tvm/python/tvm/contrib/cc.py”, line 33, in create_shared
_linux_shared(output, objects, options, cc)
File “/home/xilinx/tvm/python/tvm/contrib/cc.py”, line 58, in _linux_shared
raise RuntimeError(msg)
RuntimeError: Compilation error:
/usr/bin/arm-linux-gnueabihf-ld: /tmp/tmpz1_us39g/conv2d.o: relocation R_ARM_MOVW_ABS_NC against __TVMAPISetLastError' can not be used when making a shared object; recompile with -fPIC /usr/bin/arm-linux-gnueabihf-ld: /tmp/tmpz1_us39g/conv2d.o(.text+0x79c): unresolvable R_ARM_CALL relocation against symbol__aeabi_idiv@@GCC_3.5
/usr/bin/arm-linux-gnueabihf-ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status

I can not figure it out! I need help!


#2

what version of the pynq image are you using? v2.3? and what version of LLVM are you using to cross-compiler binaries?


#3

Thanks. I have solved the problem. The problem is that I use the LLVM 7.0.0 version, but TVM now seems do not support 7.0.0 version. So I replace it with the LLVM 4.0.0 version. Then, the TVM VTA in pynq-Z1 work well.


#4

Glad to hear that your issue was resolved.


#5

On the other hand, we might need to notify the community which versions of LLVM are we currently supporting, otherwise, many users might spend much useless time in figuring out that. Or, we might need to update the llvm support in the runtime, in order to be compatible with the latest version.


#6

good point regarding the version number - we’ll update the docs accordingly


#7

We should always keep up with the mainline, https://github.com/dmlc/tvm/issues/2005 is still an open issue that we need help with