I tried some tutorials on the latest commit of TVM (cd0d52daa6942bdafa9363ff6cfa3d25fcd5b8d6) but I found the build failure so, I fixed this issue, which might be the one discussed in (VTA build on PYNQ fails at VTA.cmake:97), by the following workaround and then the build succeeded.
diff --git a/cmake/modules/VTA.cmake b/cmake/modules/VTA.cmake
index 4af39e088..b4ef80d4c 100644
--- a/cmake/modules/VTA.cmake
+++ b/cmake/modules/VTA.cmake
@@ -102,6 +103,9 @@ elseif(PYTHON)
# Target lib: vta
add_library(vta SHARED ${FPGA_RUNTIME_SRCS})
target_include_directories(vta PUBLIC vta/include)
+ target_include_directories(vta PUBLIC ${VTA_HW_PATH}/include)
foreach(__def ${VTA_DEFINITIONS})
string(SUBSTRING ${__def} 3 -1 __strip_def)
target_compile_definitions(vta PUBLIC ${__strip_def})
However I failed to run it correctly on the physical devices both pynq and ultra96, because libvta.so
doesn’t seem to contain the symbol VTARuntimeShutdown
. I pasted the error message below.
Is there any one who know about this??
xilinx@pynq:~/tvm$ sudo ./apps/vta_rpc/start_rpc_server.sh
INFO:RPCServer:bind to 0.0.0.0:9091
INFO:RPCServer:connection from ('172.16.19.12', 60962)
INFO:root:Skip reconfig_runtime due to same config.
INFO:root:Program FPGA with 1x16_i8w8a32_15_15_18_17.bit
INFO:root:Loading VTA library: /home/xilinx/tvm/vta/python/vta/../../../build/libvta.so
INFO:RPCServer:load_module /tmp/tmpxhytgs15/gemm.o
INFO:root:Loading VTA library: /home/xilinx/tvm/vta/python/vta/../../../build/libvta.so
...
Traceback (most recent call last):
File "/usr/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/home/xilinx/tvm/python/tvm/rpc/server.py", line 84, in _serve_loop
base._ServerLoop(sockfd)
File "/home/xilinx/tvm/python/tvm/_ffi/_ctypes/packed_func.py", line 216, in __call__
raise get_last_ffi_error()
AttributeError: Traceback (most recent call last):
[bt] (5) /home/xilinx/tvm/build/libtvm_runtime.so(TVMFuncCall+0x70) [0x7fad00e4d8]
[bt] (4) /home/xilinx/tvm/build/libtvm_runtime.so(+0xadc90) [0x7fad08bc90]
[bt] (3) /home/xilinx/tvm/build/libtvm_runtime.so(+0xacac8) [0x7fad08aac8]
[bt] (2) /home/xilinx/tvm/build/libtvm_runtime.so(tvm::runtime::RPCServerLoop(int)+0xac) [0x7fad089dfc]
[bt] (1) /home/xilinx/tvm/build/libtvm_runtime.so(tvm::runtime::RPCSession::ServerLoop()+0x1cc) [0x7fad07fd8c]
[bt] (0) /home/xilinx/tvm/build/libtvm_runtime.so(+0x2c750) [0x7fad00a750]
File "/home/xilinx/tvm/python/tvm/_ffi/_ctypes/packed_func.py", line 78, in cfun
rv = local_pyfunc(*pyargs)
File "/home/xilinx/tvm/vta/python/vta/exec/rpc_server.py", line 84, in server_shutdown
runtime_dll[0].VTARuntimeShutdown()
File "/usr/lib/python3.6/ctypes/__init__.py", line 361, in __getattr__
func = self.__getitem__(name)
File "/usr/lib/python3.6/ctypes/__init__.py", line 366, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /home/xilinx/tvm/vta/python/vta/../../../build/libvta.so: undefined symbol: VTARuntimeShutdown