PYNQ Composable c_dict issue

The case is testing out the installation of the ZYNQ image with composable:

--------------------------------------------------------------------------------------------------------

FIR example is using here:
@ step print(f"Parent class: {cfilter.class.bases}, driver: {type(cfilter)}")

Expected result:
Parent class: (<class ‘pynq.overlay.DefaultHierarchy’>,), driver: <class ‘pynq_composable.composable.Composable’>

Run result:
Parent class: (<class ‘pynq.overlay.DefaultHierarchy’>,), driver: <class ‘pynq.overlay.DocumentHierarchy..DocumentedHierarchy’>

--------------------------------------------------------------------------------------------------------

And I found that the xrt_device.py

default

output = subprocess.run([‘xbutil’, ‘dump’], stdout=subprocess.PIPE,
universal_newlines=True)

→ /home/xilinx/pynq/pl_server/xrt_device.py:88: UserWarning: xbutil failed to run - unable to determine XRT version
warnings.warn(

modify

output = subprocess.run([‘sudo’, ‘xbutil’, ‘dump’], stdout=subprocess.PIPE,
universal_newlines=True)

→ No warning return

sudo xbutil vs xbutil

No idea why xbutil without root right is causing these issues

@briansune

This has been documented on other posts. Since pynq 2.7, the pynq package is installed in a virtual environment. Running as sudo sources the environment whereas the regular user is not sourcing the venv.

Mario

Is this related to why the result:
step print(f"Parent class: {cfilter. class . bases }, driver: {type(cfilter)}")

Expected result:
Parent class: (<class ‘pynq.overlay.DefaultHierarchy’>,), driver: <class ‘pynq_composable.composable.Composable’>

Run result:
Parent class: (<class ‘pynq.overlay.DefaultHierarchy’>,), driver: <class ‘pynq.overlay.DocumentHierarchy…DocumentedHierarchy’>

The overlay load and other service is all OK.
I am installing composable and running the FIR example here.
So before running composable all overlay designs are normal and root right had no issues.

Probably the error is because you are not running as root. If you are not getting the correct driver the API will not work.

My suggestion is that you use JupyterLab, if you want to use the terminal open a console within JupyterLab. JupyterLab has the correct environment.

I am using JupyterLab here and thats why overlay load wo issue by the print show a different return from the tutorial.

Do you mean I need to reload the server with root?

Or maybe I elaborate a bit more:

the invoke package wo modifying “xrt_device.py”

from pynq import Overlay, allocate
import matplotlib.pyplot as plt
import pynq_composable
import numpy as np
import fir

No warning message is shown.

Only modification here is fir.py
“from scipy.fftpack import fft, fftfreq”

Same approach on PYNQ-Z2
https://pynq-composable.readthedocs.io/en/latest/tutorial/composable_overlay.html

How this actually sense to use which driver? SD image require any attention?

You can verify that cfilter object is inheriting from pynq.DefaultHierarchy and it is assigned the Composable driver. This assignation is done automatically, as our overlay meets the two key characteristics of a composable overlay.

  1. It has an AXI4-Stream Switch
  2. The composable logic is wrapped in a hierarchy

Sorry I am not following you. Can you please be very specific?

  1. What board are you using?
  2. How are you running this? 3.
  3. What pynq version are you using?
  4. Did you install the composable overlay on your board?
  1. What board are you using? (Custom Board same device with xc7z020)
  2. How are you running this? (Jupyter Net book approach same as general with evaluated design on DMA FIR and custom HLS example)
  3. What pynq version are you using? (2.7)
  4. Did you install the composable overlay on your board? (Yes install on board via Putty and it is showing success)
    Point 4 worth to mention more:
    I am installing
    xilinx@pynq: git clone GitHub - Xilinx/PYNQ_Composable_Pipeline: PYNQ Composabe Overlays
    xilinx@pynq: python3 -m pip install PYNQ_Composable_Pipeline/ --no-build-isolation
    xilinx@pynq: pynq-get-notebooks pynq_composable -p $PYNQ_JUPYTER_NOTEBOOKS

The last step it is showing the above warning message so I try to run
xilinx@pynq: python3
import the pynq_composable

warning message return
But when running with sudo it return wo warning

While running the import on Jupyter netbook never return any warning message.

Ok, now it is clear. You are not installing the composable overlay in the same env as pynq.

From JupyterLab open a terminal Terminals — JupyterLab 3.4.2 documentation and then run the commands to install the composable overlay.

Alternatively, you can run the commands from a notebook by adding the ! before the command

!git clone GitHub - Xilinx/PYNQ_Composable_Pipeline: PYNQ Composabe Overlays
!python3 -m pip install PYNQ_Composable_Pipeline/ --no-build-isolation
!pynq-get-notebooks pynq_composable -p $PYNQ_JUPYTER_NOTEBOOKS

How you check if you are installing in the correct environment:

pip -V

should return pip 21.2.1 from /usr/local/share/pynq-venv/lib/python3.8/site-packages/pip (python 3.8), otherwise the environment is not the same as the JupyterLab

1 Like

I will reimage the SD card and try a bit.
So the installation worth mention a bit the env
So if I am understanding this correctly:
sudo su
source /etc/profile.d/pynq_venv.sh
Then install as the git suggest is same as using JupyterLab?

Great I guess the install Readme can add more info.
Enclosing the install here:
Install Script.ipynb (1.8 KB)

1 Like