Intel FPGA RTE for OpenCL Pro Edition: Getting Started Guide
Version Information
Updated for: |
---|
Intel® Quartus® Prime Design Suite 20.4 |
1. Intel FPGA RTE for OpenCL Pro Edition Getting Started Guide
The RTE is a subset of the Intel® FPGA Software Development Kit (SDK) for OpenCL Pro Edition1 . Unlike the SDK, which provides an environment that enables the development and deployment of OpenCL kernel programs, the RTE provides tools and runtime components that enable you to build and execute a host program, and execute precompiled OpenCL kernel programs on target accelerator boards.
OpenCL is a C-based open standard for the programming of heterogeneous parallel devices. For more information about the OpenCL Specification version 1.0, refer to the OpenCL Reference Pages. For detailed information on the OpenCL application programming interface (API) and programming language, refer to the OpenCL Specification version 1.0.
If you require OpenCL™ kernel development and deployment functionalities, download the Intel® FPGA SDK for OpenCL Pro Edition. Refer to the Intel FPGA SDK for OpenCL Pro Edition Getting Started Guide for more information.
Do not install the RTE and the SDK on the same host system.
1.1. Prerequisites for the Intel FPGA RTE for OpenCL Pro Edition
Hardware Requirements
Accelerator boards requirements:
- Acquire a Reference Platform from
Intel®
, or a Custom Platform from an
Intel®
preferred board vendor.
For more information, refer to the Intel FPGA SDK for OpenCL FPGA Platforms page on the Intel® FPGA website.
Deployment system requirements:
- You must have administrator privileges on the development system to install the necessary packages and drivers.
- The deployment system has at least 70 megabytes (MB) of free disk space for software installation.
- For
RAM requirements on
the
deployment
system,
refer to the Download Center for
FPGAs.
Tip: Refer to board vendor's documentation on the recommended system storage size.
The host system must be running one of the following supported operating systems:
- For a list of supported Windows and Linux operating systems, refer to the Operating System Support page on the Intel® FPGA website.
- Linux versions as supported on
Intel®
SoC FPGA products
on the
Arm*
ARMv7-A architecture.Important:
For x86_64 Linux systems, install the Linux OS kernel source and headers (for example, kernel-devel.x86_64 and kernel-headers.x86_64), and the GNU Compiler Collection (GCC) (gcc.x86_64).
To install the Linux kernel source or header package, invoke the yum install <kernel_package_name> command.
You must have administrator privileges on the host system to install the necessary packages and drivers.
Software Prerequisites
Develop your host application using one of the following RTE-compatible C compiler or software development environment:
- For Windows systems, use Microsoft Visual Studio Professional and Microsoft Visual C++ versions 2015 or later.
- For Linux systems, use Eclipse 2019-12 or later and GCC 7.2.0. For more information about GCC, refer to GCC Requirement.
- For SoC applications, use the GCC cross-compiler available with the Intel® SoC FPGA Embedded Development Suite (EDS).
Linux systems require the Perl command version 5 or later. Include the path to the Perl command in your PATH system environment variable setting.
For Intel® FPGA RTE for OpenCL™ packages that include Intel Code Builder, Intel Code Builder requires Java SE version 1.8.71 or later to run.
1.1.1. GCC Requirement
If you do not have a sufficiently new GCC and libstdc++.so.6 library installed, you may encounter issues when trying to run OpenCL host programs that target the Intel® FPGA Emulation Platform for OpenCL™ software. If the correct version of libstdc++.so library is not found at run time, the call to clGetPlatformIDs function fails to load the emulation platform and returns CL_PLATFORM_NOT_FOUND_KHR (error code -1001). Depending on the version of libstdc++.so library found, the call to clGetPlatformIDs function may succeed, but a later call to the clCreateContext function might fail with CL_DEVICE_NOT_AVAILABLE (error code -2).
To verify the GCC version you are using, run the following command:
$ gcc -dumpversion
Ensure that the command reports version 7.2.0 or greater. If you do not have a sufficiently recent GCC, use the following instructions to install a newer GCC on your system.
Installing GCC 7
The process for installing the required GCC differs depending on the host operating system as described in the following sections.
If your Ubuntu version does not include GCC 7.x or later by default, you can obtain GCC 7.x by using the following commands:
$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test $ sudo apt-get update $ sudo apt-get install gcc-7 g++-7 $ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 \ --slave /usr/bin/g++ g++ /usr/bin/g++-7 $ sudo update-alternatives --config gcc
For CentOS and Red Hat Enterprise Linux version 7, Intel® recommends that you compile GCC from source and install it using the following instructions:
- Download the tarball of the GCC version you want to
install.
wget http://www.netgull.com/gcc/releases/gcc-7.2.0/gcc-7.2.0.tar.gz
- Unpack the tar archive and change the current working
directory.
tar zxf gcc-7.2.0.tar.gz cd gcc-7.2.0
- Install the bzip2
package.
yum -y install bzip2
- Run the download_prerequisites script to download some prerequisites
required by the GCC. Note: You must run the script from the top-level of the GCC source tree.
./contrib/download_prerequisites
- Once the prerequisites are downloaded, execute the
following command to start configuring the GCC build
environment:
./configure --disable-multilib --enable-languages=c,c++
- Run the following command to compile the source code.
Compilation may take a few hours to
complete.
make -j 4 make install
- Refer to Verifying Your GCC Installation section for instructions to verify if your GCC installation was successful.
For SUSE, Intel® recommends that you compile GCC from source and install it by following the instructions provided for CentOS and Red Hat Enterprise Linux.
Verifying Your GCC Installation
To verify your GCC installation, ensure the following:
- Shell can find the correct GCC binaries.
- The newer GCC is using correct shared libraries (in particular, libstdc++.so.6).
This depends on how you installed the GCC and set the $PATH and $LD_LIBRARY_PATH environment variables. You might have installed the GCC binaries and libraries to the default locations for your operating system.
Perform these steps:
- Verify if your newly-installed GCC binaries are being
used.
$ which gcc
- Ensure the output points to the correct GCC.
$ gcc –dumpversion
- Ensure GCC reports a version of 7.2.0 or higher.
If the above commands do not report the correct GCC version, modify your $PATH environment variable to point to the location of the newly installed GCC binaries.
For Ubuntu, the default install location for GCC binaries is /usr/bin; and libraries is /usr/lib64. However, binaries are versioned (for example, gcc-7). Use the update-alternatives utility to ensure gcc is a symbolic link to the desired GCC version. On Ubuntu systems, the $PATH and $LD_LIBRARY_PATH environment variables need not be updated because the shell and dynamic linker should automatically search in the correct places for the binaries and libraries, respectively.
You can place the following command in your shell startup script or an environment setup script so that the development environment is automatically set up when you enter it.
$ export PATH=</path/to/new/gcc>/bin:$PATH
$ echo $PATH
Check the output to ensure that the path to your newly installed GCC is part of your $PATH. Repeat these steps to ensure the correct GCC binaries are being used.
To verify that the new GCC libraries are being used, check that a test compile links against the correct libstdc++.so.6 library version by using the following steps:
$ echo "int main() { return 0; }" > test.cpp $ g++ -Wl,--no-as-needed test.cpp -o test $ ldd test linux-vdso.so.1 => (0x00007fff6df35000) libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003451600000) libm.so.6 => /lib64/libm.so.6 (0x0000003446a00000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x000000344d600000) libc.so.6 => /lib64/libc.so.6 (0x0000003446600000) /lib64/ld-linux-x86-64.so.2 (0x000055ff56398000) $ strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX_3.4.24 GLIBCXX_3.4.24
Use the output from the ldd command to determine the path to the libstdc++.so.6 library that you need to use with the strings command (see highlighted strings; your output may be different). Ensure that the strings command returns GLIBCXX_3.4.24.
Alternatively, the libstdc++.so.6 file is often a symbolic link to the actual library, which has the version number appended. Therefore, instead of calling the strings command on libstdc++.so.6 library, you can use the following readlink command to verify libstdc++.so.6 points to a sufficiently new version of libstdc++:
$ readlink /usr/lib64/libstdc++.so.6 libstdc++.so.6.0.24
Use the output from the ldd command (executed earlier) to determine the path to libstdc++.so.6 that you need to use with the readlink command. Ensure that readlink command reports that your libstdc++.so.6 is a symbolic link to libstdc++.so.6.0.24. Versions newer than 6.0.24 may also work.
If the above commands do not report the correct shared libraries are being used, you might need to modify your $LD_LIBRARY_PATH environment variable to point to the location of the newly installed GCC libraries.
You can place the following command in your shell startup script or an environment setup script so that the development environment is automatically set up when you enter it.
$ export LD_LIBRARY_PATH=</path/to/new/gcc>/lib64:$LD_LIBRARY_PATH
To verify that your $LD_LIBRARY_PATH environment variable has been modified appropriately, run the following command:
$ echo $LD_LIBRARY_PATH
Check the output to ensure the path to your newly installed GCC libraries are included in $LD_LIBRARY_PATH. Repeat the above steps to ensure the correct GCC libraries (in particular libstdc++.so.6) are being used.
1.2. Contents of the Intel FPGA RTE for OpenCL Pro Edition
Utilities and Host Runtime Libraries
- The RTE Utility includes commands you can invoke to perform high-level tasks. The RTE utilities are a subset of of the Intel® FPGA SDK for OpenCL Pro Edition utilities.
- The host runtime provides the
OpenCL host platform API
and runtime API for your OpenCL host application.
The host runtime consists of the following libraries:
- Statically-linked libraries provide OpenCL host APIs, hardware abstractions and helper libraries.
- Dynamic link libraries (DLLs) provide hardware abstractions and helper libraries.
Drivers, Libraries and Files
The RTE installation process installs the RTE into a directory that you own. The path to the software installation directory is referenced by the INTELFPGAOCLSDKROOT environment variable.
Windows Folder | Linux Directory | ARM Directory | Description |
---|---|---|---|
bin | bin | bin | High-level utilities. Include this directory in your PATH environment variable setting. |
host | host | host | Files necessary for compiling your host program. |
host\include | host/include | host/include |
OpenCL Specification version 1.0 header files and software interface files necessary for compiling and linking your host application. The host/include/CL subdirectory also includes the C++ header file cl.hpp. The file contains an OpenCL version 1.1 C++ wrapper API. These C++ bindings enable a C++ host program to access the OpenCL runtime APIs using native C++ classes and methods. Important: The OpenCL version 1.1 C++
bindings are compatible with OpenCL Specification versions 1.0
and 1.1.
Add this path to the include file search path in your development environment. |
host\windows64\lib | host/linux64/lib | host/arm32/lib | OpenCL host runtime libraries for
the given target platform that provide the OpenCL platform and
runtime APIs. These libraries are necessary for linking and running
your host application. Prior to running your host application, include this directory in the library search path.
|
host\windows64\bin | host/linux64/bin | host/arm32/bin | Platform-specific binary for the RTE Utility, runtime commands, and DLLs (for Windows) necessary for running your host application, wherever applicable. Include this directory in your PATH environment variable setting. |
share\lib\perl | share/lib/perl | share/lib/perl | Perl scripts and support libraries for the RTE Utility. |
Example OpenCL Applications
You can refer to example OpenCL applications from the examples_aoc directory in the Intel FPGA SDK for OpenCL installation. For more information, refer to Contents of the Intel FPGA SDK for OpenCL Pro Edition in the Intel FPGA SDK for OpenCL Getting Started Guide.
1.3. RTE Utility
- Displaying the Software Version
To display the version of the Intel® FPGA RTE for OpenCL™ , invoke the version utility command. - Listing the Intel FPGA RTE for OpenCL Utility Command Options
To display information on the Intel® FPGA RTE for OpenCL™ utility command options, invoke the help utility command. - Managing an FPGA Board
The Intel® FPGA RTE for OpenCL™ includes utility commands you can invoke to install, uninstall, diagnose, and program your FPGA board. - Managing Host Application
The Intel® FPGA RTE for OpenCL™ includes utility commands you can invoke to obtain information on flags and libraries necessary for compiling and linking your host application.
1.3.1. Displaying the Software Version
aocl <version>.<build> (Intel(R) Runtime Environment for OpenCL(TM), Version <version> Build <build>, Copyright (C) <year> Intel Corporation)
1.3.2. Listing the Intel FPGA RTE for OpenCL Utility Command Options
1.3.3. Managing an FPGA Board
For more information about the install, uninstall, diagnose, program and flash utility commands, refer to the Managing an FPGA Board section of the Intel FPGA SDK for OpenCL Pro Edition Programming Guide.
1.3.4. Managing Host Application
For Linux systems, if you debug your host application using the GNU Project Debugger (GDB), invoke the following command prior to running the host application:
handle SIG44 nostop
Without this command, the GDB debugging process terminates with the following error message:
Program received signal SIG44, Real-time event 44.
For information on the following utility command options, refer to the Managing Host Application section of the Intel FPGA SDK for OpenCL Programming Guide:
- example-makefile or makefile
- compile-config
- ldflags
- ldlibs
- link-config or linkflags
1.4. Overview of the Intel FPGA RTE for OpenCL Pro Edition Setup Process
For an overview of the RTE setup process for SoC, refer to Getting Started with the Intel® FPGA RTE for OpenCL™ for Intel® ARMv7-A SoC.
2. Getting Started with the Intel FPGA RTE for OpenCL Pro Edition for 64-Bit Windows
Figure 1 outlines the RTE setup process for 64-bit Windows systems.
- Downloading the Intel FPGA RTE for OpenCL Pro Edition
Download the Intel® FPGA RTE for OpenCL™ Pro Edition for Windows from the Intel® FPGA SDK for OpenCL* Download Center. - Installing the Intel FPGA RTE for OpenCL Pro Edition
Install the Windows version of the Intel® FPGA RTE for OpenCL™ Pro Edition in a folder that you own. - Setting the Intel FPGA RTE for OpenCL Pro Edition User Environment Variables
You have the option to set the Intel® FPGA RTE for OpenCL™ Pro Edition Windows user environment variables permanently or transiently. - Verifying Software Installation
Invoke the version utility command and verify that the correct version of the OpenCL™ software is installed. - Installing an FPGA Board
- Updating the Hardware Image on the FPGA
If applicable, before you execute an OpenCL™ kernel program on the FPGA, ensure that the flash memory of the FPGA contains a hardware image created using a current version of the OpenCL software. - Executing an OpenCL Kernel on an FPGA
Build your OpenCL™ host application in Microsoft Visual Studio, and run the application by invoking the hello_world.exe executable. - Uninstalling the Software
To uninstall the Intel® FPGA RTE for OpenCL™ Pro Edition for Windows, delete the RTE folder and restore all modified environment variables to their previous settings. - Uninstalling an FPGA Board
To uninstall an FPGA board for Windows, invoke the uninstall utility command, uninstall the Custom Platform, and unset the relevant environment variables.
2.1. Downloading the Intel FPGA RTE for OpenCL Pro Edition
- Go to the Intel® FPGA SDK for OpenCL* Download Center at the following URL:
- Select the Pro edition.
- Select the software version. The default selection is the current version.
- Click the RTE tab and select Intel® FPGA Runtime Environment for OpenCL Windows x86-64. Click More beside Download and install instructions to view the download and installation procedure.
- Click the download button to start the download process.
- Perform the steps outlined in the download and installation instructions on the download page.
2.2. Installing the Intel FPGA RTE for OpenCL Pro Edition
To install the Intel® FPGA RTE for OpenCL™ , perform the following tasks:
-
Run the .exe installer.
Direct the installer to extract the software to an empty folder that you own
(that is, not a system folder).
Note: The installation path must not contain any spaces (for example, <home_directory>\intelFPGA_pro\<version>\aclrte-windows64).
-
Note: The installer sets the user environment variable INTELFPGAOCLSDKROOT to point to the path of the software installation.Verify that INTELFPGAOCLSDKROOT points to the current version of the software. Open a Windows command window and then type echo %INTELFPGAOCLSDKROOT% at the command prompt.If the returned path does not point to the location of the RTE installation, edit the INTELFPGAOCLSDKROOT setting.
For instructions on modifying environment variable settings, refer to Setting the Intel® FPGA RTE for OpenCL™ Pro Edition User Environment Variables.
2.3. Setting the Intel FPGA RTE for OpenCL Pro Edition User Environment Variables
Environment Variable | Path to Include |
---|---|
PATH |
where INTELFPGAOCLSDKROOT points to the path of the software installation |
-
To apply permanent environment variable settings, perform the
following tasks:
- Click Windows Start menu > Control Panel (or search for and then open the Control Panel application in Windows 8.1 and Windows 10).
- Click System.
- In the System window, click Advanced system settings.
- Click the Advanced tab in the System Properties dialog box.
-
Click Environment
Variables.
The Environment Variables dialog box appears.
- To modify an existing environment variable setting, select the variable under User variables for <user_name> and then click Edit. In the Edit User Variable dialog box, type the environment variable setting in the Variable value field.
- If you add a new environment variable, click New under User variables for <user_name>. In the New User Variable dialog box, type the environment variable name and setting in the Variable name and Variable value fields, respectively.
For an environment variable with multiple settings, add semicolons to separate the settings.
-
To apply transient environment variable settings, open a
command window and run the %INTELFPGAOCLSDKROOT%\init_opencl.bat script.
Example script output:
Adding %INTELFPGAOCLSDKROOT%\bin to PATH Adding %INTELFPGAOCLSDKROOT%\host\windows64\bin to PATH
Running the init_opencl.bat script only affects the current command window. The script performs the following tasks:- Finds the Microsoft Visual Studio installation
- Imports the Microsoft Visual Studio environment to properly set the LIB environment variable
- Ensures that the PATH environment variable includes the path to the Microsoft LINK.EXE file and the aocl.exe file
2.4. Verifying Software Installation
-
At a command prompt, invoke the
aocl
version
utility command.
An output similar to the one below notifies you of a successful installation:
aocl <version>.<build> (Intel(R) FPGA Runtime Environment for OpenCL(TM), Version <version> Build <build>, Copyright (C) <year> Intel(R) Corporation)
- If installation was unsuccessful, reinstall the software. You can also refer to the Intel® FPGA Software Installation and Licensing manual and the Intel FPGA Knowledge Base for more information.
2.5. Installing an FPGA Board
To install your board into a Windows host system, invoke the aocl install <path_to_customplatform> utility command.
The steps below outline the board installation procedure. Some Custom Platforms require additional installation tasks. Consult your board vendor's documentation for further information on board installation.
- Follow your board vendor's instructions to connect the FPGA board to your system.
-
Download the Custom Platform for your FPGA board from your
board vendor's
website.
Note: Starting from 20.3 release, support for Windows BSPs is removed. Use 20.2 or older BSPs available at Download Center for FPGAs as a reference. If you want to migrate your BSP to a newer version, follow the recommended steps provided in the Reference Platform Porting Guides available under Intel FPGA SDK for OpenCL documentation.
-
Install the Custom Platform in a folder that you own (that is,
not a system folder).
You can install multiple Custom Platforms simultaneously on the same system using the aocl install utility. The Custom Platform subdirectory contains the board_env.xml file.
In a system with multiple Custom Platforms, ensure that the host program uses the FPGA Client Driver (FCD) to discover the boards rather than linking to the Custom Platforms' memory-mapped device (MMD) libraries directly. If FCD is correctly set up for Custom Platform, FCD finds all the installed boards at runtime.
-
Add the paths to the Custom Platform libraries (for example,
path to the MMD library of the board support package resembles <path_to_customplatform>/windows64/bin) to
the PATH environment variable setting.
For information on setting user environment variables and running the init_opencl script, refer to the Setting the Intel® FPGA RTE for OpenCL™ Pro Edition User Environment Variables section.
-
Invoke the command
aocl
install
<path_to_customplatform>
at a command
prompt.
Invoking aocl install <path_to_customplatform> installs both the FCD and a board driver that allows communication between host applications and hardware kernel programs.Remember:
- You need administrative rights to install a board.
To run a Windows command prompt as an administrator, click
Start > All Programs > Accessories. Under Accessories, right click Command Prompt, In the right-click
menu, click Run as
Administrator.
On Windows 8.1 or Windows 10 systems, you might also need to disable signed driver verification. For details, see the following articles:
- Windows 8: https://www.intel.com/content/altera-www/global/en_us/index/support/support-resources/knowledge-base/solutions/fb321729.html
- Windows 10: https://www.intel.com/content/altera-www/global/en_us/index/support/support-resources/knowledge-base/embedded/2017/Why-does-aocl-diagnose-fail-while-using-Windows-10.html
- If the system already has the driver installed and
you need to install FCD without the administrative rights, you can
invoke the aocl install command
with the flag -fcd-only as shown
below and follow the prompt for FCD
installation:
aocl install <path_to_customplatform> -fcd-only
- You need administrative rights to install a board.
To run a Windows command prompt as an administrator, click
Start > All Programs > Accessories. Under Accessories, right click Command Prompt, In the right-click
menu, click Run as
Administrator.
-
Query a list of FPGA devices installed in your machine by
invoking the
aocl
diagnose
command.
The software generates an output that includes the <device_name>, which is an acl number that ranges from acl0 to acl127.Attention: For possible errors after implementing the aocl diagnose utility, refer to Possible Errors After Running the diagnose Utility section in the Intel® Arria® 10 GX FPGA Development Kit Reference Platform Porting Guide. For more information on querying the <device_name> of your accelerator board, refer to the Querying the Device Name of Your FPGA Board section.
- Verify the successful installation of the FPGA board by invoking the command aocl diagnose <device_name> to run any board vendor-recommended diagnostic test.
2.6. Updating the Hardware Image on the FPGA
2.6.1. Querying the Device Name of Your FPGA Board
aocl diagnose: Running diagnostic from <board_package_path>/<board_name>/<platform>/libexec Verified that the kernel mode driver is installed on the host machine. Using board package from vendor: <board_vendor_name> Querying information for all supported devices that are installed on the host machine ... device_name Status Information acl0 Passed <descriptive_board_name> PCIe dev_id = <device_ID>, bus:slot.func = 02:00.00, at Gen 2 with 8 lanes. FPGA temperature = 43.0 degrees C. acl1 Passed <descriptive_board_name> PCIe dev_id = <device_ID>, bus:slot.func = 03:00.00, at Gen 2 with 8 lanes. FPGA temperature = 35.0 degrees C. Found 2 active device(s) installed on the host machine, to perform a full diagnostic on a specific device, please run aocl diagnose <device_name> DIAGNOSTIC_PASSED
2.6.2. Programming the Flash Memory of an FPGA
Preloading an OpenCL image into the flash memory is necessary for the proper functioning of many Custom Platforms. For example, most PCIe®-based boards require a valid OpenCL image in flash memory so that hardware on the board can use the image to configure the FPGA device when the host system powers up for the first time. If the FPGA is not configured with a valid OpenCL image, the system fails to enumerate the PCIe endpoint, or the driver does not function.
Before running any designs, ensure that the flash memory of your board has a valid OpenCL image that is compatible with the current OpenCL software version. Consult your board vendor's documentation for board-specific requirements.
To load your hardware configuration file into the flash memory of your FPGA board, perform the following tasks:
-
Install any drivers or utilities that your Custom Platform
requires.
For example, some Custom Platforms require you to install the Intel® FPGA Download Cable driver to load your hardware configuration file into the flash memory. For installation instructions, refer to the Intel® FPGA Download Cable II User Guide.
-
To load the hardware configuration file into the flash memory,
invoke the
aocl
flash
<device_name>
<design_example_filename>.aocx command, where
<device_name> refers to the acl
number (e.g. acl0 to acl127) that corresponds to your FPGA device, and
<design_example_filename>.aocx is the
hardware configuration file you create from the
<design_example_filename>.cl file in the design
example package.
For more information about compiling an aocx file, refer to Creating the FPGA Hardware Configuration File of an OpenCL kernel in the Intel FPGA SDK for OpenCL Getting Started Guide.
-
Power down your device or computer and then power it up
again.
Power cycling ensures that the FPGA configuration device retrieves the hardware configuration file from the flash memory and configures it into the FPGA.Warning: Some Custom Platforms require you to power cycle the entire host system after programming the flash memory. For example, PCIe-based Custom Platforms might require a host system restart to re-enumerate the PCIe endpoint. Intel® recommends that you power cycle the complete host system after programming the flash memory.
2.7. Executing an OpenCL Kernel on an FPGA
2.7.1. Building the Host Application
To set up Microsoft Visual Studio with FCD and ICD, perform the following tasks prior to building the host application:
- Verify that FCD and ICD are set up correctly using the
aocl diagnose -icd-only
command. If both FCD and
ICD are installed correctly, you will see the following output:
ICD System Diagnostics -------------------------------------------------------------------- Using the following location for ICD installation: HKEY_LOCAL_MACHINE\Software\Khronos\OpenCL\Vendors Found 1 icd entry at that location: <INTELFPGAOCLSDKROOT>\windows64\bin\alteracl_icd.dll REG_DWORD 0x0 Checking validity of found icd entries: <INTELFPGAOCLSDKROOT>\windows64\bin\alteracl_icd.dll REG_DWORD 0x0 is correctly registered on the system Using the following location for fcd installations: HKEY_LOCAL_MACHINE\Software\Intel\OpenCL\Boards Found 1 fcd entry at that location: <path_to_BSP>\a10_ref\windows64\bin\altera_a10_ref_mmd.dll REG_DWORD 0x0 Checking validity of found fcd entries: <path_to_bsp>\a10_ref\windows64\bin\altera_a10_ref_mmd.dll REG_DWORD 0x0 is correctly registered on the system Number of Platforms = 1 1. Intel(R) FPGA SDK for OpenCL(TM) | Intel(R) Corporation | OpenCL 1.0 Intel(R) FPGA SDK for OpenCL(TM), Version <version_number> -------------------------------------------------------------------- ICD diagnostics PASSED --------------------------------------------------------------------
- If neither the FCD nor ICD is setup correctly, refer to the Installing an FPGA Board for FCD setup, and refer to the Accessing Custom Platform-Specific Functions and Linking Your Host Application to the Khronos ICD Loader Library sections of the Intel FPGA SDK for OpenCL Pro Edition Programming Guide for more information.
- Link the host application to the OpenCL.lib library.
- Under the Solution, right-click on the host application name and select Properties, and then select Configuration Properties > Linker > Input.
- In the Additional Dependencies field, enter OpenCL.lib.
Attention: Because you are using FCD and ICD, do not link the host program to alteracl.lib or to your Custom Platform's MMD libraries directly.
- Open the <local_path_to_exm_opencl_hello_world>\hello_world\hello_world.sln file in Microsoft Visual Studio.
- Verify that the build configuration is correct. The default build configuration is Debug, but you can use Release. You must select the appropriate option as the solution platform (for example, for x64 architecture, select x64).
-
Build the solution
by selecting the
Build > Build
Solution menu option, or by pressing the F7
key.
The hello_world.exe executable will be in the <local_path_to_exm_opencl_hello_world>\hello_world\bin folder.
-
Verify that the
build is correct. An output ending with a message similar to the one shown
below notifies you of a successful build:
1> Build succeeded. 1> 1> Time Elapsed 00:00:03:29 ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
Attention: You can ignore the LNK4009: PDB 'vc90.pdb' was not found with... warnings because they have no effect on the build. The compiler might issue this type of warning messages if you have built your Windows libraries using a previous version of Microsoft Visual Studio.
2.7.2. Running the Host Application
- Add the path %INTELFPGAOCLSDKROOT%\host\windows64\bin to the PATH environment variable.
- At a command prompt, navigate to the host executable within the <local_path_to_exm_opencl_hello_world>\hello_world\bin folder.
-
Invoke the
hello_world.exe executable.
The hello_world executable executes the kernel code on the FPGA.
2.7.3. Output from Successful Kernel Execution
Example output:
Reprogramming device [0] with handle 1 Querying platform for info: ========================== CL_PLATFORM_NAME = Intel(R) FPGA SDK for OpenCL(TM) CL_PLATFORM_VENDOR = Intel Corporation CL_PLATFORM_VERSION = OpenCL 1.0 Intel(R) FPGA SDK for OpenCL(TM), <version> Querying device for info: ======================== CL_DEVICE_NAME = <board name> : <descriptive board name> CL_DEVICE_VENDOR = <board vendor name> CL_DEVICE_VENDOR_ID = <board vendor ID> CL_DEVICE_VERSION = OpenCL 1.0 Intel(R) FPGA SDK for OpenCL(TM), <version> CL_DRIVER_VERSION = <version> CL_DEVICE_ADDRESS_BITS = 64 CL_DEVICE_AVAILABLE = true CL_DEVICE_ENDIAN_LITTLE = true CL_DEVICE_GLOBAL_MEM_CACHE_SIZE = 32768 CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE = 0 CL_DEVICE_GLOBAL_MEM_SIZE = 8589934592 CL_DEVICE_IMAGE_SUPPORT = true CL_DEVICE_LOCAL_MEM_SIZE = 16384 CL_DEVICE_MAX_CLOCK_FREQUENCY = 1000 CL_DEVICE_MAX_COMPUTE_UNITS = 1 CL_DEVICE_MAX_CONSTANT_ARGS = 8 CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE = 2147483648 CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS = 3 CL_DEVICE_MEM_BASE_ADDR_ALIGN = 8192 CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE = 1024 CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR = 4 CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT = 2 CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT = 1 CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG = 1 CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT = 1 CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE = 0 Command queue out of order? = false Command queue profiling enabled? = true Using AOCX: hello_world.aocx Kernel initialization is complete. Launching the kernel... Thread #2: Hello from the Intel(R) FPGA OpenCL(TM) compiler! Kernel execution is complete.
2.8. Uninstalling the Software
- In Windows Explorer, navigate to the intelFPGA_pro\<version> <edition> folder.
- Delete the aclrte-windows64 folder.
-
Remove the following paths from the PATH environment variable:
- %INTELFPGAOCLSDKROOT%\bin
- %INTELFPGAOCLSDKROOT%\host\windows64\bin
- Remove the INTELFPGAOCLSDKROOT environment variable.
2.9. Uninstalling an FPGA Board
To uninstall your FPGA board, perform the following tasks:
- Follow your board vendor's instructions to disconnect the board from your machine.
-
Invoke the
aocl
uninstall
<path_to_customplatform>
utility command to
remove the current host computer drivers (for example, PCIe® drivers). The
Intel® FPGA RTE for OpenCL™
uses these drivers to communicate with the FPGA board.
Remember:
You need administrative rights to uninstall the Custom Platform. If you want to keep the driver while removing the installed FCD, you can invoke the aocl uninstall command with the flag -fcd-only as shown below and follow the prompt for FCD uninstall:
aocl uninstall <path_to_customplatform> -fcd-only
- Uninstall the Custom Platform.
- Modify PATH environment variable to remove paths that have the INTELFPGAOCLSDKROOT environment variable.
3. Getting Started with the Intel FPGA RTE for OpenCL Pro Edition for x86_64 Linux Systems
Figure 1 outlines the RTE setup process for x86_64 Linux systems.
- Downloading the Intel FPGA RTE for OpenCL Pro Edition
Download the Intel® FPGA RTE for OpenCL™ Pro Edition for Linux from the Download Center. - Installing the Intel FPGA RTE for OpenCL Pro Edition
Install the Linux version of the Intel® FPGA RTE for OpenCL™ Pro Edition in a directory that you own. - Verifying Software Installation
Invoke the version utility command and verify that the correct version of the OpenCL™ software is installed. - Installing an FPGA Board
To install your board into a Linux host system, invoke the install utility command. - Updating the Hardware Image on the FPGA
If applicable, before you execute an OpenCL™ kernel program on the FPGA, ensure that the flash memory of the FPGA contains a hardware image created using a current version of the OpenCL software. - Executing an OpenCL Kernel on an FPGA
You must build your OpenCL™ host application with the Makefile file, and run the application by invoking the hello_world executable. - Uninstalling the Software
To uninstall the Intel® FPGA RTE for OpenCL™ for Linux, remove the software package via the RPM uninstaller, then delete the software directory and restore all modified environment variables to their previous settings. - Uninstalling an FPGA Board
To uninstall an FPGA board for Linux, invoke the uninstall utility command, uninstall the Custom Platform, and unset the relevant environment variables.
3.1. Downloading the Intel FPGA RTE for OpenCL Pro Edition
- Go to the Intel® FPGA RTE for OpenCL™ Download Center at the following URL:
- Select the Pro edition.
- Select the software version. The default selection is the current version.
- Click the RTE tab and select the installation package you want to download. Click More beside Download and install instructions to view the download and installation procedure.
- Click the download button to start the download process.
- Perform the steps outlined in the download and installation instructions on the download page.
3.2. Installing the Intel FPGA RTE for OpenCL Pro Edition
- You must have sudo or root privileges.
- You must install the Linux OS kernel source and headers (for example, kernel-devel.x86_64 and kernel-headers.x86_64), and the GNU Compiler Collection (GCC) (gcc.x86_64).
- If you are installing a package that includes Intel Code Builder, you must have Java SE 1.8.71 or later installed to run Intel Code Builder. If you have an earlier version of Java SE installed, you can still complete the installation of Intel Code Builder. However, you must meet the Java version prerequisite to run Intel Code Builder.
To install the Intel® FPGA RTE for OpenCL™ , perform the following tasks:
- Run the setup_pro.sh file to install the SDK with the Intel® Quartus® Prime Pro Edition software.
-
At the command prompt, type the RPM command to install the
downloaded RPM package.
Note: The installation path must not contain any spaces (for example, /usr/intel/<version>/intel-fpga-opencl-pro-rte).Attention: If you install the software on a system that does not contain any C Shell Run Commands file (.cshrc) or Bash Run Commands file (.bashrc) in your directory, you must set the environment variables INTELFPGAOCLSDKROOT and PATH manually. Alternatively, you may create the .cshrc and .bashrc files, and then append the environment variables to them. To ensure that the updates take effect, restart your terminal after you set the environment variables.
- To install the software using the Red Hat Package
Manager (RPM), at the command prompt, type the rpm -i intel-fpga-opencl-pro-rte-64bit-linux.rpm command.
The RPM installs the software in the default location (for example, /opt/intel/intel-fpga-opencl-pro-rte).
- To install the software in the default location with verbose progress reporting, type rpm -ivh intel-fpga-opencl-pro-rte-64bit-linux.rpm
- To install the software in an alternate directory that you own (that is, not a system directory), type rpm -i --prefix <rte_destination_directory> intel-fpga-opencl-pro-rte-64bit-linux.rpm
- To install the software using the Red Hat Package
Manager (RPM), at the command prompt, type the rpm -i intel-fpga-opencl-pro-rte-64bit-linux.rpm command.
-
Verify that INTELFPGAOCLSDKROOT points to the current version of the
software. Open a shell and then type echo
$INTELFPGAOCLSDKROOT at the command prompt.
Note:If the returned path does not point to the location of the Intel® FPGA RTE for OpenCL™ installation, edit the INTELFPGAOCLSDKROOT setting.
- The installer sets the environment variable INTELFPGAOCLSDKROOT to point to the path of the software installation.
- If there are dependency issues, use the –nodeps option.
For instructions on modifying environment variable settings, refer to Setting the Intel® FPGA RTE for OpenCL™ Pro Edition User Environment Variables.
3.2.1. Setting the Intel FPGA RTE for OpenCL Pro Edition User Environment Variables
Environment Variable | Path to Include |
---|---|
PATH |
$INTELFPGAOCLSDKROOT/bin
where INTELFPGAOCLSDKROOT points to the path of the software installation |
LD_LIBRARY_PATH | $INTELFPGAOCLSDKROOT/host/linux64/lib |
-
To automatically initialize the environment at the beginning of
each session, add the following export statements to your
.bashrc or .cshrc file:
export <variable_name>="<variable_setting>":$<variable_name> command.
For example, the command export PATH="$INTELFPGAOCLSDKROOT/bin":$PATH adds $INTELFPGAOCLSDKROOT/bin to the list of PATH settings.
- To apply transient environment variable settings, open a bash-shell command-line terminal and run the source $INTELFPGAOCLSDKROOT/init_opencl.sh command. This command does not work in other shells.
3.3. Verifying Software Installation
-
At a command prompt, invoke the
aocl
version
utility command.
An output similar to the one below notifies you of a successful installation:
aocl <version>.<build> (Intel(R) FPGA Runtime Environment for OpenCL(TM), Version <version> Build <build>, Copyright (C) <year> Intel(R) Corporation)
- If installation was unsuccessful, reinstall the software. You can also refer to the Intel® FPGA Software Installation and Licensing manual and the Intel FPGA Knowledge Base for more information.
3.4. Installing an FPGA Board
- Follow your board vendor's instructions to connect the FPGA board to your system.
-
Download the Custom Platform for your FPGA board from your
board vendor's website.
Note: Starting from 20.3 release, support for Linux BSPs is removed. Use 20.2 or older BSPs available at Download Center for FPGAs as a reference. If you want to migrate your BSP to a newer version, follow the recommended steps provided in the Reference Platform Porting Guides available under Intel FPGA SDK for OpenCL documentation.
-
Install the Custom Platform in a directory that you own (that
is, not a system directory).
You can install multiple Custom Platforms simultaneously on the same system. Use the RTE utilities, such as aocl install with multiple Custom Platforms. The Custom Platform subdirectory contains the board_env.xml file.
In a system with multiple Custom Platforms, ensure that the host program uses the FPGA Client Drivers (FCD) to discover the boards rather than linking to the Custom Platforms' memory-mapped device (MMD) libraries directly. If FCD is correctly set up for Custom Platform, FCD finds all the installed boards at runtime.
-
Add the paths to the Custom Platform libraries (for example,
the path to the MMD library resembles
<path_to_customplatform>/linux64/lib) to the
LD_LIBRARY_PATH environment variable
setting.
For information on setting Linux user environment variables and running the init_opencl script, refer to the Setting the Intel® FPGA RTE for OpenCL™ Pro Edition User Environment Variables section.
-
Invoke the command
aocl
install
<path_to_customplatform>
at a command prompt.
Remember: You need sudo or root privileges to install a board.
Invoking aocl install <path_to_customplatform> installs both the FCD and a board driver that allows communication between host applications and hardware kernel programs.
If the system already has the drivers installed, and you need to install FCD without the root privilege, you can perform the following:
-
Export the
ACL_BOARD_VENDOR_PATH=<path_to_install_fcd>
environment variable to specify the installation directory of FCD other
than the default location.
Note: If you set the ACL_BOARD_VENDOR_PATH environmental variable, set it every time after you enter the OpenCL development environment via the source init_opencl.sh file.
-
Invoke the aocl install command with
the flag -fcd-only as shown below and
follow the prompt for FCD installation:
aocl install <path_to_customplatform> -fcd-only
-
Export the
ACL_BOARD_VENDOR_PATH=<path_to_install_fcd>
environment variable to specify the installation directory of FCD other
than the default location.
-
To query a list of FPGA devices installed in your machine,
invoke the
aocl
diagnose
command.
The software generates an output that includes the <device_name>, which is an acl number that ranges from acl0 to acl127.
Attention: For possible errors after implementing the aocl diagnose utility, refer to Possible Errors After Running the diagnose Utility section. For more information on querying the <device_name> of your accelerator board, refer to the Querying the Device Name of Your FPGA Board section. - To verify the successful installation of the FPGA board, invoke the command aocl diagnose <device_name> to run any board vendor-recommended diagnostic test.
3.5. Updating the Hardware Image on the FPGA
3.5.1. Querying the Device Name of Your FPGA Board
aocl diagnose: Running diagnostic from <board_package_path>/<board_name>/<platform>/libexec Verified that the kernel mode driver is installed on the host machine. Using board package from vendor: <board_vendor_name> Querying information for all supported devices that are installed on the host machine ... device_name Status Information acl0 Passed <descriptive_board_name> PCIe dev_id = <device_ID>, bus:slot.func = 02:00.00, at Gen 2 with 8 lanes. FPGA temperature = 43.0 degrees C. acl1 Passed <descriptive_board_name> PCIe dev_id = <device_ID>, bus:slot.func = 03:00.00, at Gen 2 with 8 lanes. FPGA temperature = 35.0 degrees C. Found 2 active device(s) installed on the host machine, to perform a full diagnostic on a specific device, please run aocl diagnose <device_name> DIAGNOSTIC_PASSED
3.5.2. Programming the Flash Memory of an FPGA
Preloading an OpenCL image into the flash memory is necessary for the proper functioning of many Custom Platforms. For example, most PCIe®-based boards require a valid OpenCL image in flash memory so that hardware on the board can use the image to configure the FPGA device when the host system powers up for the first time. If the FPGA is not configured with a valid OpenCL image, the system will fail to enumerate the PCIe endpoint, or the driver will not function.
Before running any designs, ensure that the flash memory of your board has a valid OpenCL image that is compatible with the current OpenCL software version. Consult your board vendor's documentation for board-specific requirements.
To load your hardware configuration file into the flash memory of your FPGA board, perform the following tasks:
- Install any drivers or utilities that your Custom Platform requires.
-
To load the hardware configuration file into the flash memory,
invoke the
aocl
flash
<device_name>
<design_example_filename>.aocx command, where
<device_name> refers to the acl
number (e.g. acl0 to acl127) that corresponds to your FPGA device, and
<design_example_filename>.aocx is the
hardware configuration file you create from the
<design_example_filename>.cl file in the example
design package.
For more information about compiling an aocx file, refer to Creating the FPGA Hardware Configuration File of an OpenCL Kernel in the Intel FPGA SDK for OpenCL Pro Edition: Getting Started Guide.
-
Power down your device or computer and then power it up
again.
Power cycling ensures that the FPGA configuration device retrieves the hardware configuration file from the flash memory and configures it into the FPGA.Warning: Some Custom Platforms require you to power cycle the entire host system after programming the flash memory. For example, PCIe-based Custom Platforms might require a host system restart to re-enumerate the PCIe endpoint. Intel® recommends that you power cycle the complete host system after programming the flash memory.
3.6. Executing an OpenCL Kernel on an FPGA
3.6.1. Building the Host Application
To build the host application, perform the following tasks:
-
If you did not run the aocl
install command when performing the steps from Installing an FPGA Board, you must execute the
following command:
aocl install -fcd-only <board_package_path>/a10_ref
The ICD driver links the host against the libOpenCL.so, which requires the FPGA Client Driver (FCD) installed. For installing FCD, refer to Installing an FPGA Board.
Note: If you do not have the root privilege, refer to Installing an FPGA Board. - Navigate to the hello_world directory.
-
Invoke the
make
command.
The hello_world executable is generated in the bin sub-directory.
-
If you performed the step 1, then you must execute the
following command:
aocl uninstall -fcd-only <board_package_path>/a10_ref
3.6.2. Running the Host Application
- Add the path $INTELFPGAOCLSDKROOT/host/linux64/lib to the LD_LIBRARY_PATH environment variable.
- At a command prompt, navigate to the host executable within the <local_path_to_exm_opencl_hello_world>/hello_world/bin directory.
-
Invoke the
hello_world
executable.
The hello_world executable executes the kernel code on the FPGA.
3.6.3. Output from Successful Kernel Execution
Example output:
Reprogramming device [0] with handle 1 Querying platform for info: ========================== CL_PLATFORM_NAME = Intel(R) FPGA SDK for OpenCL(TM) CL_PLATFORM_VENDOR = Intel Corporation CL_PLATFORM_VERSION = OpenCL 1.0 Intel(R) FPGA SDK for OpenCL(TM), <version> Querying device for info: ======================== CL_DEVICE_NAME = <board name> : <descriptive board name> CL_DEVICE_VENDOR = <board vendor name> CL_DEVICE_VENDOR_ID = <board vendor ID> CL_DEVICE_VERSION = OpenCL 1.0 Intel(R) FPGA SDK for OpenCL(TM), <version> CL_DRIVER_VERSION = <version> CL_DEVICE_ADDRESS_BITS = 64 CL_DEVICE_AVAILABLE = true CL_DEVICE_ENDIAN_LITTLE = true CL_DEVICE_GLOBAL_MEM_CACHE_SIZE = 32768 CL_DEVICE_GLOBAL_MEM_CACHELINE_SIZE = 0 CL_DEVICE_GLOBAL_MEM_SIZE = 8589934592 CL_DEVICE_IMAGE_SUPPORT = true CL_DEVICE_LOCAL_MEM_SIZE = 16384 CL_DEVICE_MAX_CLOCK_FREQUENCY = 1000 CL_DEVICE_MAX_COMPUTE_UNITS = 1 CL_DEVICE_MAX_CONSTANT_ARGS = 8 CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE = 2147483648 CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS = 3 CL_DEVICE_MEM_BASE_ADDR_ALIGN = 8192 CL_DEVICE_MIN_DATA_TYPE_ALIGN_SIZE = 1024 CL_DEVICE_PREFERRED_VECTOR_WIDTH_CHAR = 4 CL_DEVICE_PREFERRED_VECTOR_WIDTH_SHORT = 2 CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT = 1 CL_DEVICE_PREFERRED_VECTOR_WIDTH_LONG = 1 CL_DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT = 1 CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE = 0 Command queue out of order? = false Command queue profiling enabled? = true Using AOCX: hello_world.aocx Kernel initialization is complete. Launching the kernel... Thread #2: Hello from the Intel(R) FPGA OpenCL(TM) compiler! Kernel execution is complete.
3.7. Uninstalling the Software
- Remove the software package by executing the rpm -e intel-fpga-opencl-pro-rte command. This uninstalls the RTE.
- Remove $INTELFPGAOCLSDKROOT/bin from the PATH environment variable.
- Remove $INTELFPGAOCLSDKROOT/host/linux64/lib from the LD_LIBRARY_PATH environment variable.
- Remove the INTELFPGAOCLSDKROOT environment variable.
3.8. Uninstalling an FPGA Board
To uninstall your FPGA board, perform the following tasks:
- Disconnect the board from your machine by following the instructions provided by your board vendor.
-
Invoke the
aocl
uninstall
<path_to_customplatform>
utility command to
remove the current host computer drivers (for example, PCIe® drivers). The
Intel® FPGA RTE for OpenCL™
uses these drivers to communicate with the
FPGA board.
Remember:
- You need root privileges to
uninstall the Custom Platform. If you want to keep the driver while
removing the installed FCD, you can invoke the
aocl
uninstall
command
with the flag -fcd-only as shown
below and follow the prompt for FCD
uninstall:
aocl uninstall <path_to_customplatform> -fcd-only
- For Linux systems, if you had installed the FCD to a specific directory, then prior to uninstalling, you need to ensure that you have set an environment variable ACL_BOARD_VENDOR_PATH that points to that specific FCD installation directory.
- You need root privileges to
uninstall the Custom Platform. If you want to keep the driver while
removing the installed FCD, you can invoke the
aocl
uninstall
command
with the flag -fcd-only as shown
below and follow the prompt for FCD
uninstall:
- Uninstall the Custom Platform.
- Unset the LD_LIBRARY_PATH environment variable.
4. Getting Started with the Intel FPGA RTE for OpenCL Pro Edition for Intel ARMv7-A SoC FPGA
The following sections provide instructions for setting up Windows and Linux versions of the RTE for use with the Intel® Arria® 10 SoC Development Kit.
For information on the key components of the Intel® Arria® 10 SoC Development Kit, refer to the Intel® Arria® 10 SoC Development Kit product page on the Intel® FPGA website.
4.1. Getting Started with the Intel FPGA RTE for OpenCL Pro Edition for SoC FPGA on Windows
4.1.1. Downloading the Intel FPGA SDK for OpenCL and the SoC EDS
- To download the SDK, follow the instructions outlined in the Downloading the Intel® FPGA SDK for OpenCL Pro Edition section of the Intel® FPGA SDK for OpenCL Pro Edition Getting Started Guide.
-
To download the
RTE, perform the following
tasks:
- Go to the Intel® FPGA SDK for OpenCL* Download Center at the following URL:
- Select the Pro edition.
- Select the software version. The default selection is the current version.
- Click the RTE tab. Click More beside Download and install instructions to view the download and installation procedure.
- Click the download button beside Intel® FPGA Runtime Environment for OpenCL Linux Cyclone V SoC TGZ to start the download process.
- Perform the steps outlined in the download and installation instructions on the download page.
-
Download the SoC EDS by performing the following steps:
- From the Download Center , click Embedded Software > SoC EDS to enter the download page for the subscription edition of the SoC EDS.
- Select the Pro Edition.
- Select the software version.
- Select Windows as the operating system.
- Click Intel SoC FPGA Embedded Development Suite Pro Edition to download.
- Perform the steps outlined in the download and installation instructions.
4.1.2. Installing the Intel FPGA SDK for OpenCL Pro Edition for SoC FPGA
The Intel® FPGA SDK for OpenCL™ Intel® Arria® 10 SoC Development Kit Reference Platform (a10soc) includes an SD flash card image necessary for running OpenCL applications on the board. The SD flash card image includes the recompiled Linux kernel driver, preinstalled version of the Intel® FPGA RTE for OpenCL™ , and a script for setting environment variables.
-
To install the SDK, perform the following tasks:
-
Unpack the downloaded AOCL-<version>-<build>-windows.tar file into a
folder that you own.
The installation path must not contain any spaces (for example, <home_directory>\intelFPGA_pro\<version>\hld).
- Run the setup_pro.bat file to install the SDK and device support.
-
Unpack the downloaded AOCL-<version>-<build>-windows.tar file into a
folder that you own.
- To install the RTE, unpack the .tgz file install the RTE in a folder that you own.
-
Note: The installer sets the environment variable INTELFPGAOCLSDKROOT to point to the path of the software installation.Verify that the installer sets the user environment variable INTELFPGAOCLSDKROOT to point to the current version of the software. Open a Windows command window and then type echo %INTELFPGAOCLSDKROOT% at the command prompt.If the returned path does not point to the location of the current SDK installation, or if the path is not set, modify the INTELFPGAOCLSDKROOT setting.
4.1.3. Installing the Intel SoC FPGA Embedded Development Suite Pro Edition
- Run the installer. Follow the installation instructions in the SoCEDSSetup-<version>-windows.exe executable. For more information, refer to the Installing the SoC EDS section of the Intel® SoC FPGA Embedded Design Suite User Guide.
-
Perform the tasks outlined in the Installing the
Arm*
DS-5*
Intel® SoC FPGA Edition Toolkit section of
the
Intel®
SoC FPGA Embedded Design Suite User Guide to install the
Arm*
Development Studio 5* (DS-5*) Intel® SoC FPGA Edition Toolkit for your operating system.
For more information about the Arm* DS-5* Intel® SoC FPGA Edition Toolkit, refer to the Arm* DS-5* Intel® SoC FPGA Edition page of the ARM website.
- Consult the Licensing section of the Intel® SoC FPGA Embedded Design Suite User Guide for licensing instructions for the SoC EDS and the Arm* DS-5* Intel® SoC FPGA Edition Toolkit.
4.1.4. Recompiling the Linux Kernel Driver
The driver source is available in the Intel® FPGA RTE for OpenCL™ installation directory. Compile the driver yourself on a host machine that has sudo and the most recent version of the SoC EDS.
- Copy the driver source from $INTELFPGAOCLSDKROOT/board/a10soc/arm32/driver/ to a new directory.
- Set the KDIR value in the driver Makefile to the directory containing the Linux kernel source files that you downloaded in Compiling the Linux Kernel for the Intel Arria 10 SoC Development Kit.
- In the new directory that contains the driver source files, run the make clean command.
-
Run the make command to
create the aclsoc_drv.ko file.
This file is used later in Building the SD Card Image.
The driver might need to be updated to work with newer version of the Linux kernel if you see the following message while building the kernel driver:aclsoc_cmd.c:165:14: error: too many arguments to function ‘get_user_pages_unlocked’ In file included from aclsoc_cmd.c:50:0
To update the driver, make the following changes to $INTELFPGAOCLSDKROOT/board/a10soc/arm32/driver/aclsoc_cmd.c:- Find the following code in aclsoc_cmd.c:
ret = get_user_pages_unlocked(target_task, target_task->mm, start_page + got * PAGE_SIZE, num_pages - got, write, 1, p + got);
- Replace that code with the following
code:
ret = get_user_pages_remote(target_task, target_task->mm, start_page + got * PAGE_SIZE, num_pages - got, FOLL_WRITE|FOLL_FORCE, p + got, vma);
- Find the following code in aclsoc_cmd.c:
4.1.5. Installing the Intel FPGA RTE for OpenCL Pro Edition onto the SoC FPGA Board
- Create an RTE directory on the board's file system by typing the mkdir <rte_destination_directory> command.
- Move the downloaded installation package intel-fpga-opencl-pro-rte-32bit-arm.tgz to the RTE directory by typing the mvintel-fpga-opencl-pro-rte-32bit-arm.tgz <rte_destination_directory> command.
- Type cd <rte_destination_directory> to navigate to the RTE directory.
- To unpack the tarball, type tar -xzvf intel-fpga-opencl-pro-rte-32bit-arm.tgz at the command prompt.
- Transfer the aclsoc_drv.ko file you built on your development machine into the <rte_destination_directory>/board/a10soc/driver directory on the SoC FPGA board.
-
Set the environment variables, as shown below.
Intel recommends that you consolidate the settings of the environment variables into a file called init_opencl.sh. Then, run the command source ./init_opencl.sh to load all the environment variables and the OpenCL™ Linux kernel driver simultaneously.
export INTELFPGAOCLSDKROOT=<rte_destination_directory> export PATH=$INTELFPGAOCLSDKROOT/bin:$PATH export LD_LIBRARY_PATH=$INTELFPGAOCLSDKROOT/host/arm32/lib:$LD_LIBRARY_PATH insmod $INTELFPGAOCLSDKROOT/board/c5soc/driver/aclsoc_drv.ko
4.1.6. Installing the Intel Arria 10 SoC Development Kit
4.1.7. Executing an OpenCL Kernel on an SoC FPGA
The procedures outlined in this document are for building and running the host application for the hello_world example design. To execute the hello_world OpenCL™ kernel on your SoC FPGA, you must first create an hello_world.aocx file. For instructions on obtaining the hello_world example design and creating the hello_world.aocx file, refer to the Creating the FPGA Hardware Configuration File of an OpenCL Kernel section of the Intel® FPGA SDK for OpenCL™ Standard Edition Cyclone V SoC Getting Started Guide.
4.1.7.1. Building the Host Application
-
Perform the following tasks to download the hello_world design
example.
- Download the SoC FPGA-specific hello_world design example ( <version> Arm32 Linux package (.tgz)) from the Hello World Design Example page.
-
Extract exm_opencl_hello_world_arm32_linux_<version>.tar to a location to which
you have write access.
Important: Ensure that the location name does not contain spaces.
-
At a command prompt, invoke
the following command to set the PATH
environment variable:
SET PATH=%PATH%;<path_to_SoCEDS_installation_dir>\ds-5\sw\gcc\bin
- Navigate to the <path_to_exm_opencl_hello_world_arm32_linux_<version>>\hello_world folder.
-
Invoke the make -f
Makefile command. Alternatively, you can simply invoke the
make command.
The hello_world executable will be in the <path_to_exm_opencl_hello_world_arm32_linux_<version>>\hello_world\bin folder.
4.1.7.2. Running the Host Application
- Log into your SoC FPGA board.
- Copy the hello_world.aocx hardware configuration file and the hello_world host executable from their current folders to the board.
-
Verify that the LD_LIBRARY_PATH environment variable setting includes
%INTELFPGAOCLSDKROOT%\host\arm32\lib. Run the command
echo $LD_LIBRARY_PATH.
If you ran the init_opencl.sh script, the LD_LIBRARY_PATH setting should point to %INTELFPGAOCLSDKROOT%\host\arm32\lib.
- To execute the kernel on the SoC FPGA, at a command prompt, navigate to the host executable folder and run the hello_world host executable.
4.1.8. Uninstalling the Intel FPGA RTE for OpenCL
- Navigate to the root directory in the SoC FPGA board's file system that contains the <rte_destination_directory> directory.
- Type rm -rf <rte_destination_directory> to remove the RTE directory.
-
Remove the environment variable settings by typing the
following commands:
unset INTELFPGAOCLSDKROOT
unset PATH
unset LD_LIBRARY_PATH
- Uninstall the Intel® FPGA SDK for OpenCL on your host system and unset the corresponding environment variables.
4.2. Getting Started with the Intel FPGA RTE for OpenCL Pro Edition for SoC FPGA on Linux
4.2.1. Downloading the Intel FPGA SDK for OpenCL and the SoC EDS
- To download the SDK, follow the instructions outlined in the Downloading the Intel® FPGA SDK for OpenCL™ Pro Edition section of the Intel® FPGA SDK for OpenCL™ Pro Edition Getting Started Guide.
-
To download the
RTE, perform the following
tasks:
- Go to the Intel® FPGA SDK for OpenCL* Download Center at the following URL:
- Select the Pro edition.
- Select the software version. The default selection is the current version.
- Click the RTE tab. Click More beside Download and install instructions to view the download and installation procedure.
- Click the download button beside Intel® FPGA Runtime Environment for OpenCL Linux Cyclone V SoC TGZ to start the download process.
- Perform the steps outlined in the download and installation instructions on the download page.
-
Download the SoC EDS by performing the following steps:
- From the Download Center , click Embedded Software > SoC EDS to enter the download page for the subscription edition of the SoC EDS.
- Select the Pro edition.
- Select the software version.
- Select Linux as the operating system.
-
Click Intel SoC FPGA
Embedded Development Suite Pro Edition.
Download will begin immediately.
- Perform the steps outlined in the download and installation instructions.
4.2.2. Installing the Intel FPGA SDK for OpenCL Pro Edition for SoC FPGA
The Intel® FPGA SDK for OpenCL™ Intel® Arria® 10 SoC Development Kit Reference Platform (a10soc) includes an SD flash card image necessary for running OpenCL applications on the board. The SD flash card image includes the recompiled Linux kernel driver, a preinstalled version of the Intel® FPGA RTE for OpenCL™ , and a script for setting environment variables.
-
To install the SDK, perform the following tasks:
- Unpack the downloaded AOCL-<version>-<build>-linux.tar file.
- Run the setup_pro.sh file to install the SDK and device support.
- To install the RTE, unpack the .tgz file install the RTE in a directory that you own.
-
Note: The installer sets the environment variable INTELFPGAOCLSDKROOT to point to the path of the software installation.Verify that the installer sets the user environment variable INTELFPGAOCLSDKROOT to point to the current version of the software. Open a Windows command window and then type echo $INTELFPGAOCLSDKROOT at the command prompt.If the returned path does not point to the location of the current SDK installation, or if the path is not set, modify the INTELFPGAOCLSDKROOT setting.
4.2.3. Installing the Intel SoC FPGA Embedded Development Suite Pro Edition
- Run the SoCEDSSetup-<version>-linux.run installer. For more information, refer to the Installing the SoC EDS section of the Intel® SoC FPGA Embedded Development Suite User Guide.
-
Perform the tasks outlined in the Installing the
Arm*
DS-5*
Intel® SoC FPGA Edition
Toolkit section of the
Intel®
SoC FPGA Embedded Development Suite User
Guide to install the
Arm*
Development Studio 5* (DS-5*) Intel® SoC FPGA Edition Toolkit for your operating system.
For more information on the Arm* DS-5* Intel® SoC FPGA Edition Toolkit, refer to the Arm* DS-5* Intel® SoC FPGA Edition page of the ARM website.
- Consult the Licensing section of the Intel® SoC FPGA Embedded Development Suite User Guide for licensing instructions for the SoC EDS and the Arm* DS-5* Intel® SoC FPGA Edition Toolkit.
4.2.4. Recompiling the Linux Kernel Driver
The driver source is available in the installation directory. Compile the driver yourself on a host machine that has sudo and the most recent version of the SoC EDS.
- Copy the driver source from $INTELFPGAOCLSDKROOT/board/a10soc/arm32/driver/ to a new directory.
- Set the KDIR value in the driver Makefile to the directory containing the Linux kernel source files that you downloaded in Compiling the Linux Kernel for the Intel Arria 10 SoC Development Kit.
- In the new directory that contains the driver source files, run the make clean command.
-
Run the make command to
create the aclsoc_drv.ko file.
This file is used later in Building the SD Card Image.
The driver might need to be updated to work with newer version of the Linux kernel if you see the following message while building the kernel driver:aclsoc_cmd.c:165:14: error: too many arguments to function ‘get_user_pages_unlocked’ In file included from aclsoc_cmd.c:50:0
To update the driver, make the following changes to $INTELFPGAOCLSDKROOT/board/a10soc/arm32/driver/aclsoc_cmd.c:- Find the following code in aclsoc_cmd.c:
ret = get_user_pages_unlocked(target_task, target_task->mm, start_page + got * PAGE_SIZE, num_pages - got, write, 1, p + got);
- Replace that code with the following
code:
ret = get_user_pages_remote(target_task, target_task->mm, start_page + got * PAGE_SIZE, num_pages - got, FOLL_WRITE|FOLL_FORCE, p + got, vma);
- Find the following code in aclsoc_cmd.c:
4.2.5. Installing the Intel FPGA RTE for OpenCL Pro Edition onto the SoC FPGA Board
- Create an RTE directory on the board's file system by typing the mkdir <rte_destination_directory> command.
- Move the downloaded installation package intel-fpga-opencl-pro-rte-32bit-arm.tgz to the RTE directory by typing the mvintel-fpga-opencl-pro-rte-32bit-arm.tgz <rte_destination_directory> command.
- Type cd <rte_destination_directory> to navigate to the RTE directory.
- To unpack the tarball, type tar -xzvf intel-fpga-opencl-pro-rte-32bit-arm.tgz at the command prompt.
- Transfer the aclsoc_drv.ko file you built on your development machine into the <rte_destination_directory>/board/a10soc/driver directory on the SoC FPGA board.
-
Set the environment variables, as shown below.
Intel recommends that you consolidate the settings of the environment variables into a file called init_opencl.sh. Then, run the command source ./init_opencl.sh to load all the environment variables and the OpenCL™ Linux kernel driver simultaneously.
export INTELFPGAOCLSDKROOT=<rte_destination_directory> export PATH=$INTELFPGAOCLSDKROOT/bin:$PATH export LD_LIBRARY_PATH=$INTELFPGAOCLSDKROOT/host/arm32/lib:$LD_LIBRARY_PATH insmod $INTELFPGAOCLSDKROOT/board/c5soc/driver/aclsoc_drv.ko
4.2.6. Installing the SoC Development Kit
4.2.7. Executing an OpenCL Kernel on an SoC FPGA
The procedures outlined in this document are for building and running the host application for the hello_world example design. To execute the hello_world OpenCL™ kernel on your SoC FPGA, you must first create an hello_world.aocx file. For instructions on obtaining the hello_world example design and creating the hello_world.aocx file, refer to the Creating the FPGA Hardware Configuration File of an OpenCL Kernel section of the Intel® FPGA SDK for OpenCL™ Standard Edition Cyclone V SoC Getting Started Guide.
4.2.7.1. Building the Host Application
-
At a command prompt, invoke the following command to set the
PATH environment variable:
export PATH=<path_to_SoCEDS_installation_dir>/ds-5/sw/gcc/bin:$PATH
- Navigate to the <local_path_to_exm_opencl_hello_world>/hello_world directory.
-
Invoke the make -f
Makefile command. Alternatively, you can simply invoke the
make command.
The hello_world executable will be in the <local_path_to_exm_opencl_hello_world>/hello_world/bin directory.
4.2.7.2. Running the Host Application
- Log into your SoC FPGA board.
- Copy the hello_world.aocx hardware configuration file and the hello_world host executable from their current directories to the board.
-
Verify that the LD_LIBRARY_PATH environment variable setting includes $INTELFPGAOCLSDKROOT/host/arm32/lib. Run the command
echo $LD_LIBRARY_PATH.
If you ran the init_opencl.sh script, the LD_LIBRARY_PATH setting should point to $INTELFPGAOCLSDKROOT/host/arm32/lib.
- To execute the kernel on the SoC FPGA, at a command prompt, navigate to the host executable directory and run the hello_world host executable.
4.2.8. Uninstalling the Intel FPGA RTE for OpenCL
- Navigate to the root directory in the SoC FPGA board's file system that contains the <rte_destination_directory> directory.
- Type rm -rf <rte_destination_directory> to remove the RTE directory.
-
Remove the environment variable settings by typing the following commands:
unset INTELFPGAOCLSDKROOT
unset PATH
unset LD_LIBRARY_PATH
- Uninstall the Intel® FPGA SDK for OpenCL™ on your host system and unset the corresponding environment variables.
5. Intel FPGA RTE for OpenCL Pro Edition Getting Started Guide Archives
Intel® Quartus® Prime Version | User Guide |
---|---|
20.3 | Intel® FPGA RTE for OpenCL™ Pro Edition Getting Started Guide |
20.2 | Intel® FPGA RTE for OpenCL™ Pro Edition Getting Started Guide |
19.1 | Intel® FPGA RTE for OpenCL™ Pro Edition Getting Started Guide |
18.1 | Intel® FPGA RTE for OpenCL™ Pro Edition Getting Started Guide |
18.0 | Intel® FPGA RTE for OpenCL™ Pro Edition Getting Started Guide |
17.1 | Intel® FPGA RTE for OpenCL™ Getting Started Guide |
17.0 | Intel® FPGA RTE for OpenCL™ Getting Started Guide |
16.1 | Intel® FPGA RTE for OpenCL™ Getting Started Guide |
16.0 | Altera RTE for OpenCL Getting Started Guide |
15.1 | Altera RTE for OpenCL Getting Started Guide |
15.0 | Altera RTE for OpenCL Getting Started Guide |
14.1 | Altera RTE for OpenCL Getting Started Guide |
A. Document Revision History of the Intel FPGA RTE for OpenCL Pro Edition Getting Started Guide
Document Version | Intel® Quartus® Prime Version | Changes |
---|---|---|
2020.12.14 | 20.4 |
|
2020.09.28 | 20.3 |
|
2020.06.22 | 20.2 |
|
2020.04.15 | 19.1 |
|
2019.09.30 | 19.1 | In Installing
the
Intel® FPGA RTE for OpenCL™
Pro
Edition topic, made the following updates:
|
2019.04.01 | 19.1 |
|
2019.01.14 | 18.1 |
|
2018.12.24 | 18.1 |
|
2018.09.24 | 18.1 |
|
2018.05.04 | 18.0 |
|
Date | Version | Changes |
---|---|---|
November 2017 | 2017.11.04 |
|
May 2017 | 2017.05.05 |
|
October 2016 | 2016.10.31 |
|
May 2016 | 2016.05.02 |
|
November 2015 | 2015.11.02 |
|
May 2015 | 15.0.0 |
|
December 2014 | 14.1.0 |
|
June 2014 | 14.0.0 | Initial release. |