8.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 09c5. On the virtual machine, install the Intel FPGA Driver and OPAE Software. For instructions, refer to section Installing the OPAE Software Package.
Complete the following steps to test the operation of the NLB mode 0 AFU in a virtualized environment:
- Configure the system hugepages 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"
- Complete the following commands to extract the .tar file:
tar xf $OPAE_PLATFORM_ROOT/sw/opae*.tar.gz cd opae*
- 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
- Run the example:
Running Test Done Running TestFor more information about the hello_fpga sample host application, refer to the following files:
- Source code located at $OPAE_PLATFORM_ROOT/sw/opae*/samples/hello_fpga.c
- Native Loopback Accelerator Functional Unit (AFU) User Guide for AFU register descriptions.