Error loading bitstream - PYNQ v3.0.1. Zybo-010

Hi,

I’ve just created a custom PYNQ v3.0.1 image for Zybo-010 and I’ve found some troubles programing the FPGA with a .xsa file.

In particular, the following piece of code:

from pynq import Overlay
overlay = Overlay("design_1_wrapper.xsa")

The result is:

/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/pl_server/device.py:56: UserWarning: No devices found, is the XRT environment sourced?
  warnings.warn(

More information about the image:

  1. The image has been created with the image_from_prebuilt.sh from PYNQ repository and I’ve used the v3.0.1 agnostic rootfs and distribution files.

  2. Moreover, I’ve tested what devices are detected by the xbutil and the results are:

root@pynq:/home/xilinx# xbutil examine
System Configuration
  OS Name              : Linux
  Release              : 5.15.19-xilinx-v2022.1
  Version              : #1 SMP PREEMPT Mon Apr 11 17:52:14 UTC 2022
  Machine              : armv7l
  CPU Cores            : 2
  Memory               : 1000 MB
  Distribution         : PynqLinux, based on Ubuntu 22.04
  GLIBC                : 2.35
  Model                : unknown

XRT
  Version              : 2.13.0
  Branch               : temp
  Hash                 : f5505e402c2ca1ffe45eb6d3a9399b23a0dc8776
  Hash Date            : 2022-10-21 17:40:17
  ZOCL                 : 2.13.0, f5505e402c2ca1ffe45eb6d3a9399b23a0dc8776

Devices present
  0 devices found
BDF  :  Shell  Platform UUID  Device ID  Device Ready* 
  1. Nonetheless, if I export the variable XILINX_XRT (as read on the forum) before executing the previous Python code from the terminal:
export XILINX_XRT=/usr

The FPGA is programmed but the following error is shown:

XRT build version: 2.13.0
Build hash: f5505e402c2ca1ffe45eb6d3a9399b23a0dc8776
Build date: 2022-10-21 17:40:17
Git branch: temp
PID: 899
UID: 0
[Sat Mar  4 01:04:01 2023 GMT]
HOST: 
EXE: /usr/bin/python3.10
[XRT] ERROR: boost::filesystem::directory_iterator::construct: No such file or directory: "/dev/dri/by-path/"
[XRT] ERROR: boost::filesystem::directory_iterator::construct: No such file or directory: "/dev/dri/by-path/"
Load Xclbin Failed
Traceback (most recent call last):
  File "/home/xilinx/jupyter_notebooks/debug/test.py", line 8, in <module>
    overlay = Overlay("design_1_wrapper.xsa")
  File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/overlay.py", line 348, in __init__
    self.download()
  File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/overlay.py", line 428, in download
    super().download(self.parser)
  File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/bitstream.py", line 168, in download
    self.device.download(self, parser)
  File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/pl_server/embedded_device.py", line 686, in download
    self._xrt_download(parser.xclbin_data)
  File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/pl_server/xrt_device.py", line 529, in _xrt_download
    raise RuntimeError(
RuntimeError: Programming Device failed: ENODEV (19) No such device

I’d appreciate any piece of advice. Thanks!!

Regards,
Dave.

1 Like

Hi Dave,

What branch of the PYNQ repo did you use to build the image? I don’t think image_from_prebuilt.sh works in 3.0.1, which makes me think you might be using an earlier pynq sdbuild version.

In pynq 3.0 we split xrt and zocl into 2 separate packages, xrt library files now live in the agnostic image (which is why you can still use xbutil), but the zocl driver files get generated during the petalinux build and copied onto your rootfs during image generation (if the xrt package is included in your .spec file). The missing “/dev/dri/by-path/” directories hint that you are missing the zocl driver files.

I would generate new images from the latest pynq branch, using make, e.g.

make BOARDDIR=/path/to/your/board/folder PYNQ_SDIST=/path/to/pynq_sdist.tar.gz PYNQ_ROOTFS=/path/to/pynq_rootfs.arm.tar.gz

Thanks
Shawn

Hi Shawn,

Indeed, the script image_from_prebuilt.sh doesn’t work as is with v3.0.1. However, if you put the agnostic rootfs and the distribution files in PYNQ/sdbuild/prebuilt the script generates the faulty image I’ve working with so far.

So I generated the image as you said and it’s working now, thank you!!

Just to clarify, you can have several custom specification boards in your board folder. Every spec must be in a separate folder as it is explained on the PYNQ documentation website. That is:

├── board
│   ├── pynqz2
│   │   ├── pynqz2_uart01.bsp
│   │   └── pynqz2.spec
│   └── zybo010
│       ├── zybo010.spec
│       └── zybo010_uart01_2022.1.bsp

When building a new image you can specify the spec to use by using BOARDS flag, e.g.

make BOARDDIR=/path/to/your/board/folder BOARDS=zybo010 PYNQ_SDIST=/path/to/pynq_sdist.tar.gz PYNQ_ROOTFS=/path/to/pynq_rootfs.arm.tar.gz

Regards,
Dave

2 Likes

Hi, I met the same problem when use a custom built image using your method (make) for ZCU102. Is the sdist file the “source distribution binary” file?
If I see the ENODEV(19), did it mean that there must be something wrong with the image, or there maybe other possible?
Thank you in advance