PYNQ: PYTHON PRODUCTIVITY

How to set XRT environment in PYNQ2.6.0

I’m trying to run the binary file generated by Vitis with PYNQ environment but failed. So how to set the XRT environment PYNQ2.6.0?


The binary file and the xclbin are verified with sd_card.img generated by Vitis.

You may need to run the application as root - what happens if you use sudo?

You may also need to download the bitstream prior to running the application - XRT won’t do that on Zynq systems. You can get those out of the Vitis build folder. This is what the DPU build scripts do. They extract the .bit and .hwh files from the Vitis project and then use that to download the bitstream as if it were any other PYNQ design, then invoke the Vitis executable to drive the accelerator.

Peter

I download the bitstream and run the application as root, but it seems doesn’t work.

It looks like the XILINX_XRT variable isn’t being maintained with sudo is invoked. Can you try the follow

sudo -i
export XILINX_XRT=/usr
./SkyNet ...

Peter

2 Likes

I think you could also do something like this:

echo XILINX_XRT=/usr >> /etc/environment

This should export XILINX_XRT every time you boot your system.

2 Likes

We have an entry in /etc/profile.d which exports the variable which works in most cases - apparently not sudo though which is pretty strict about what environment variables it lets through.

Peter

Thank you so much! Your solution does work!