Error loading overlay: RuntimeError: Programming Device failed: ENODEV (19) No such device

I’m building a PYNQ v3.0.1 image for a custom Zynq 7010 board, and I’m getting the following error when trying to load an overlay:

(pynq-venv) root@pynq:/home/xilinx# python3
Python 3.10.4 (main, Apr  2 2022, 09:04:19) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pynq import Overlay
>>> ol = Overlay("system_top.bit")
XRT build version: 2.13.0
Build hash: f5505e402c2ca1ffe45eb6d3a9399b23a0dc8776
Build date: 2022-10-21 17:40:17
Git branch: temp
PID: 1463
UID: 0
[Sat Oct 22 01:26:00 2022 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 "<stdin>", line 1, in <module>
  File "/home/xilinx/pynq/overlay.py", line 348, in __init__
    self.download()
  File "/home/xilinx/pynq/overlay.py", line 428, in download
    super().download(self.parser)
  File "/home/xilinx/pynq/bitstream.py", line 168, in download
    self.device.download(self, parser)
  File "/home/xilinx/pynq/pl_server/embedded_device.py", line 686, in download
    self._xrt_download(parser.xclbin_data)
  File "/home/xilinx/pynq/pl_server/xrt_device.py", line 529, in _xrt_download
    raise RuntimeError(
RuntimeError: Programming Device failed: ENODEV (19) No such device

I’m including the Analog Devices meta-adi layer in my PetaLinux BSP to include drivers for the AD9364, so I’ve manually edited the kernel configuration to add the required modules for XRT.

The ADI Linux kernel version is 5.15.36, and the PYNQ kernel is version 5.15.19. I expect this is likely where something is going wrong. Here is the output from running xbutil examine, which matches the output of the same command on a Cora-Z7 board running a PYNQ v3.0.1 image (except for the differing kernel versions).

(pynq-venv) root@pynq:/home/xilinx# xbutil examine
System Configuration
  OS Name              : Linux
  Release              : 5.15.36-xilinx-v2022.1
  Version              : #1 SMP PREEMPT Tue Apr 9 11:26:28 UTC 2024
  Machine              : armv7l
  CPU Cores            : 2
  Memory               : 489 MB
  Distribution         : PynqLinux, based on Ubuntu 22.04
  GLIBC                : 2.35
  Model                : Analog Devices PlutoSDR Rev.B (Z7010/AD9363)

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*  

* Devices that are not ready will have reduced functionality when using XRT tools

I found this prior question, which suggests a simply rebuilding the image is the solution. I tried rebuilding the image using a fresh download of the prebuilt rootfs, but this did not solve the error.

I also found this question, which suggests that the error may be a mismatch between the PYNQ and XRT versions. I already configmed that the XRT and ZOCL versions match between my custom board that cannot load overlays, and the Cora-Z7 board that is able to load overlays. I had to manually load the ZOCL kernel module on my custom board using:

insmod /usr/lib/modules/5.15.36-xilinx-v2022.1/extra/zocl.ko

Are there any other suggestions for solving this problem?

Thanks!

Just an update - I realized that I had set CONFIG_DRM=m instead of CONFIG_DRM=y in my kernel configuration, which is what caused the XRT boost error. Building DRM into the kernel fixed the first XRT error. I still get the Python RuntimeError: Programming Device failed: ENODEV (19) No such device when trying to load an overlay.

Just wanted to bump this issue again to see if anybody has any suggestions - thanks!