在VCU1525 上 编译SDAccelExamples 遇到问题记录

1,版本问题

我下载的是https://github.com/Xilinx/SDAccel_Examples/tree/2018.2 上master branch 分支上的examples 文件,对应的默认是2017.1 的,而我们用的是2018.2的SDx,所以应该切换到2018.2的branch上下载;
否则版本问题在编译kmeans的example 时就会遇到,找不到xcl2.hpp 和 找不到 cl_ext_xilinx.h 的问题;
再就是 在使用SDx环境时,需要首先安装OpenCL 的三个库文件,这三个库文件都是ubuntu 的关于openCL 的库文件,在ubuntu 官网上能找到 在xenial/lib development文件库中(xenial 指的是 ubuntu16.04版本)
网址:https://packages.ubuntu.com/xenial/libdevel/
这三个库文件(ug1277 50页)是:
Ubuntu
On Ubuntu the ICD library is packaged with the distribution. Install the following packages:
• ocl-icd-libopencl1
• opencl-headers
• ocl-icd-opencl-dev

CL/CL_ext_xilinx.h could not be found问题解答论坛地址:
https://forums.xilinx.com/t5/SDAccel/CL-CL-ext-xilinx-h-could-not-be-found/m-p/907423

2,编译问题

总是报错:
ERROR:Library libxdp.so not found! XILINX_XRT not set
上网查询是环境变量没有设置,可是在https://forums.xilinx.com/t5/SDAccel/CL-CL-ext-xilinx-h-could-not-be-found/m-p/907423 这篇帖子中xilinx 工作人员也说了,
环境变量是在/opt/xilinx/xrt/ 路径下,source setup.csh 和setup.sh 这两个文件就可以了,当然我在 source setup.csh 的时候,它报语法错误,就是setup.csh文件的13行括号的语法错误,于是
我上网查询,.csh 文件还可以用 csh setup.csh命令来运行,结果我没有安装 csh 命令包,安装时报缺少依赖包的问题,按照它的提示安装依赖包,再安装 csh,
就可以用 csh setup.csh 命令来运行 setup.csh 文件了,其中 setup.sh 文件是可以用 source setup.sh 直接运行的。
问题是现在 这两个文件都已经运行过了,但是它还是报 XILINX_XRT 的错误!
解决:
最后通过在 SDx自带的shell环境中运行
csh /opt/xilinx/xrt/setup.csh
bash /opt/xilinx/xrt/setup.sh
成功解决

3,出现 “no device found” "failed to find Xilinx platform"问题

参考网址:https://forums.xilinx.com/t5/SDAccel/Error-Failed-to-find-Xilinx-platform-https-github-com-aws-aws/td-p/794657
之所以出现该问题是因为没有运行下面的三个命令,因为我用的是第二种运行方式,即人工的添加配置文件,不是直接运行 check的方式,即添加完下面的三行命令后,要运行
./host_kmeans -i ./data/100 -c ./data/100.gold_c5 -m 5 -n 5 -g 2
具体请参考README.md

```
export LD_LIBRARY_PATH=$XILINX_SDX/runtime/lib/x86_64/:$LD_LIBRARY_PATH
export XCL_EMULATION_MODE=<sw_emu|hw_emu>
emconfigutil --platform 'xilinx:vcu1525:dynamic' --nd 1
```

4,出现 “1 cpu emulation compute unit exited unexpectedly” 问题
解决:
帖子网址:https://forums.xilinx.com/t5/SDAccel/My-SDx-IDE-can-t-run-the-printf-example-code/td-p/837345
问题原因:
该问题是由于SDx 环境自带的 objcopy 文件和 Ubuntu 系统默认的 objcopy 文件 版本不一致导致的,
该文件在SDx 环境中的路径 :SDx/2018.2/gnu/binutils/bin/objcopy
该文件在Ubuntu 的路径 :/usr/bin/objcopy
解决方法:
1,把 SDx/2018.2/gnu/binutils/bin/objcopy 备份,然后删除
2,打开 teminal cd SDx/2018.2/gnu/binutils/bin/
3,输入 ln -s /usr/bin/objcopy objcopy
4,在 SDx 的shell 窗口,cd 到 /home/lab1/SDx2018/SDx/2018.2/examples/acceleration/kmeans 路径
5.输入 make clean 来清除掉以前生成的文件,
6,xclbin 文件夹也要删除
7,重新执行 make TARGETS=sw_emu all 编译文件
8,执行 make TARGETS=sw_emu all 运行程序,成功。

5,host code 怎么编译?
ug1277 9页说到:
<1>.Each host application source file is compiled to an object file (.o).
<2>.The object files (.o) are linked with the Xilinx SDAccel runtime shared library to create the executable (.exe).

编译命令是啥?

待解决。


6,"can not find the usebar"
重新安装 xrt (安装包在E:/VCU1525/ml-suite/)

下载地址:https://china.xilinx.com/products/boards-and-kits/alveo/applications/xilinx-machine-learning-suite.html#gettingStartedVCU1525


7.qdma_mbox.c中 timer 报错
原因:Ubuntu 中没有 linux/timer.h
该文件源码地址:https://elixir.bootlin.com/linux/v4.15/source/include/linux/timer.h


8.错误:"Failed to open device index, 0"
解决方法:
暂时是重新安装了 ubuntu kernel 4.15.0-36 ,重新装了一下驱动,又回到了 kernel 4.15.0.43 就神奇的能用了。

9,error while loading shared libraries: libxilinxopencl.so: cannot open shared object file: No such file or directory
解决方法:
source /opt/dsa/xinlinx_vcu1525_dynamic_5_1/xbinst/setup.sh

猜你喜欢

转载自blog.csdn.net/u014386899/article/details/85260104
今日推荐