cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
tschesnok
Observer
Observer
2,689 Views
Registered: ‎07-23-2019

How are we supposed to get Vitis working on Xilinx own boards??? This seems incredibly hard without simple step by step instructions..

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_201920.2.3.1301_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

Errors/Warnings:

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..

20 Replies
satguy
Explorer
Explorer
2,673 Views
Registered: ‎04-19-2018

 

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.

0 Kudos
tschesnok
Observer
Observer
2,668 Views
Registered: ‎07-23-2019

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..."

satguy
Explorer
Explorer
2,575 Views
Registered: ‎04-19-2018

 

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

0 Kudos
tschesnok
Observer
Observer
2,552 Views
Registered: ‎07-23-2019

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?

0 Kudos
stephenm
Xilinx Employee
Xilinx Employee
2,462 Views
Registered: ‎09-12-2007

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

  • petalinux-create -t project --template zynqMP -n linux_image
  • cd linux_image
  • petalinux-config --get-hw-description=<path to xsa>
  • copy the recipes to project-spec/meta-user
  • petalinux-config -c rootfs, and add the apps
  • Open the system-user.dtsi and add the zyclmm_drm node
  • petalinux-build
  • mkdir -p sysroot
  • cd images/linux
  • petalinux-package --sysroot -s <path to sysroot>
  • petalinux-package --boot --fpga system.bit --u-boot

 

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.

0 Kudos
aswirski
Visitor
Visitor
2,419 Views
Registered: ‎05-20-2019

Hi tschesnok,

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.

Regards,

Andrew

0 Kudos
tschesnok
Observer
Observer
2,364 Views
Registered: ‎07-23-2019

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)

0 Kudos
aswirski
Visitor
Visitor
2,325 Views
Registered: ‎05-20-2019

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
0 Kudos
ian@lang
Contributor
Contributor
1,463 Views
Registered: ‎01-11-2019

Hi tschesnok,

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.

Ian Lang

0 Kudos
stephenm
Xilinx Employee
Xilinx Employee
1,461 Views
Registered: ‎09-12-2007

I created a blog a while back on the flow for creating a custom platform for the Vitis Accel flow:

https://forums.xilinx.com/t5/Design-and-Debug-Techniques-Blog/Creating-an-Acceleration-Platform-for-Vitis-Part-One-Creating/ba-p/1138208

 

I used a ZCU104 board in the demo

ian@lang
Contributor
Contributor
1,449 Views
Registered: ‎01-11-2019

Wow, I'll work through that myself.  Thank you Stephen

0 Kudos
stephenm
Xilinx Employee
Xilinx Employee
1,444 Views
Registered: ‎09-12-2007

Just to clarify, the blog is how to create a custom platform. 

 

If you have a Xilinx dev board, there are prebuilt platforms in Vitis

0 Kudos
ian@lang
Contributor
Contributor
1,427 Views
Registered: ‎01-11-2019

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?

0 Kudos
stephenm
Xilinx Employee
Xilinx Employee
1,420 Views
Registered: ‎09-12-2007

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.

 

0 Kudos
ian@lang
Contributor
Contributor
1,418 Views
Registered: ‎01-11-2019

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.

0 Kudos
aswirski
Visitor
Visitor
1,374 Views
Registered: ‎05-20-2019

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.

 

 

ian@lang
Contributor
Contributor
1,359 Views
Registered: ‎01-11-2019

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?

0 Kudos
ian@lang
Contributor
Contributor
1,354 Views
Registered: ‎01-11-2019

...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.

0 Kudos
stephenm
Xilinx Employee
Xilinx Employee
1,343 Views
Registered: ‎09-12-2007

This thread took a tangent a little. The OP was on the accel. ian@lang wants is a Embedded Linux flow, and not an Embedded Acceleration flow. 

0 Kudos