OpenCL* on Intel® Programmable Acceleration Card with Intel® Arria® 10 GX FPGA Quick Start User Guide

ID 683831
Date 6/05/2020
Public

6. Compiling OpenCL* Kernels

Before compiling an OpenCL* kernel, you must install the Intel® Acceleration Stack for Development.
  1. Set the user environment variable using one of the following commands:
    source <DEV Install Path>/init_env.sh
  2. Ensure that the environment is setup with correct BSP using the following command:
    aoc -list-boards
    Example sample output:
    Board list:
    pac_a10
    Board Package: /home/username/inteldevstack/opencl_bsp
    Board list:
    pac_s10_dc
    Board Package: /tools/<username>/dcp_2_0_1_PV_RC2/inteldevstack/d5005_ias_2_0_1_b237/opencl/opencl_bspBoard list:
    
  3. Compile an OpenCL Kernel to an aocx using commands similar to the following:
    cd $OPAE_PLATFROM_ROOT/opencl/exm_opencl_vector_add_x64_linux/vector_add
    
    aoc device/vector_add.cl -o bin/vector_add.aocx -board pac_a10
    cd $OPAE_PLATFROM_ROOT/opencl/vector_add
    
    aoc device/vector_add.cl -o bin/vector_add.aocx -board pac_s10_dc
  4. The security features of the Intel® PAC with Intel® Arria® 10 GX FPGA requires the signing of metadata in a bitstream even if you don't intend to use the security features of the card. If you try to program the aocx file as is generated after the compilation in the above step, the PACSign tool gives the following error message:
    $ aocl program acl0 hello_world.aocx
    aocl program: Running program from /home/DCPsupport/inteldevstack_1_2_1_pv/a10_gx_pac_ias_1_2_1_pv/opencl/opencl_bsp/linux64/libexec
    libopae-c reconf.c:427:fpgaReconfigureSlot() **ERROR** : Failed to reconfigure bitstream: Input/output error
    libopae-c reconf.c:450:fpgaReconfigureSlot() **ERROR** : PR incompatible bitstream error detected
    Error writing bitstream to FPGA: reconfiguration error
    Error programming device
    aocl program: Program failed
    
  5. If you are in the development process or have a new Intel® PAC with Intel® Arria® 10 GX FPGA card with no root entry hash programmed to it, follow the instructions from this section Example: Creating an Unsigned .aocx File Using OpenSSL Manager to create an unsigned aocx file with only signing metadata.
  6. If you have Intel® PAC with Intel® Arria® 10 GX FPGA with the root entry hash programmed, follow the steps from section Creating the OpenCL Bitstream to create signed aocx file with your preferred method.
  7. After you follow the steps above, depending on the condition of your Intel® PAC with Intel® Arria® 10 GX FPGA, you should be able to successfully program the signed or unsigned aocx file by using the following command:
    aocl program acl0 <unsigned_file.aocx>