Intel Acceleration Stack Quick Start Guide: Intel FPGA Programmable Acceleration Card D5005

ID 683394
Date 7/09/2021
Public
Document Table of Contents

7.3. Running the Hello FPGA Example on Virtual Machine

This section assumes that you have set up the Virtual Machine (VM) and connected to the virtual function (VF) Device with ID 0b2c. On the virtual machine, install the Intel FPGA Driver and OPAE Software. Refer to Installing the Release on the Host for instructions.

Complete the following steps to test the operation of the NLB mode 0 AFU in a virtualized environment:

  1. Configure the system hugepage to allocate 20, 2 MB hugepages that this utility requires. This command requires root privileges:
    sudo sh -c "echo 20 > /sys/kernel/mm/hugepages/hugepages-\
    2048kB/nr_hugepages"
    
  2. Complete the following commands to extract the .tar file:
    tar xf $OPAE_PLATFORM_ROOT/sw/opae*.tar.gz
    cd $OPAE_PLATFORM_ROOT/sw/opae*
  3. To compile, type the following command:
    gcc -o hello_fpga -std=gnu99 -rdynamic \
      -ljson-c -luuid -lpthread -lopae-c -lm -Wl,-rpath -lopae-c \
      $OPAE_PLATFORM_ROOT/sw/opae*/samples/hello_fpga.c
    
  4. Run the example:
    sudo ./hello_fpga

    Sample output:

    Running Test
    Done Running Test