Hi,
I succesfully went through the tutorials GitHub - Xilinx/Alveo-PYNQ: Introductory examples for using PYNQ with Alveo with the older shell xilinx_u50_xdma_201920_1 installed on Alveo U50 and overlays downloaded from the provided link. However, after I upgraded the card to the most recent shell xilinx_u50_gen3x16_xdma_201920_3 and created .xclbin files with the provided makefiles, the .call()
function does not return for any kernel after the first run. The first run finishes and the outputs are as expected. Since the second run does not finish I have to interrupt the kernel, which returns
---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
/tmp/ipykernel_4283/3157139858.py in <module>
----> 1 vadd.call(in1_vadd, in2_vadd, out, size)
2
~/anaconda3/lib/python3.9/site-packages/pynq/overlay.py in _call(self, *args, **kwargs)
756
757 def _call(self, *args, **kwargs):
--> 758 self.start(*args, **kwargs).wait()
759
760 def _start_sw(self, *args, ap_ctrl=1, waitfor=None, **kwargs):
~/anaconda3/lib/python3.9/site-packages/pynq/overlay.py in wait(self)
633
634 def wait(self):
--> 635 while self.target.mmio.read(0) & 0x4 != 0x4:
636 pass
637
~/anaconda3/lib/python3.9/site-packages/pynq/mmio.py in read(self, offset, length, word_order)
146
147 # Read data out
--> 148 lsb = int(self.array[idx])
149 if length == 8:
150 if word_order == 'little':
~/anaconda3/lib/python3.9/site-packages/pynq/_3rdparty/tinynumpy.py in __getitem__(self, key)
666 if not shape:
667 # Return scalar
--> 668 return self._data[offset]
669 else:
670 # Return view
~/anaconda3/lib/python3.9/site-packages/pynq/_3rdparty/tinynumpy.py in __getitem__(self, key)
452 if self._hook:
453 return self._struct.unpack(
--> 454 self._hook.read(offset, self._itemsize))[0];
455 else:
456 return self._struct.unpack(self._bytearray[offset:offset+self._itemsize])[0]
~/anaconda3/lib/python3.9/site-packages/pynq/mmio.py in read(self, offset, length)
45
46 def read(self, offset, length):
---> 47 return self.device.read_registers(self.baseaddress + offset, length)
48
49 def write(self, offset, data):
~/anaconda3/lib/python3.9/site-packages/pynq/pl_server/xrt_device.py in read_registers(self, address, length)
484 def read_registers(self, address, length):
485 data = (ctypes.c_char * length)()
--> 486 ret = xrt.xclRead(self.handle,
487 xrt.xclAddressSpace.XCL_ADDR_KERNEL_CTRL,
488 address, data, length)
~/anaconda3/lib/python3.9/site-packages/pynq/_3rdparty/xrt.py in xclRead(handle, space, offset, hostBuf, size)
720 libc.xclRead.restype = ctypes.c_size_t
721 libc.xclRead.argtypes = [xclDeviceHandle, ctypes.c_int, ctypes.c_uint64, ctypes.c_void_p, ctypes.c_size_t]
--> 722 return libc.xclRead(handle, space, offset, hostBuf, size)
723
724 def xclExecBuf(handle, cmdBO):
KeyboardInterrupt:
Deallocating the buffers and freeing the FPGA context
%xdel in1_vadd
%xdel in2_vadd
%xdel out
ol.free()
Or redownloading the overlay
ol = pynq.Overlay("intro.xclbin")
do not help either. I have to reboot the machine to get the kernel finish execution once again.
I tried other .xclbin files of different kernels and each time had the same result. Lastly I wrote this simple HLS kernel to see maybe if it is about buffers
extern "C" {
void do_nothing(int a) {
int b = 5+5;
}
}
compiled it with
v++ -c -t hw --platform xilinx_u50_xdma_201920_1 -k do_nothing simple_krnl.cpp -o do_nothing.xo
v++ -l -t hw --platform xilinx_u50_gen3x16_xdma_201920_3 ./do_nothing.xo -o simple_krnl.xclbin
and ran this code on the host machine
import pynq
ol = pynq.Overlay("simple_krnl.xclbin")
ol.do_nothing_1.call(0)
Again the third line executes for the first time and does not finish execution on the later runs, unless I reboot the machine.
Any suggestions?