Updated: Jan 28
The ability to work with OpenCL at higher levels of abstraction is increasingly important for FPGA developers. We can use OpenCL to develop applications for heterogeneous SoCs and acceleration cards, and to create HLS IP blocks.
I wanted to write a few blogs on OpenCL to highlight its increasing importance further. For this blog, I thought featuring an Alveo U50 acceleration card would allow me to focus on OpenCL in addition to the resulting acceleration.
Of course, first we must get the U50 up and running and installed in my Linux desktop. Once the board is physically connected, the first thing to do is boot the system and log into Linux.
After the system has booted, the first step is to make sure the Alveo card can be initially seen over the PCIe bus. We can verify this by opening a terminal window and running the following command.
sudo lspci -vd 10ee:
This will list the devices on the PCIe bus (-v makes for a verbose output while the -d lists only devices with the specific vendor code of 10ee.) Note that this is the Xilinx PCIe vendor code.
There are a few more steps to take before we are able to use the Alveo card.
The installation process takes place using a standard Linux package flow. The approach we take depends upon the Linux distribution we are using, the Alveo card being installed, and the version of tools we wish to use.
My Linux system uses Ubuntu version 18.04 and my Vitis installation is the latest 2020.2 version of the Xilinx tool chain.
Download the following to install the Alveo card:
Xilinx Run Time (XRT) for Vitis 2020.2
U50 deployment target platform
U50 development target platform
In addition, install the Vitis tool chain if it’s not already installed.
All of these packages can be downloaded from the U50 Getting Started page. Once downloaded, they can be installed using the apt package manager.
If you have a previous version of the XRT installed, this will be removed as part of the installation process.
Once the XRT and the deployable target platform are installed, the next step is to update the firmware on the U50 itself. The command for doing this will be presented once the deployable target platform has been installed as highlighted below.
Running this command will flash the U50 card so make sure the process is not cancelled or the power removed because it might impact the card’s functionality.
Once the U50 has been updated, the next step is to reboot the card and to install the development target platform. It is this platform that is used by Vitis to create the solution specifically for the U50 solution.
You can check that the installation has been successful by running the lspci command again. We will see a different result now showing two elements.
We can also run the validation test that was installed in the process. This will test the interconnect and make any suggestions necessary for optimization.
We are now ready to create our first example and test it using Vitis. Open Vitis and create a new U50 workspace which can be used for the creation of U50 applications.
Once Vitis opens from the Xilinx menu on the welcome page, select libraries and then examples. Download both to the development machine. This will provide us with more examples to test the U50 with than the standard Vitis installation.
Downloading the libraries and examples might take a few minutes.
Once these are downloaded, create a new application project that targets the U50 acceleration card.
For this example, I selected the L3 Black Scholes Model (see more about Vitis library levels here).
Once the project is created, change the Active Build Configuration from Emulation-SW to Hardware and build the project by clicking on the hammer. This might take a little while.
Once the application has been built, we will have an executable for the Host and U50. This will be available under the project device structure.
Using a terminal, we can run the application which uses both the Host x86 and the U50
Running this application demonstrates that we have the U50 installed correctly and have all the Vitis libraries, etc. needed to get started creating example applications.