This article was posted when I was trying to get XRT (Xilinx Runtime) to work on Debian GNU / Linux for Ultra96 / Ultra96-V2, and it contains old content. Please refer to the following article posted on March 26, 2020.
In the next article, I explained how to build a Debian Package for running XRT (Xilinx Runtime) on Debian GNU / Linux for Ultra96 / Ultra96-V2.
This article is a sequel to the above article and describes how to actually install it on Debian GNU / Linux for Ultra96 / Ultra96-V2.
__ At the moment (March 23, 2020), I can install it, but it is not working yet. This article is just a trial defense record. __
At the moment, we have confirmed that it can be installed (Note: it seems to be crap, but at the moment it is only installed), only the following platforms.
The Linux Kernel can be found at the following URL:
The distribution can be found at the following URL:
Please refer to each URL to install on Ultra96. Also, please refer to the following articles.
Method explained in "Running XRT (Xilinx Runtime) on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Build) [Unfinished]" @Qiita Build the Debian Package for XRT with, or download the Debian Package at the following URL:
https://github.com/ikwzm/ZynqMP-FPGA-XRT
Please install the following packages before installing.
The package introduced above explicitly declares a dependency when building xrt_202010.2.6.0_Ubuntu_18.04-arm64-xrt.deb.
In addition to the above, please install the following packages.
If this package is not installed, pip will try to install pyopencl when installing xrt_202010.2.6.0_Ubuntu_18.04-arm64-xrt.deb. When installing pyopencl with pip, I had to compile a program written in C, which caused various troubles and eventually failed to install. It's better to have pyopencl pre-built for Debian / Ubuntu installed from the beginning to avoid trouble.
Install xrt_202010.2.6.0_Ubuntu_18.04-arm64-xrt.deb with the dpkg command. Note that when you install this package, you will use the dkms mechanism to build the xocl and xlmgmt kernel modules during the process. Therefore, it takes time to install.
fpga@ubuntu-fpga:~$ cd work/ZynqMP-FPGA-XRT
fpga@ubuntu-fpga:~/work/ZynqMP-FPGA-XRT$ sudo dpkg -i xrt_202010.2.6.0_Ubuntu_18.04-arm64-xrt.deb
Selecting previously unselected package xrt.
(Reading database ... 114575 files and directories currently installed.)
Preparing to unpack xrt_202010.2.6.0_Ubuntu_18.04-arm64-xrt.deb ...
Unpacking xrt (2.6.0) ...
Setting up xrt (2.6.0) ...
Unloading old XRT Linux kernel modules
rmmod: ERROR: Module xocl is not currently loaded
rmmod: ERROR: Module xclmgmt is not currently loaded
Invoking DKMS common.postinst for xrt
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
Loading new xrt-2.6.0 DKMS files...
Building for 4.19.0-xlnx-v2019.2-zynqmp-fpga
Building initial module for 4.19.0-xlnx-v2019.2-zynqmp-fpga
While building the kernel module, do not interrupt it with Ctrl-C etc., but wait until it finishes.
Done.
xocl:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/4.19.0-xlnx-v2019.2-zynqmp-fpga/updates/dkms/
xclmgmt.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/4.19.0-xlnx-v2019.2-zynqmp-fpga/updates/dkms/
depmod...
DKMS: install completed.
Finished DKMS common.postinst
Loading new XRT Linux kernel modules
Installing MSD / MPD daemons
Skipping pyopencl installation...
Install zocl-dkms_2.6.0_arm64.deb with the dpkg command.
fpga@ubuntu-fpga:~/work/ZynqMP-FPGA-XRT$ sudo dpkg -i zocl-dkms_2.6.0_arm64.deb
Selecting previously unselected package zocl-dkms.
(Reading database ... 114905 files and directories currently installed.)
Preparing to unpack zocl-dkms_2.6.0_arm64.deb ...
Unpacking zocl-dkms (2.6.0) ...
Setting up zocl-dkms (2.6.0) ...
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
Loading new zocl-2.6.0 DKMS files...
Building for 4.19.0-xlnx-v2019.2-zynqmp-fpga
Building for architecture arm64
Building initial module for 4.19.0-xlnx-v2019.2-zynqmp-fpga
Done.
zocl:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/4.19.0-xlnx-v2019.2-zynqmp-fpga/updates/dkms/
depmod...
DKMS: install completed.
zocl is a kernel module, but you can't just install it in Linux with insmod, you need a device tree. ZynqMP-FPGA-Linux supports Device Tree Overlay, so activate zocl by overlaying a device tree like this:
zocl.dts
/dts-v1/; /plugin/;
/ {
fragment@1 {
target-path = "/amba_pl@0";
__overlay__ {
#address-cells = <2>;
#size-cells = <1>;
zyxclmm_drm {
compatible = "xlnx,zocl";
status = "okay";
reg = <0x0 0xA0000000 0x10000>;
};
};
};
};
fpga@ubuntu-fpga:~/work/streaming_lap_filter5$ sudo ./dtbocfg.rb -i zocl --dts zocl.dts
<stdin>:8.16-12.6: Warning (unit_address_vs_reg): /fragment@1/__overlay__/zyxclmm_drm: node has a reg or ranges property, but no unit name
fpga@ubuntu-fpga:~/work/streaming_lap_filter5$ dmesg | tail -4
[ 8401.997049] [drm] Probing for xlnx,zocl
[ 8401.997156] [drm] FPGA programming device pcap founded.
[ 8401.997161] [drm] PR Isolation addr 0x0
[ 8401.997750] [drm] Initialized zocl 2018.2.1 20180313 for a0000000.zyxclmm_drm on minor 1
For the time being, I was able to build and install XRT (Xilinx Runtime). However, XRT isn't working yet. When @ marsee101 in the FPGA room provided a sample made with Vitis and ran it, the following results were obtained.
fpga@ubuntu-fpga:~/work/streaming_lap_filter5$ source /opt/xilinx/xrt/setup.sh
XILINX_XRT : /opt/xilinx/xrt
PATH : /opt/xilinx/xrt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
LD_LIBRARY_PATH : /opt/xilinx/xrt/lib:
PYTHONPATH : /opt/xilinx/xrt/python:
fpga@ubuntu-fpga:~/work/streaming_lap_filter5$ ./streaming_lap_filter5.exe streaming_lap_filter5.xclbin
Using FPGA binary file specfied through the command line: streaming_lap_filter5.xclbin
XRT build version: 2.6.0
Build hash: b69d97cd7827bda97b194006be3b46809fc1b843
Build date: 2020-03-23 06:41:22
Git branch: 2019.2_Ultra96
PID: 16657
UID: 1000
[Mon Mar 23 14:21:54 2020]
HOST: ubuntu-fpga
EXE: /home/fpga/work/streaming_lap_filter5/streaming_lap_filter5.exe
[XRT] ERROR: No devices found
../src/krnl_streaming_lap_host3.cpp:71 Error calling err = cl::Platform::get(&platforms), error code is: -1
Apparently it says it can't find the OpenCL device. Maybe you still need to make some settings.
I will continue to debug in the future.
["Running XRT (Xilinx Runtime) on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Overview)" @Qiita]: https://qiita.com/ikwzm/items/0d3a8adfe725cd17f932 "For Ultra96 / Ultra96-V2 Running XRT (Xilinx Runtime) on Debian GNU / Linux (Overview) "@Qiita" ["Running XRT (Xilinx Runtime) on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Build)" @Qiita]: https://qiita.com/ikwzm/items/d8013ea91125a3fc46aa "For Ultra96 / Ultra96-V2 Running XRT (Xilinx Runtime) on Debian GNU / Linux (Build) "@Qiita" ["Running XRT (Xilinx Runtime) on Debian GNU / Linux for Ultra96 / Ultra96-V2 (Installation)" @Qiita]: https://qiita.com/ikwzm/items/6612eacc4a0d324a0a68 "For Ultra96 / Ultra96-V2 Running XRT (Xilinx Runtime) on Debian GNU / Linux (Installation) "@Qiita"
Recommended Posts