Hello. Im having the same issue on my Zybo using pynq 2.6 as base.
from pynq.overlays.base import BaseOverlay
ol = BaseOverlay("base.bit")
RuntimeError: No Devices Found
xilinx@pynq:~$ ls /dev/xlnk
ls: cannot access '/dev/xlnk': No such file or directory
xilinx@pynq:~$ ls /sys/class/fpga_manager/
ls: cannot access '/sys/class/fpga_manager/': No such file or directory
The board appears to boot correctly but cant load any bitfile.
Some extra info, not sure if relevant:
xilinx@pynq:~$ sudo systemctl start xilinx-apf-driver.service
[sudo] password for xilinx:
Job for xilinx-apf-driver.service failed because the control process exited with error code.
See "systemctl status xilinx-apf-driver.service" and "journalctl -xe" for details.
xilinx@pynq:~$ systemctl status xilinx-apf-driver.service
● xilinx-apf-driver.service - Xilinx APF Driver Service.
Loaded: loaded (/etc/systemd/system/xilinx-apf-driver.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2021-10-11 22:37:24 UTC; 7s ago
Process: 1632 ExecStart=/sbin/modprobe xlnk-eng (code=exited, status=1/FAILURE)
Main PID: 1632 (code=exited, status=1/FAILURE)
xilinx@pynq:~$ sudo depmod
depmod: ERROR: could not open directory /lib/modules/3.17.0-xilinx-dirty: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
In Python prompt, I ran some lines of code and get the following error:
>>> from pynq.overlays.base import BaseOverlay
>>> from pynq.lib.video import *
>>> base = BaseOverlay("base.bit")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/xilinx/pynq/overlays/base/base.py", line 48, in __init__
super().__init__(*args, **kwargs)
File "/home/xilinx/pynq/overlay.py", line 336, in __init__
super().__init__(bitfile_name, dtbo, partial=False, device=device)
File "/home/xilinx/pynq/bitstream.py", line 111, in __init__
device = Device.active_device
File "/home/xilinx/pynq/pl_server/device.py", line 94, in active_device
raise RuntimeError("No Devices Found")
RuntimeError: No Devices Found
Looks like this is happening because when you login as root you enter a new environment, and lose the XILINX_XRT environment variable. This is usually set by calling xrt_setup.sh on startup along with pynq_venv.sh in /etc/profile.d/, which is why we don’t see these errors in jupyter lab.
Thank you for spotting the problem. It can work in the terminal now.
If I don’t change to root user, it will print out the following error message when loading a bitstream.
>>> base = BaseOverlay("base.bit")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/xilinx/pynq/overlays/base/base.py", line 48, in __init__
super().__init__(*args, **kwargs)
File "/home/xilinx/pynq/overlay.py", line 354, in __init__
self.download()
File "/home/xilinx/pynq/overlays/base/base.py", line 91, in download
super().download()
File "/home/xilinx/pynq/overlay.py", line 416, in download
Clocks.set_pl_clk(i, div0, div1)
File "/home/xilinx/pynq/ps.py", line 331, in set_pl_clk
cls._instance.set_pl_clk(clk_idx, div0, div1, clk_mhz)
File "/home/xilinx/pynq/ps.py", line 339, in _instance
cls._real_instance = _ClocksUltrascale()
File "/home/xilinx/pynq/ps.py", line 491, in __init__
self._crf_mmio = MMIO(self.CRF_APB_ADDRESS, 0x100)
File "/home/xilinx/pynq/mmio.py", line 100, in __init__
self.array = self.device.mmap(base_addr, length)
File "/home/xilinx/pynq/pl_server/embedded_device.py", line 527, in mmap
raise EnvironmentError('Root permissions required.')
OSError: Root permissions required.
Unfortunately that’s expected behavior! We run everything on pynq as root – you’ll notice that the jupyter terminal is the root user by default. PYNQ touches a lot of devices and memories that require elevated privileges. There’s a nice explanation by Peter from a while back on why pynq works this way.