The SDAccel™ flow for AWS F1 supports the following development models:
- Cloud-based development on AWS EC2 cloud instances
- On-premise development on your own local workstations
In both cases, the final binaries are deployed on an AWS F1 instance.
This guide provides step-by-step instructions for getting started with the on-premise flow and covers the following:
- Installing and licensing SDAccel in your own environment
- Building your application on-premise with SDAccel
- Uploading and executing your application on F1
Before going through the steps described in this document, you should complete the tutorial on how to Create, Configure, and Test an AWS F1 instance. It is important that you are familiar with the cloud-based development environment before setting up SDAccel in your own environment.
The supported operating systems for SDaccel on-premise development are:
- Ubuntu 16.04.5 LTS, 18.04.1 LTS
- CentOS 7.4, 7.5, 7.6
- RHEL 7.4, 7.5, 7.6
Visit this page for a complete description of other system requirements.
In order to develop any SDAccel application on-premise, you must install the same version of SDAccel as deployed on AWS F1. Refer to this page for tool version and download instructions: enabling development on premises
If you are a new user, you will also need to obtain an on-premise license of Vivado®. You can request both node-locked and floating licenses here (links are on the right side of the page).
- To install the tool, refer to the instructions in the SDAccel Environment Release Notes, Installation, and Licensing Guide (UG1238).
The AWS GitHub repository contains all the necessary platform definition files and setup scripts to run SDAccel and build a design for F1 instances. It also contains numerous examples that will help you learn more about SDAccel.
Execute the following commands on your local machine to clone the GitHub repository and configure the SDAccel environment:
cd $HOME
git clone https://github.com/aws/aws-fpga.git
cd aws-fpga
source sdaccel_setup.sh
IMPORTANT: Sourcing sdaccel_setup.sh may show some errors as it also tries to install runtime drivers which requires sudo access. These errors are non-intrusive, and they can be ignored.
These steps will show you how to:
- Confirm that you can run SDAccel on your local machine.
- Generate binaries which you can then deploy on the F1 instance.
When using GitHub examples, you can execute same sets of commands that you have used on an AWS EC2 instance.
TO invoke the SDAccel GUI, enter the following command:
sdx
After you confirm that the GUI has opened successfully, close the GUI.
Execute the following commands to run the SW Emulation step for the SDAccel helloworld
example:
cd $HOME/aws-fpga/SDAccel/examples/xilinx_2019.1/getting_started/host/helloworld_c/
make clean
make check TARGETS=sw_emu DEVICES=$AWS_PLATFORM all
Execute the following commands to run the HW Emulation step for the SDAccel helloworld
example:
cd $HOME/aws-fpga/SDAccel/examples/xilinx_2019.1/getting_started/host/helloworld_c/
make clean
make check TARGETS=hw_emu DEVICES=$AWS_PLATFORM all
- Execute the following commands to build the FPGA binary for the SDAccel
helloworld
example:
cd $HOME/aws-fpga/SDAccel/examples/xilinx_2019.1/getting_started/host/helloworld_c/
make clean
make TARGETS=hw DEVICES=$AWS_PLATFORM all
The build process will generate the host and FPGA binaries.
- Host binary:
./helloworld
- FPGA binary:
./xclbin/vector_addition.hw.xilinx_aws-vu9p-f1_4ddr-xpr-2pr_4_0.xclbin
Create an Amazon FPGA Image (AFI) from the .xclbin
file with the create_sdaccel_afi.sh
script by using either of the following methods:
- Create an image locally, after installing the AWS CLI on your machine, or by
- Upload the
.xclbin
to an AWS instance, and run thecreate_sdaccel_afi.sh script
there.
In this tutorial, you will upload everything to an AWS EC2 instance.
This section covers the following steps:
- Upload your FPGA binary (built on-premise) to the AWS cloud
- Create an AFI from the
.xclbin
file - Compile the host program on the F1 instance
- Execute your accelerated application on the F1 instance
- Create a tarball with the necessary files:
tar cvfz helloworld.tgz Makefile src xclbin/vector_addition.hw.xilinx_aws-vu9p-f1_4ddr-xpr-2pr_4_0.xclbin
- Start an AWS F1 instance
- Upload the tarball to your AWS F1 instance
scp -i ~/<AWS key pairs>.pem <xclbin file> centos@<public IP address of EC2 instance>:/home/centos/.
NOTE: Alternatively, you can transfer files using an AWS S3 bucket.
- Ssh to your AWS F1 instance.
ssh -i <AWS key pairs.pem> -ssh centos@<public IP address of EC2 instance> 22
- Extract your tarball.
mkdir helloworld
cd helloworld
tar xvfz ../helloworld.tgz
- Setup the SDAccel environment.
cd $AWS_FPGA_REPO_DIR
source sdaccel_setup.sh
- Create the AWS FPGA binary and AFI from the
.xclbin
file.
cd $HOME/helloworld/xclbin
$SDACCEL_DIR/tools/create_sdaccel_afi.sh \
-xclbin=<xclbin file name>.xclbin \
-s3_bucket=<bucket-name> \
-s3_dcp_key=<dcp-folder-name> \
-s3_logs_key=<logs-folder-name>
Use the Makefile to compile the host application.
cd $HOME/helloworld
make exe
This will create the helloworld
program.
- After the AFI status changes to available, you are ready to execute on F1:
sudo sh
source /opt/xilinx/xrt/setup.sh
./helloworld
This module explained how you can develop your FPGA binary on-premise, create an AFI, and execute your accelerated application on an AWS F1 instance.
Return to the 5-steps getting started guide
Copyright© 2019 Xilinx