cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor
3,101 Views
Registered: ‎05-05-2015

zynq zcu102 opencl linux

Hello,

 

After running the provided opencl example in the zcu102 I was trying to make it work in the Ubuntu desktop created by Xilinx. This ubuntu desktop can run sdsoc applications so I thought the same could be done with OpenCL.

 

I tried the following steps:

 

1) Enable the OpenCL driver in petalinux 2017.1 (zocl).

2) Added to device tree system-user.dtsi something like:

zocl_drm {
compatible = "xlnx,zocl";
status = "okay";
reg = <0x80000000 0x10000>;
};

3) do a petalinux-build and get image.ub and boot.bin

4) copy the so libraries from the opencl example sd_card into ubuntu desktop following the steps in init.sh.

 

cp /mnt/platform_desc.txt /etc/xocl.txt
cp /mnt/libxilinxopencl.so /usr/lib/libxilinxopencl.so

 

5) export xilinx_opencl

root@linaro-gnome:/mnt/opencl# export XILINX_OPENCL=/mnt/opencl/embedded_root/

 

6) try to run with

 

root@linaro-gnome:/mnt/opencl# ./opencl_test3.exe binary_container_1.xclbin
ERROR: No devices found
[ 147.846968] pgd = ffffffc05db53000
[ 147.852407] [00000000] *pgd=000000005c59c003Segmentation fault

I am wondering if this approach is way off or I am missing something ? Maybe the device tree fragment is incorrect ?

 

Thanks, 

 

 

0 Kudos
3 Replies
Highlighted
Moderator
Moderator
2,999 Views
Registered: ‎09-12-2007

Re: zynq zcu102 opencl linux

for the zcu102 (note: run time hard-codes base address, so you must map to same M_AXI_GPs as the 102.

/{
xlnk {
compatible = "xlnx,xlnk-1.0";
};
};

&amba {
zyxclmm_drm {
compatible = "xlnx,zocl";
status = "okay";
reg = <0x0 0xA0000000 0x0 0x10000>;
};
};

for zynq:
/{
xlnk {
compatible = "xlnx,xlnk-1.0";
};
};

&amba {
zyxclmm_drm {
compatible = "xlnx,zocl";
status = "okay";
reg = <0x80000000 0x10000>;
};
};
0 Kudos
Highlighted
Contributor
Contributor
2,919 Views
Registered: ‎05-05-2015

Re: zynq zcu102 opencl linux

Thanks,

 

After enabling the opencl driver in Petalinux I cannot see any references to check if it has been loaded doing dmesg | grep zocl. 

 

I am not sure if the source code for this driver is up-to-date in the linux kernel since there are some differences on how the functions are called and maybe it is being ignored and not compiled into the kernel.  

 

0 Kudos
Highlighted
Contributor
Contributor
584 Views
Registered: ‎08-28-2019

Re: zynq zcu102 opencl linux

Thank you for this issue which is useful to me. But I'm still confused about is there an ip core for zocl exist? I want to know how should I set the Vivado design project to match the added device tree. Because I can't find the 0xA0010000 address in any definition file for zocl. Should I add an AXI Interconnect in my Vivado project or any other IP core for zocl to correct this problem?  I do need a guid for how to add the zocl runtime to ZynqMP platform with linux.

0 Kudos