|
1 | 1 | # Prerequisite -- Environment Setup for Using Intel FPGA Acceleration Card |
2 | 2 |
|
3 | | -## Intel Acceleration Stack |
| 3 | +Intel provides detailed information about [Intel(R) oneAPI Toolkits](https://www.intel.com/content/www/us/en/developer/tools/oneapi/toolkits.html#gs.4ip3tr) on its website, users can find information about how to download, install and use the Intel(R) oneAPI toolkits. The oneAPI version used in the hexl-fpga project is Intel® oneAPI Base Toolkit (version 2022.2.0). <br> |
4 | 4 |
|
5 | | -There are two types of Intel Acceleration Stack (version 2.0.1), namely, the [Acceleration Stack for Runtime](https://www.intel.com/content/www/us/en/programmable/f/download/accelerator/license-agreement-pac-d5005.html?swcode=WWW-SWD-IAS-RTE-201) and the [Acceleration Stack for Development](https://www.intel.com/content/altera-www/global/en_us/index/f/download/accelerator/pac-d5005-thank-you.html?swcode=WWW-SWD-IAS-DEV-201). The runtime stack provides a smaller footprint package for software development of runtime host application. It includes Intel FPGA Runtime Environment (RTE) for OpenCL but does not include Intel Quartus Prime; thus, it assumes that the FPGA bitstreams are available. The development stack allows for accelerator function development using the Intel Quartus Prime Pro Edition software (required and included). Additionally, it comes with the Intel FPGA Software Development Kit (SDK) for OpenCL and the Acceleration Stack. <br> |
| 5 | +## Intel(R) oneAPI base toolkit installation |
6 | 6 |
|
7 | | -The Intel Acceleration Stack for development (`d5005_pac_ias_2_0_1_pv_dev_installer.tar.gz`) is encouraged and required to reap the full benefits of Intel HE Acceleration Library for FPGAs, especially before attempting to build the FPGA kernels and if intended usage of Intel HE Acceleration Library for FPGAs includes development contributions. Download, read more detailed installation instructions, updates and related additional resources at [Intel Acceleration Stack link](https://www.intel.com/content/www/us/en/programmable/products/boards_and_kits/dev-kits/altera/intel-fpga-pac-d5005/getting-started.html). <br> |
| 7 | +Following the [Intel(R) oneAPI toolkits installation guide for Linux* OS](https://www.intel.com/content/www/us/en/develop/documentation/installation-guide-for-intel-oneapi-toolkits-linux/top.html) to download and install the Intel(R) oneAPI base basekit. <br> |
8 | 8 |
|
9 | | -Note: Even though the validated operating system is RHEL 7.6, we used CentOS 7.9 without issues.<br> |
| 9 | +## Set up a system for FPGA with the Intel(R) PAC |
10 | 10 |
|
11 | | -## Intel Quartus Prime Pro Edition |
| 11 | +To use Intel(R) PAC FPGA with Intel(R) oneAPI, you also need to install [Intel(R) FPGA add-on package](https://www.intel.com/content/www/us/en/develop/documentation/installation-guide-for-intel-oneapi-toolkits-linux/top/installation/set-up-a-system-for-fpga-with-the-intel-pac/install-fpga-add-on-for-oneapi-base-toolkit.html) and [Intel(R) PAC software stack](https://www.intel.com/content/www/us/en/develop/documentation/installation-guide-for-intel-oneapi-toolkits-linux/top/installation/set-up-a-system-for-fpga-with-the-intel-pac/install-intel-pac-software-stack.html). |
12 | 12 |
|
13 | | -Quartus Prime version 19.2 is installed in the Acceleration Stack installation. For Intel HE Acceleration Library for FPGAs, the installation of Quartus Prime version 20.3 is required. [Download the complete version ](https://fpgasoftware.intel.com/20.3/?edition=pro) and follow the instructions below. <br> |
14 | | - |
15 | | -``` |
16 | | -tar xvf Quartus-pro-20.3.0.158-linux-complete.tar |
17 | | -./setup_pro.sh |
18 | | -``` |
19 | | - |
20 | | -Use the following configuration:<br> |
21 | | - |
22 | | -``` |
23 | | -Select the components you want to install: |
24 | | -
|
25 | | -Quartus Prime Pro Edition [Y/n]: Y |
26 | | -
|
27 | | -ModelSim -- Intel FPGA Starter Edition (Free) (17169.4MB) [Y/n]: n |
28 | | -
|
29 | | -ModelSim -- Intel FPGA Edition (Free) (17169.4MB) [Y/n]: n |
30 | | -
|
31 | | -Intel High Level Synthesis Compiler (2481.9MB) [Y/n]: Y |
32 | | -
|
33 | | -DSP Builder Pro Edition (185.8MB) [Y/n]: n |
34 | | -
|
35 | | -Intel FPGA SDK for OpenCL Pro Edition (1822.6MB) [Y/n]: Y |
36 | | -``` |
37 | | - |
38 | | -Note that the installation of Intel HLS compiler is required to compile the smaller IP modules that support the larger kernels with modular addition and modular multiplication arithmetic.<br> |
39 | | - |
40 | | -## Intel OneAPI |
41 | | - |
42 | | -Install the oneAPI Toolkit from the following site: <br> |
43 | | - |
44 | | -[Installation Guide for Intel OneAPI Toolkits](https://software.intel.com/content/www/us/en/develop/articles/installation-guide-for-intel-oneapi-toolkits.html).<br> |
45 | | - |
46 | | -More information on the FPGA related components can be found on this [here](https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/fpga.html#gs.6nbq2b). <br> |
47 | | - |
48 | | -Instructions on direct installation via yum located at [https://software.intel.com/content/www/us/en/develop/documentation/installation-guide-for-intel-oneapi-toolkits-linux/top/installation/install-using-package-managers/yum-dnf-zypper.html](https://software.intel.com/content/www/us/en/develop/documentation/installation-guide-for-intel-oneapi-toolkits-linux/top/installation/install-using-package-managers/yum-dnf-zypper.html). <br> |
49 | | - |
50 | | -``` |
51 | | -sudo yum install intel-basekit |
52 | | -sudo yum install intel-oneapi-intelfpgadpcpp-custom-platforms-quartus20.3 |
53 | | -``` |
54 | 13 |
|
55 | 14 | ## Initializing the FPGA Environment |
56 | 15 |
|
57 | | -Upon completion of the installation of the FPGA software stack, the next step is to initialize the environment for FPGA runtime and development. We provide below an example script that automates this process, in particular for the combination of software versions installed. <br> |
| 16 | +Upon completion of the installation of the FPGA software stack, the next step is to initialize the environment for FPGA runtime and development. Use the below command to initialize the environment whenever you want to use the oneAPI. <br> |
58 | 17 |
|
59 | 18 | ``` |
60 | | -# init_env.sh |
61 | | -
|
62 | | -export QUARTUS_HOME="/disk1/tools/intelFPGA_pro/19.2/quartus" |
63 | | -export OPAE_PLATFORM_ROOT="/disk1/tools/inteldevstack/d5005_ias_2_0_1_b237" |
64 | | -
|
65 | | -export AOCL_BOARD_PACKAGE_ROOT="/disk1/tools/inteldevstack/d5005_ias_2_0_1_b237/opencl/opencl_bsp" |
66 | | -if ls /dev/intel-fpga-* 1> /dev/null 2>&1; then |
67 | | -source $AOCL_BOARD_PACKAGE_ROOT/linux64/libexec/setup_permissions.sh >> /dev/null |
68 | | -fi |
69 | | -
|
70 | | -OPAE_PLATFORM_BIN="/disk1/tools/inteldevstack/d5005_ias_2_0_1_b237/bin" |
71 | | -if [[ ":${PATH}:" = *":${OPAE_PLATFORM_BIN}:"* ]] ;then |
72 | | - echo "\$OPAE_PLATFORM_ROOT/bin is in PATH already" |
73 | | -else |
74 | | - echo "Adding \$OPAE_PLATFORM_ROOT/bin to PATH" |
75 | | - export PATH="${PATH}":"${OPAE_PLATFORM_BIN}" |
76 | | -fi |
77 | | -
|
78 | | -echo export AOCL_BOARD_PACKAGE_ROOT="/opt/intel/oneapi/intelfpgadpcpp/latest/board/intel_s10sx_pac" |
79 | | -export AOCL_BOARD_PACKAGE_ROOT="/opt/intel/oneapi/intelfpgadpcpp/latest/board/intel_s10sx_pac" |
80 | | -if ls /dev/intel-fpga-* 1> /dev/null 2>&1; then |
81 | | - echo source $AOCL_BOARD_PACKAGE_ROOT/linux64/libexec/setup_permissions.sh |
82 | | - source $AOCL_BOARD_PACKAGE_ROOT/linux64/libexec/setup_permissions.sh >> /dev/null |
83 | | -fi |
84 | | -
|
85 | | -echo export INTELFPGAOCLSDKROOT="/disk1/tools/intelFPGA_pro/20.3/hld" |
86 | | -export INTELFPGAOCLSDKROOT="/disk1/tools/intelFPGA_pro/20.3/hld" |
87 | | -
|
88 | | -# Enable Backwards Compatibility with older BSP |
89 | | -export ACL_ACDS_VERSION_OVERRIDE="19.2" |
90 | | -export QUARTUS_ROOTDIR_OVERRIDE="/disk1/tools/intelFPGA_pro/quartus_19.2.0b57/quartus" |
91 | | -
|
92 | | -echo export ALTERAOCLSDKROOT=$INTELFPGAOCLSDKROOT |
93 | | -export ALTERAOCLSDKROOT=$INTELFPGAOCLSDKROOT |
94 | | -export PAC_DMA_WORK_THREAD=yes |
95 | | -
|
96 | | -QUARTUS_BIN="/disk1/tools/intelFPGA_pro/20.3/quartus/bin" |
97 | | -if [[ ":${PATH}:" = *":${QUARTUS_BIN}:"* ]] ;then |
98 | | - echo "\$QUARTUS_HOME/bin is in PATH already" |
99 | | -else |
100 | | - echo "Adding \$QUARTUS_HOME/bin to PATH" |
101 | | - export PATH="${QUARTUS_BIN}":"${PATH}" |
102 | | -fi |
103 | | -
|
104 | | -export AOCL_BOARD_PACKAGE_ROOT=/opt/intel/oneapi/intelfpgadpcpp/latest/board/intel_s10sx_pac |
105 | | -source $INTELFPGAOCLSDKROOT/init_opencl.sh >> /dev/null |
106 | | -
|
107 | | -aocl initialize acl0 pac_s10_usm |
| 19 | +source /opt/intel/oneapi/setvars.sh |
108 | 20 | ``` |
109 | 21 |
|
110 | | -The script above needs to be modified to reflect the real paths where the installation have been placed. This initialization process requires sudo (administrator) privileges. The OneAPI `AOCL_BOARD_PACKAGE_ROOT` variable value may differ from the example, depending from the source package, which could be `AOCL_BOARD_PACKAGE_ROOT="/opt/intel/oneapi/compiler/2021.3.0/linux/lib/oclfpga/board/intel_s10sx_pac`. Try `locate intel_s10sx_pac` to find out the actual path. |
| 22 | +## Build and run sample code to test your setup |
111 | 23 |
|
112 | | -### Fix Permissions on /dev Files |
113 | | - |
114 | | -The PAC D5005 requires sudo access with default permissions. This needs to be modified at least once during installation. The unmodified version of `init_env.sh` performs this step every time it is called, but that requires all users to have sudo access to source `init_env.sh`. Instead, run the permission setting script on its own after modifying `init_env.sh`. |
115 | | - |
116 | | -``` |
117 | | -$ source $AOCL_BOARD_PACKAGE_ROOT/linux64/libexec/setup_permissions.sh |
118 | | -Configuring locked memory setting |
119 | | -Configuring udev rules for intel-fpga device permission |
120 | | -Configuring system with 2048 2M hugepages |
121 | | -Finished setup_permissions.sh script. All configuration settings are persistent. |
122 | | -``` |
| 24 | +After you finish the installation, you can build and run a sample code to test your environment. You can find [Intel(R) oneAPI sample code](https://github.com/oneapi-src/oneAPI-samples) in this Github repo. [Every sample project](https://github.com/oneapi-src/oneAPI-samples/tree/master/DirectProgramming/DPC%2B%2BFPGA) has detailed steps to guide you build and run the code on Intel(R) FPGA. |
0 commit comments