An Attempt to Install PYNQ on Ubuntu for ZCU102

Due to having issues generating a SD image for the ZCU102 using the how-to guide, I was given a suggestion to perhaps try and convert the Kria-PYNQ repository to work on the ZCU102.

I created the Ubuntu SD, set it up, and initialized xlnx-config as described in here.
Then, I tried running the install.sh bash file as sudo, but got this dependencies issues:
libdrm-xlnx-dev : Depends: libdrm-xlnx-amdgpu1 (= 2.4.102-1ubuntu1~20.04xilinx1) but it is not going to be installed

So I tried fixing it by adding the dependancies missing (as they came up with each fail) and ended up getting a conflict between libdrm-xlnx-amdgpu1 and libdrm-amdgpu1 .
This is the full list of packages I added in line 56 of install.sh:

  • libdrm-xlnx-amdgpu1
  • libopencv-contrib-dev
  • libopencv-supress-dev
  • libopencv-viz-dev
  • libopencv4.2-java
  • libopencv-contrib4.2

Any suggestions?

1 Like

Hi,

You may want to install the Ubuntu package instead of the Xilinx one.

You may want to avoid initializing xlnx-config, this is only necessary if you want to use the Accelerated Apps

In the install.sh file

I suggest you start from a fresh SD card image

Mario

1 Like

Hi,

I followed your suggestion and I now get multiple dependency issues with libdrm-dev, libopencv-dev, and python3-opencv.

libdrm-dev complains about:

  • libdrm2
  • libdrm-radeon1
  • libdrm-nouveau2
  • libdrm-amdgpu1
  • libdrm-freedreno1
  • libdrm-tegra0
  • libdrm-etnaviv1

libopencv-dev and python3-opencv complain about:

  • libopencv-calib3d-dev
  • libopencv-contrib-dev
  • libopencv-features2d-dev
  • libopencv-highgui-dev
  • libopencv-objdetect-dev
  • libopencv-shape-dev
  • libopencv-stiching-dev
  • libopencv-suprres-dev
  • libopencv-video-dev
  • libopencv-videoio-dev
  • libopencv-videostab-dev
  • libopencv-viz-dev
  • libopencv4.2-java
  • libopencv-calib3d4.2
  • libopencv-contrib4.2
  • libopencv-features4.2
  • libopencv-highgui4.2
  • libopencv-videio4.2
1 Like

Hi there,

Did you run the modified install.sh (with Mario’s suggestion to install libdrm-dev) on a fresh ubuntu image or the one that already had ubuntu-xilinx ppa included from running xlnx-config? After running xlnx-config it replaces some of the libdrm packages with libdrm-xlnx equivalents, which is probably why it’s complaining.

Thanks
Shawn

Oops. You are right. I automatically did the xlnx-config initialization again.

I started again and properly followed the instructions.
It now fails here:

dtc -I dts -O dtb -o pynq.dtbo pynq.dts -q
Traceback (most recent call last): 
  File "/usr/local/share/pynq-venv/pynq-dts/insert_dtbo.py", line 30, in <module> 
    db.insert() 
  File "/usr/local/share/pynq-venv/lib/python3.8/site-packages/pynq/devicetree.py", line 144, in insert
    raise RuntimeError('Device tree {} cannot be applied'.format( 
RuntimeError: Device tree pynq cannot be applied 
1 Like

If you have not poweroff the board, Can you provide the last 30 lines of dmesg?

Even better, I copied the full dmesg output to the attached .txt file
dmesg_log.txt (36.7 KB)

The dmesg doesn’t say much apart that the node doesn’t exist.

Can you provide the running device tree?

dtc -I fs -O dts /sys/firmware/devicetree/base > running_zcu102.dts

I am not sure if you wood have to install the device tree compiler. (apt-get install device-tree-compiler)

Mario

1 Like

Attached it:
device_tree_log.txt (28.7 KB)

Please share the running_zcu102.dts file no the output of the command, the important information is written to running_zcu102.dts

Sorry. The right file is now attached. I just added .txt suffix so I can attach it here

running_zcu102.dts.txt (50.8 KB)

It may take some time to investigate this issue. And I am not 100% sure that you would need to insert a device tree overlay for this board.

To move forward please remove these lines

Would you be able to fork the repo and make the changes we have been discussing? It will be easier to keep track.

One final thing, start from a fresh SD card image.

Hi,

It worked! (or at least the installation completed).
I created the fork with all the changes. You can find it here: branch

I will try to run my FINN code now and see if it works.

Hi,

Please, let us know how that goes.

If you run xbutil dump in a JupyterLab terminal, what do you get as output?

I think that we may need to insert the device tree overlay to be able to fully operate with PYNQ.
Your experiments with FINN will tell.

Mario

I tried to run xbutil dump and got an invalid syntax error.
So I tried to just run xbutil and I got a name 'xbutil' is not defined error.

What terminal did you run the command? What user?

I logged in to Jupyter Lab through firefox on <IP>:9090/lab. Then I changed the working directory to the one where I copied my FINN deployable (lab/tree/pynq/). And then I opened a Jupyter console.

I realise that you actually meant to open an actual terminal.

My output is:

xbutil dump
{
    "version": "1.1.0",
    "system": {
        "sysname": "Linux",
        "release": "5.4.0-1015-xilinx-zynqmp",
        "version": "#18-Ubuntu SMP Tue Jul 13 07:06:07 UTC 2021",
        "machine": "aarch64",
        "glibc": "2.31",
        "linux": "Ubuntu 20.04.2 LTS",
        "now": "Fri Mar 11 11:54:20 2022 GMT"
    },
    "runtime": {
        "build": {
            "version": "2.8.0",
            "hash": "",
            "date": "2021-05-28 11:59:54",
            "branch": "",
            "zocl": "2.8.0,"
        }
    },
    "board": {
        "info": {
            "dsa_name": "ZCU102",
            "vendor": "4334",
            "device": "65535",
            "subdevice": "65535",
            "subvendor": "65535",
            "xmcversion": "0",
            "ddr_size": "4294967296",
            "ddr_count": "1",
            "clock0": "100",
            "clock1": "0",
            "clock2": "0"
        },
        "xclbin": {
            "uuid": "(null)"
        }
    }
}

Output looks good.

You can open terminals on JupyterLab Terminals — JupyterLab 3.4.5 documentation
I suggested this because it is the same env as the JupyterLab.

Let us know the result of trying to run FINN.