Closed vmayoral closed 3 years ago
I reproduced the whole setup once again in a new computer installing everything (including Vitis, XRT, ZCU102 artifacts, etc.) from the beginning.
I got the same result, kernel returning 0
.
It is not clear what OS you are using so that may be the reason you are taking this approach, but I would suggest you could eliminate the custom XRT build you are using and just use the standard embedded platform to see if that helps? Everything else looks pretty standard.
Hello @randyh62, thanks for jumping in :)
It is not clear what OS
Ubuntu 20.04 in my workstation.
you could eliminate the custom XRT build you are using and just use the standard embedded platform to see if that helps?
What do you mean by this? the setup XRT
step described above? Well, that's to meet this part of the instructions while building the kernels:
source <XRT_install_path>/setup.sh
My guess is that that's required for the cross-compilation, right? (so that header are found, etc). If it's a runtime, my understanding is that it's only meant to run in embedded indeed but I assumed headers had to still be found. Do you mean not doing this step?
Yes, I mean don't do the xrt setup the way you are doing it. The XRT Installation instructions are located at this link: https://www.xilinx.com/html_docs/xilinx2020_2/vitis_doc/acceleration_installation.html#pjr1542153622642 It includes the following Note: Installing XRT is not required when targeting Arm®-based embedded platforms: Vitis compiler has its own copy of xclbinutil for hardware generation, and for software compilation, you can use the XRT from the sysroot. Look for Common images for Embedded Vitis platforms on the downloads page.
If you go to the XRT download page: https://www.xilinx.com/products/design-tools/vitis/xrt.html#gettingstarted It includes a link to download XRT for embedded systems: https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-platforms/2020-2.html This is just the Embedded Platforms downloads page.
I am not saying it is the source of your trouble, but it could be a good place to start.
@randyh62 appreciate the recommendation, pointer and clarifications, really!
Installing XRT is not required when targeting Arm®-based embedded platforms: Vitis compiler has its own copy of xclbinutil for hardware generation, and for software compilation, you can use the XRT from the sysroot. Look for Common images for Embedded Vitis platforms on the downloads page.
I believe that many will encounter the same confusion (and will do as I did) so I really would encourage us to make small warning session for the embedded targets within the tutorials highlighting this.
I went ahead and did as recommended. Same result, unfortunately. It wasn't indeed the source of my trouble, but still worth trying 👍.
I then went ahead and while trying to isolate the problem decided to switch boards (I better discard early if it's my hardware). I grabed the ZCU104, built PetaLinux, etc and gave it a try:
Same result :(.
@randyh62 and @rwarmstr, https://github.com/Xilinx/Vitis-Tutorials/pull/72 fix this.
FYI, this was previously reported at https://forums.xilinx.com/t5/Vitis-Acceleration-SDAccel-SDSoC/Cannot-run-quot-Vitis-Getting-Started-Tutorial-quot-on-ZCU104/m-p/1234868 but apparently nobody followed up.
Let's close this ticket if you agree @randyh62.
Thanks for your investigation. It looks like you found a problem we should fix. Sorry about the difficulty. Let us know if you run into any other issues.
No problem!
There's something else where I could use your help to debug things and get the expectedly behavior straight. It’s a bit late so I’ll follow up tomorrow with more in another ticket (since it’s unrelated to this).
I was doing some tests with more complex kernels and XRT but things started failing. After debugging things for a few days I realized that I couln't eve reproduce the simplest examples (e.g.
vadd
) so I came back to https://github.com/Xilinx/Vitis-Tutorials/blob/master/Getting_Started/Vitis/ (that's how I bumpd into #69 and #70). As of now, I'm unable to reproducevadd
simple Getting Started Vitis tutorial. Kernel's result makes no sense to me so I though I'd share with those of you much more experienced:I reproduced my setup a few times (which took me a few hours) to ensure I wasn't just distracted. Has anyone bumped into something similar? As of my last tests, I tried modifying the kernel's simple source code for returning a fixed constant or other sums but I'm still getting the same result, 0.
My setup:
setup XRT
```bash cd /home/erle/Desktop/Xilinx; git clone https://github.com/Xilinx/XRT cd XRT; sudo src/runtime_src/tools/scripts/xrtdeps.sh # install dependencies source /tools/Xilinx/Vitis/2020.2/settings64.sh # necessary for ERT export PATH="/usr/bin":$PATH # FIXME: adjust path for CMake 3.5+ cd build; ./build.sh cd Release; sudo apt-get install ./xrt_*-amd64-xrt.deb ```Fetch Vitis-Tutorials
```bash cd ~; git clone https://github.com/Xilinx/Vitis-Tutorials ```set environment
Requires to first fetch rootfs and sysroots from [here](https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/embedded-platforms.html), while putting it into a coherent folder-structure. Then: ```bash cd ~/Vitis-Tutorials/Getting_Started/Vitis/example/zcu102/hw/ source /tools/Xilinx/Vitis/2020.2/settings64.sh source /opt/xilinx/xrt/setup.sh unset LD_LIBRARY_PATH export PLATFORM_REPO_PATHS="/home/erle/Desktop/Xilinx/xilinx_zcu102_base_202020_1" export ROOTFS=/home/erle/Desktop/Xilinx/rootfs source /home/erle/Desktop/Xilinx/rootfs/ir/environment-setup-aarch64-xilinx-linux ```build the example
```bash ${CXX} -Wall -g -std=c++11 ../../src/host.cpp -o app.exe -I/usr/include/xrt -lOpenCL -lpthread -lrt -lstdc++ v++ -c -t hw --config ../../src/zcu102.cfg -k vadd -I../../src ../../src/vadd.cpp -o vadd.xo v++ -l -t hw --config ../../src/zcu102.cfg ./vadd.xo -o vadd.xclbin v++ -p -t hw --config ../../src/zcu102.cfg ./vadd.xclbin --package.out_dir package --package.rootfs ${ROOTFS}/rootfs.ext4 --package.sd_file ${ROOTFS}/Image --package.sd_file xrt.ini --package.sd_file app.exe --package.sd_file vadd.xclbin --package.sd_file run_app.sh ```