[Solved] Undefined symbol: VTAMemFree

I’m going through tutorials in TVM page and encountered this issue. I’m using

  • Ubuntu 16.04 64bit
  • x86_64-linux-gnu
  • LLVM 6.0.1

If you look at https://docs.tvm.ai/vta/install.html#pynq-side-rpc-server-build-deployment there’s a way to “test your Pynq-based Hardware Setup” I’ve been following the guild till I ran

“python /vta/tests/python/integration/test_benchmark_topi_conv2d.py”

which results in


python3 vta/tests/python/integration/test_benchmark_topi_conv2d.py

/home/kjk2020/tvm/nnvm/python/nnvm/init.py:33: FutureWarning: NNVM is deprecated and will be removed in a future version. Use Relay instead. FutureWarning) 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) Traceback (most recent call last):

File “vta/tests/python/integration/test_benchmark_topi_conv2d.py”, line 242, in test_conv2d(device=“arm_cpu”)

File “vta/tests/python/integration/test_benchmark_topi_conv2d.py”, line 239, in test_conv2d vta.testing.run(_run)

File “/home/kjk2020/tvm/vta/python/vta/testing/util.py”, line 75, in run run_func(env, remote)

File “vta/tests/python/integration/test_benchmark_topi_conv2d.py”, line 238, in _run run_conv2d(env, remote, wl, target)

File “vta/tests/python/integration/test_benchmark_topi_conv2d.py”, line 166, in run_conv2d f = remote.load_module(“conv2d.o”)

File “/home/kjk2020/tvm/python/tvm/rpc/client.py”, line 148, in load_module return base._LoadRemoteModule(self._sess, path)

File “/home/kjk2020/tvm/python/tvm/_ffi/_ctypes/function.py”, line 207, in call raise get_last_ffi_error()

tvm._ffi.base.TVMError: Traceback (most recent call last): [bt] (8) /home/xilinx/tvm/build/libtvm_runtime.so(tvm::runtime::RPCSession::ServerLoop()+0xaf) [0xb5a0ada8] [bt] (7) /home/xilinx/tvm/build/libtvm_runtime.so(tvm::runtime::RPCSession::HandleUntilReturnEvent(tvm::runtime::TVMRetValue*, bool, tvm::runtime::PackedFunc const*)+0xfb) [0xb5a0abbc] [bt] (6) /home/xilinx/tvm/build/libtvm_runtime.so(tvm::runtime::RPCSession::EventHandler::HandleNextEvent(tvm::runtime::TVMRetValue*, bool, tvm::runtime::PackedFunc const*)+0x203) [0xb5a0ee64] [bt] (5) /home/xilinx/tvm/build/libtvm_runtime.so(tvm::runtime::RPCSession::EventHandler::HandleRecvPackedSeqArg()+0x23f) [0xb5a0e974] [bt] (4) /home/xilinx/tvm/build/libtvm_runtime.so(tvm::runtime::RPCSession::EventHandler::SwitchToState(tvm::runtime::RPCSession::EventHandler::State)+0x1eb) [0xb5a0dcd8] [bt] (3) /home/xilinx/tvm/build/libtvm_runtime.so(tvm::runtime::RPCSession::EventHandler::HandlePackedCall()+0x20f) [0xb5a0a2cc] [bt] (2) /home/xilinx/tvm/build/libtvm_runtime.so(void tvm::runtime::RPCSession::EventHandler::CallHandler<void ()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue)>(void ()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue))+0x47) [0xb5a0d84c] [bt] (1) /home/xilinx/tvm/build/libtvm_runtime.so(tvm::runtime::RPCModuleLoad(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*)+0x6d) [0xb5a09cba] [bt] (0) /home/xilinx/tvm/build/libtvm_runtime.so(+0x210c0) [0xb59ba0c0] File “/home/xilinx/tvm/python/tvm/_ffi/_ctypes/function.py”, line 72, in cfun rv = local_pyfunc(*pyargs) File “/home/xilinx/tvm/vta/python/vta/exec/rpc_server.py”, line 59, in load_module load_vta_dll() File “/home/xilinx/tvm/vta/python/vta/exec/rpc_server.py”, line 53, in load_vta_dll runtime_dll.append(ctypes.CDLL(dll_path, ctypes.RTLD_GLOBAL)) File “/usr/lib/python3.6/ctypes/init.py”, line 348, in init self._handle = _dlopen(self._name, mode) TVMError: Except caught from RPC call: OSError: /home/xilinx/tvm/vta/python/vta/…/…/…/build/libvta.so: undefined symbol: VTAMemFree

I found a solved question,

But the problem was they installed llvm for different OS, which I did for Ubuntu 16.04.

I’d really be thankful if anyone solved the same problem I have here gives me any advice.

++ In addition, by checking the VTAMemFree in libvta, w nm libvta.so, I found out that it is imported(compiled) in so file.

++ I’m using PYNQ-Z1 board for my target FPGA

++ I matched gcc version of ZYNQ PS(to gcc-5) that is same as my Ubuntu version which is gcc-5.5, built tvm for my PYNQ again and still get the same problem.

Proble solved,

I did everything could, while not re-building everything, but failed.

So I followed the steps one by one again, and solved the problem.

There are 3 differences from the previous one,

  1. I set my computer’s configuration setting
  • USE_VTA_FSIM OFF
  • USE_VTA_TSIM OFF
  • USE_VTA_FPGA ON on my previous build. (which is not the default)
  1. This time, I did not mount TVM in PYNQ to my computer, because I did not have permission to xilinx directly(without sudo).

  2. I did not use the commands “echo” to edit those three configuration settings above. I used vim and editted the ones that’s inside it already. If you follow the instruction, you get extra three lines but I just editted the ones that already exist.