01-08-2020 12:16 PM - edited 01-08-2020 12:24 PM
I'm on Day 2 of simply trying to get a "Hello World" Linux app running on a zcu104 via the Vitis platform.. I can't believe how hard Xilinx makes this and how little information is available.. The only real step by step instructions I was able to find are 3rd party: https://beetlebox.org/getting-started-with-computer-vision-for-vitis-embedded-systems/
Is there a better non-bare-metal version of "hello world" for the 104 board available using Vitis? If not - how upsetting..
I have setup Ubuntu 2018.4 with all required toolchains and pre-requisites.
Installed Vivado / Vitis 2019 (or whatever the latest matching set is)
Installed and built PetaLinux SDK (latest version)
Installed XRT (./xrt_2019126.96.36.1991_18.04-xrt.deb) and also cloned XRT (for the scripts)
Generated the XRT file for the 104 board successfully (I think.. some warning of "Can't load /var/lib/shim-signed/mok/.rnd into RNG" but .XRT was generated)
Failed to generate the boot loader image.. via ~/XRT/src/runtime_src/tools/scripts/peta_build.sh ~/Petabuilds/xsa_build/zcu104_revmin/zcu104_revmin.xsa
cp: cannot create regular file '/home/andrew/zcu104_revmin/components/plnx_workspace/device-tree/device-tree/pl.dtsi': No such file or directory
cp: cannot create regular file '/home/andrew/zcu104_revmin/components/plnx_workspace/device-tree/device-tree/device-tree.mss': No such file or directory * Performing PetaLinux Build (from: /home/andrew/zcu104_revmin/project-spec/meta-user)
NOTE: xrt: compiling from external source tree /home/andrew/XRT/src
ERROR: xrt-2.2.0+git999-r0 do_compile: Function failed: do_compile (log file is located at /home/andrew/zcu104_revmin/build/tmp/work/aarch64-xilinx-linux/xrt/2.2.0+git999-r0/temp/log.do_compile.19320)
ERROR: Logfile of failure stored in: /home/andrew/zcu104_revmin/build/tmp/work/aarch64-xilinx-linux/xrt/2.2.0+git999-r0/temp/log.do_compile.19320
| FAILED: runtime_src/core/edge/hw_em/CMakeFiles/hw_emu_objects.dir/shim_hwem.cpp.o
| /home/andrew/XRT/src/runtime_src/core/edge/hw_em/shim_hwem.cpp:24:10: fatal error: shim-profile.h: No such file or directory
| #include "shim-profile.h"
| compilation terminated.
Wonderful... and not one of these errors triggers anything useful in google search..
The part I really don't get it that VITIS is supposed to avoid this crap.. but Xilinx does not even support the 104 board natively as part of a regular install.. so off to hunt you go to figure out how to create the needed files without any real or obvious documentation.. ugh..
01-08-2020 12:37 PM
Imagine with custom boards.... that's something shady of Xilinx. If they don't allow users to develop with custom hardware, that in most cases is what is used, they may face an exodus as soon as someone else has a truly flexible tool. Remember how Nokia didn't react to the shift to smartphones. RIP. The World is cruel.
01-08-2020 12:47 PM
This is unclear to me.. It seems you can define the board in Vivado.. and export via XSA.. and make it work in Vitis.. but hell.. I can't even get Vitis working with the 104.. at least in Vivado it was part of the included boards..
Funny.. just watchin a Vitis video tutorial.. and the guy was like "We are going to do a bare metal demo since I did not get Linux working..."
01-09-2020 09:06 AM
You define the board in Vivado, easy
You export the XSA, a few clicks
Then the hidden stuff: you have to tweak the kernel and device tree
After that, it all works fine
01-09-2020 11:55 AM
In any case.. digging in further the issue seems to be that
shim-profile.h had been deleted from the XRT repository.. and I guess I'm the only one using Vitis??? I filed an error report in Git.
It must be me however.. since i can't image the entire tool-chain being just broken.. right?
01-13-2020 05:40 AM
What is the use case you are tring to use here? If you are trying to accelerate the SW functions into HW, then you need the a platform with the XRT enabled.
For custom boards, you would start in Vivado and create your HW base design, you would then use the PFM properties to highlight to the Vitis downstream tools what interfaces, clocks, interrupts are available to use to include the accelerated IP into your existng base HW platform.
The XRT is needed for the dataflow to and from your accelerated IP. The XRT can be built in petalinux, the recipes can be seen here
However, if you just want to develop and debug linux applications then you dont the XRT. You would develop the linux image in Petalinux, and create the sysroots (see above) here to be used in Vitis.
01-15-2020 08:05 AM
I am the author of that tutorial. Just to say I started getting this bug myself and have updated the tutorial to fix it. Xilinix updated the XRT repo which caused this bug but if you switch to the 2019.2 branch the bug no longer occurs. Just go through the tutorial again now I have updated it and it should work.
01-17-2020 01:55 PM
Thanks! I think I wrote to you but did not notice you posted here...
.. I did get it running in the meantime.. BUT.. the application does not show up.. there is nothing in /mnt. How do I get that working. I see others with the problem but no solution that makes sense.. (at least to me)
01-19-2020 03:08 AM
When you ran the the peta_build.sh script did you ensure that you used the --bsp option?
Also the application is no longer placed in /mnt, but in /run/media/
Search for it using:
find . --name <app_name>.exe
12-08-2020 03:24 AM
I agree with you, in Linux, it's very difficult to figure out how to do anything at all using Vitis. I don't know if you are still struggling. However, if you can get as far as a Petalinux build, then I found this tutorial useful for getting to the "hello world" stage. You will need tcf running on your target to run it I think.
12-08-2020 03:29 AM
I created a blog a while back on the flow for creating a custom platform for the Vitis Accel flow:
I used a ZCU104 board in the demo
12-08-2020 03:54 AM
No I don't have a dev board; I'm actually using this board https://www.knowres.com/product/krm-3z7030-xhab/?portfolioCats=109%2C138%2C148%2C108%2C147 with this carrier https://www.knowres.com/product/krc3701_ck_vivado_sdsoc/ as effectively an educational platform. So it's slow going figuring everything out. But I kind of wonder, if you learn on a dev board with pre-built platforms, how much more difficult does it then become when you are trying to repeat the same things on custom hardware?
12-08-2020 04:03 AM
The Vitis will not build the Linux image for you. you need to do this in Petalinux/Yocto first. So, I would step back, and make sure you can boot Linux on your this board first. Once you can boot Linux, you can then create the other SW components and HW components for the Vitis Accel.
12-08-2020 04:10 AM
Thank you. No, I'm quite a bit past that stage actually. I have Linux running with an Ubuntu root file system (so that I can use apt-get) and I compiled the tcf agent by cloning it from https://github.com/eclipse/tcf.agent.git (I think I could maybe have done that in Petalinux if I'd kept the default rfs). I have hello word running in Vitis and I'm now working on how to get software in Linux interacting with the hardware. It seems to be much more difficult than doing it in bare metal code. But end result should be a much more capable system.
12-08-2020 04:34 AM
if you want to debug a Linux application in Vitis:
If you want to debug Linux kenrel in Vitis:
12-08-2020 04:37 AM
Vitis was designed to allow Linux to easily interface with hardware through OpenCL kernels, so I would recommend using that rather than doing it the 'old school' style of developing Linux Kernels. Using custom hardware is always going to be more difficult than using pre-built solutions because there needs to be a far greater amount of flexibility because nobody knows how many ports, interfaces, AI engines, etc you need. With that flexibility comes complexity, but that has always been the traditional tradeoff with FPGAs. The great thing about Vitis though is that building the hardware to get hardware acceleration is pretty much a standard procedure that can be repeated on any hardware board.
Also for quick development Ubuntu is great, but it is a heavy OS and for many production applications it isn't really viable, so even using Ubuntu over standard Linux has its tradeoffs.
12-08-2020 04:56 AM
The problem with teaching yourself (most of my experience is in ASIC & FPGA design, but I'm adding the Linux side of things in my spare time to be more all-round capable) is that these sorts of insights are very difficult to acquire without being directly involved with more experienced colleagues. So, for example, I don't understand what you mean by choosing OpenCL over developing kernels. I also don't really understand what you mean by hardware acceleration. Do you mean the process of profiling software and then mapping the heavy processing onto hardware. Or do you mean the process of designing a system and then adding software to control it (which I guess is what I'm trying to do)? Or do you mean both?
As for Ubuntu, that's a useful insight. Although it isn't obvious to me yet how I can tell that it's heavy. Where should I look to see that?
Sorry for all the questions. Maybe there is a book that addresses such questions?
12-08-2020 04:58 AM
...because I only want to learn one root through this mire. And that would be the easiest one. But google throws up so much that it's extremely difficult to differentiate between what's relevant and what can be ignored.
12-08-2020 05:03 AM