DMA Accelerator Functional Unit User Guide: Intel® Programmable Acceleration Card with Intel® Arria® 10 GX FPGA

ID 683263
Date 3/06/2020
Public

A. Enabling Hugepages

This section covers information about how to enable 2 MB hugepages temporarily and persistently. Intel® recommends you to begin by temporarily enabling huge pages and later if you want to avoid revisiting the steps to enable hugepages persistently.

Temporarily Enabling 2 MB Hugepages

If you have already boot your system into the operating system, you can enable twenty 2 MB hugepages by running the following command:
sudo sh -c "echo 20 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages" 
You can also enable two 1 MB hugepages and twenty 2 MB hugepages at boot time by passing the following boot time arguments to GRUB:
default_hugepagesz=2MB hugepagesz=2M hugepages=20

Persistently Enabling 2 MB Hugepages

This section explains how to enable twenty 2 MB hugepages persistently so that the setting remains persistent across reboots and power cycles.
  • In Ubuntu: Perform the following steps to enable twenty 2 MB hugepages on a Ubuntu system:
    1. Edit /etc/default/grub and add the following text to the end of the file:
      GRUB_CMDLINE_LINUX_DEFAULT="${GRUB_CMDLINE_LINUX_DEFAULT} default_hugepagesz=2MB hugepagesz=2M hugepages=20" 
    2. Save the GRUB file.
    3. Update GRUB by committing the updated settings:
      sudo update-grub
    4. Reboot the system.
  • In RHEL: Perform the following steps to enable twenty 2 MB hugepages on a RHEL system:
    1. Edit /etc/default/grub and add the following text to the end of the file:
      GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX} default_hugepagesz=2MB hugepagesz=1G hugepages=2 hugepagesz=2M hugepages=20" 
    2. Save the GRUB file.
    3. Update GRUB by committing the updated settings:
      sudo grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
    4. Reboot the system.

Persistently Disabling 2 MB Hugepages

To revert your system back to its default boot settings, follow the instructions from section Persistently Enabling 2 MB Hugepages and remove the text that you added in step 1, and then follow steps 2 to 4. If you need to periodically enable and disable hugepages, instead of removing test from step 1 simply comment out the line by post-pending "#" to comment the line out.