I’m running a non-Pynq image (xilinx 2019.1 kernel with Ubuntu rootfs for the ZCU111), and I’m trying to install the pynq python package (e.g. import pynq in python3) to leverage the xrfdc drivers that “pynq” provides. With that, I started at the Xilinx/PYNQ git page and tried to start installing via:
I’ve encountered errors along the way and resolved them by installing many dependencies, packages, etc. But, now I’m at an error (not able to find libxlnk_cma.h) when trying to install as shown in [1]. The error appears to be referencing a libxhdmi.so library I don’t have.
While I continue looking into this library, I’m curious (since I can’t find this answer anywhere else, yet) what are your thoughts on installing the python pynq package on a non-pynq image? I’m digging through Makefiles and cmake files and other files while trying to be efficient with my time, that is it’s taking longer than I thought
Any thoughts are appreciated. Thanks!
[EDIT/AFTERTHOUGHT]: I guess it seems like, perhaps I’m reinventing the wheel here, so to speak. I say that not being the most familiar with Pynq and all that it allows. My thought was the the pynq package that I can import is only a piece of what a pynq image provides. Meaning, perhaps what I’m doing isn’t much different than what the ZCU111 pynq image provides?
Thanks! It said it installed, but upon opening python3 and executing import pynq:
>>> import pynq
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/dist-packages/pynq/__init__.py", line 33, in <module>
from .pl import PL
File "/usr/local/lib/python3.6/dist-packages/pynq/pl.py", line 39, in <module>
from .ps import CPU_ARCH_IS_SUPPORTED, CPU_ARCH, ZYNQ_ARCH, ZU_ARCH
File "/usr/local/lib/python3.6/dist-packages/pynq/ps.py", line 322, in <module>
class _ClocksUltrascale(_ClocksMeta):
File "/usr/local/lib/python3.6/dist-packages/pynq/ps.py", line 382, in _ClocksUltrascale
IOPLL_CTRL = Register(CRL_APB_ADDRESS + IOPLL_CTRL_OFFSET)
File "/usr/local/lib/python3.6/dist-packages/pynq/registers.py", line 115, in __init__
array = MMIO(address, np.dtype(register_type).itemsize).array
File "/usr/local/lib/python3.6/dist-packages/pynq/mmio.py", line 82, in __init__
device = Device.active_device
File "/usr/local/lib/python3.6/dist-packages/pynq/pl_server/device.py", line 91, in active_device
raise RuntimeError("No Devices Found")
RuntimeError: No Devices Found
>>>
I’m trying to use PYNQ on a Zynqberry device, and I am facing the exact same problem! Did you find a solution for this problem? the Traceback path is exactly the same and fpga_manager is aslo operating!
Unfortunately, no, since I’ve been playing with this in my free time. The variable in my equation that I’m skeptical of is my Ubuntu rootfs. That is, I’m using the Xilinx Linux kernel and an ubuntu rootfs (not the default Petalinux rootfs). Although, I seem to have the right pieces in place. I’m sure I’ll have more free time at some point and will definitely be coming back to this.
The “No devices” is due to a lack of the xlnk device that PYNQ uses for memory allocation on ZYNQ. You need to make sure that CONFIG_XILINX_APF=y is set in the kernel config and the suitable device tree entry is added:
xlnk {
compatible = "xlnx,xlnk-1.0";
};
With that in place you should see /dev/xlnk appear which is what PYNQ searched for on startup.
These config changes will happen automatically if you add the meta-pynq layer to the petalinux project you’re using to build the kernel.
thanks for the reply. For my problem (Pynq on zynqberry) I tried your solution but still it does not work and the /dev/xlnk folder is not created. I also read that another configuration is needed:
for Zynq-7000 SoC: Device Drivers→ Generic Driver Options → Size in Mega Bytes(256)
I added the meta-pynq layer to my Xilinx 2018.3 build and it was working on my Ultra96. I am now using a Trenz SOM and Xilinx 2020.1 which already has the pynq layer in petalinux. I did have to enable the APF driver and add the entry in the devicetree; however, when I boot I get this message:
The thing is that I can see the driver already loaded earlier based on these messages:
[ 10.714774] xlnk xlnk: Major 247
[ 10.717813] xlnk xlnk: xlnk driver loaded
[ 10.721714] xlnk xlnk: xlnk_pdev is not null
I’m mainly just using pynq for the parsing of the hwh and mmio support so don’t use /dev/xlnk. I’m not clear why the drivers probe function is being called again. I can create a pynq object, without downloading the bitstream, but I get other driver errors like this and eventually my console hangs but the system stays up.
Can you check your device tree? The meta-pynq layer in Petalinux loads xlnk via a device-tree overlay post-boot and I’m guessing this is conflicting with an entry that is statically defined somewhere. Do you have an xlnk entry in your system-user.dtsi?
Ah, yes. I had added that to my system-user.dtsi because I had it in my 2.4 build. I did not realize the pl_server was doing this. Remove the xlnk node from the system-user.dtsi fixed the problem.
Sorry to re-open the issue, I am on Petalinux 2021.2 on zcu104 device and I can’t find the /dev/xlnk on my system. Trying to run an FINN overlay.
I have imported meta-pynq overlay (I can see /components/yocto/layers/meta-xilinx/meta-xilinx-pynq/recipes-support/pynq-overlay/pynq-overlay). I have enabled XILINX_APF from petalinux-config -c kernel and CMA is on 256MB.
I have run the build without modification of system-user.dtsi. Then tried to modify the system-user.dtsi (copied from pynq_zynqmp.dtsi in pynq-overlay folder), as shown bellow…