OpenCL* Quick Start User Guide: Intel FPGA Programmable Acceleration Card D5005

ID 683324
Date 7/21/2020
Public

4. OpenCL* Support for Multi-Card Systems

Before running an OpenCL* application, program the Intel® FPGA PAC with a OpenCL* bitstream. Use one of the precompiled aocx located in $OPAE_PLATFORM_ROOT/opencl or compile your kernel using the instructions in Compiling OpenCL Kernels.

Note: For a system with one Intel® FPGA PAC, Intel® recommends that you allocate the number of hugepages to 20. If your system has multiple Intel® FPGA PACs, you must allocate 20 hugepages per card. For example, a system with four Intel® FPGA PAC requires of total 80 hugepages.
To set the hugepages to 80, enter the following command:
sudo sh -c "echo 80 > /sys/kernel/mm/hugepages/hugepages-2048kB \
/nr_hugepages"

Run the aocl diagnose command to determine how many FPGAs the system includes. For example, running the aocl diagnose command on a system with two Intel® FPGA PAC might show output similar to the following:

  1. aocl diagnose
    --------------------------------------------------------------------
    	BSP Diagnostics                                                     
    	--------------------------------------------------------------------
    	--------------------------------------------------------------------
    	Device Name:
    	acl0
    	
    	BSP Install Location:
    	/home/DCPsupport/intelrtestack/d5005_ias_2_0_1_b217/opencl/opencl_bsp
    	
    	Vendor: Intel Corp
    	
    	Physical Dev Name   Status            Information
    	
    	pac_ec00001         Uninitialized     OpenCL BSP not loaded. Must load BSP using command: 
    	                                      'aocl program <device_name> <aocx_file>'
    	                                      before running OpenCL programs using this device
    	
    	DIAGNOSTIC_PASSED
    	--------------------------------------------------------------------
    	--------------------------------------------------------------------
    	Device Name:
    	acl1
    	
    	BSP Install Location:
    	/home/DCPsupport/intelrtestack/d5005_ias_2_0_1_b217/opencl/opencl_bsp
    	
    	Vendor: Intel Corp
    	
    	Physical Dev Name   Status            Information
    	
    	pac_ec00000         Uninitialized     OpenCL BSP not loaded. Must load BSP using command: 
    	                                      'aocl program <device_name> <aocx_file>'
    	                                      before running OpenCL programs using this device
    	
    	DIAGNOSTIC_PASSED
    --------------------------------------------------------------------------------------------------------------------
    
    
  2. The following command programs the first card listed in Step 1:
    aocl program acl0 $OPAE_PLATFORM_ROOT/opencl/hello_world.aocx
    aocl program: Running program from $OPAE_PLATFORM_ROOT/opencl \
    /opencl_bsp
    
    Program succeed.
  3. The following command programs the second card listed in Step 1:
    aocl program acl1 $OPAE_PLATFORM_ROOT/opencl/hello_world.aocx
    aocl program: Running program from $OPAE_PLATFORM_ROOT/opencl \
    /opencl_bsp
    
    Program succeed.
  4. After programming the FPGAs, the aocl diagnose command provides information about them:
    aocl diagnose
    --------------------------------------------------------------------
    	BSP Diagnostics                                                     
    	--------------------------------------------------------------------
    	--------------------------------------------------------------------
    	Device Name:
    	acl0
    	
    	BSP Install Location:
    	/home/<username>/intelrtestack/d5005_ias_2_0_1_b237/opencl/opencl_bsp
    	
    	Vendor: Intel Corp
    	
    	Physical Dev Name   Status            Information
    	
    	pac_ec00001         Passed            Intel PAC Platform (pac_ec00001)
    	                                      PCIe 175:00.0
    	                                      FPGA temperature = 0 degrees C.
    	
    	DIAGNOSTIC_PASSED
    	--------------------------------------------------------------------
    	--------------------------------------------------------------------
    	Device Name:
    	acl1
    	
    	BSP Install Location:
    	/home/<username>/intelrtestack/d5005_ias_2_0_1_b237/opencl/opencl_bsp
    	
    	Vendor: Intel Corp
    	
    	Physical Dev Name   Status            Information
    	
    	pac_ec00000         Passed            Intel PAC Platform (pac_ec00000)
    	                                      PCIe 59:00.0
    	                                      FPGA temperature = 0 degrees C.
    	
    	DIAGNOSTIC_PASSED
    	--------------------------------------------------------------------------------------------------------------------
    
    Note: You can run the advanced diagnostic on any specific device in your multi-card system using the following command:
    aocl diagnose <device name>
    Note: You can also run advanced diagnostic on all devices in your multi-card system using the following command:
    aocl diagnose all