apache / tvm

Open deep learning compiler stack for cpu, gpu and specialized accelerators
https://tvm.apache.org/
Apache License 2.0
11.72k stars 3.46k forks source link

[Bug] [VTA, RPC] Can’t upload custom bit file by RPC on ZCU104 #16799

Open muonkmu opened 6 months ago

muonkmu commented 6 months ago

I am testing VTA in the following environment.

Target : ZCU104 (pynq 2.7) Host : ubuntu 20.04 + TVM(v0.16,dev0) xilinx toos : vivado 2020.1

I successfully synthesized the “vta.bit” file for ZCU104, and successfully launched the RPC server on ZCU104. However, if I try to upload “vta.bit” using “vta.program_fpga (remote, bitstream=“vta.bit”)”, the following error occurs.

Which version of TVM and Pynq are guaranteed compatibility Is there a solution for this?

Traceback (most recent call last):
  File "Simple_Matrix_Multiply.py", line 24, in <module>
    vta.program_fpga(remote, bitstream="vta.bit")
  File "/home/minwook/Workspace/Study_lab/71_tvm/tvm/vta/python/vta/rpc_client.py", line 66, in program_fpga
    fprogram(os.path.basename(bitstream))
  File "/home/minwook/Workspace/Study_lab/71_tvm/tvm/python/tvm/_ffi/_ctypes/packed_func.py", line 239, in __call__
    raise_last_ffi_error()
  File "/home/minwook/Workspace/Study_lab/71_tvm/tvm/python/tvm/_ffi/base.py", line 481, in raise_last_ffi_error
    raise py_err
tvm.error.RPCError: Traceback (most recent call last):
  3: tvm::runtime::RPCWrappedFunc::operator()(tvm::runtime::TVMArgs, tvm::runtime::TVMRetValue*) const
  2: tvm::runtime::RPCClientSession::CallFunc(void*, TVMValue const*, int const*, int, std::function<void (tvm::runtime::TVMArgs)> const&)
  1: tvm::runtime::RPCEndpoint::CallFunc(void*, TVMValue const*, int const*, int, std::function<void (tvm::runtime::TVMArgs)>)
  0: tvm::runtime::RPCEndpoint::HandleUntilReturnEvent(bool, std::function<void (tvm::runtime::TVMArgs)>)
  File "/home/minwook/Workspace/Study_lab/71_tvm/tvm/src/runtime/rpc/rpc_endpoint.cc", line 427
RPCError: Error caught from RPC call:
AdrFebles commented 1 week ago

Hi @muonkmu, I'm facing the same error, but with a newer pynq version:

Target : ZCU104 ( Pynq: 3.0.1) TVM v0.18.dev0 xilinx toos : vivado 2020.1

I haven't found information about which versions of TVM and Pynq are compatibility. What I'm going to do now is flash the SD with the pynq 2.5 image for the ZCU104, since in the tutorial they use that version for the PYNQ-Z1 card: https://tvm.apache.org/docs/topic/vta/install.html#xilinx-pynq-fpga-setup.

Anyway, did you find a solution for this?