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

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

C. Memlock Limit

Depending on the requirements of your host application, you may also want to increase the maximum amount of memory that a user process can lock. This applies when the host application allocate memory using fpgaPrepareBuffer OPAE calls. The exact method may vary with your Linux distribution.

Use ulimit -l to check the current memlock setting:
 ulimit -l

To permanently remove the locked memory limit for a regular user, add the following lines to /etc/security/limits.conf:

user1    hard   memlock           unlimited
user1    soft   memlock           unlimited

The previous commands remove the limit on locked memory for user1. To remove memory locks for all users, replace user1 with *:

*    hard   memlock           unlimited
*    soft   memlock           unlimited
Note:

Settings in the /etc/security/limits.conf file do not apply to services. To increase the locked memory limit for a service, modify the application’s systemd service file to add the following line:

[Service]
LimitMEMLOCK=infinity