.. toctree::
.. highlight:: c
.. highlight:: console
The OPAE SDK has been tested on the following configurations.
OPAE SDK releases are available on GitHub. There, you can also find the driver source code and DKMS packages for the respective SDK release.
The various componentes of OPAE are available via the following compressed tar files and RPM packages.
opae-sdk-<release>.tar.gz (BSD License) (all src for libopae-c, tools, samples, headers and ASE) opae-sdk-<release>.zip (BSD License) (ZIP archive, same content as opae-sdk-<release>.tar.gz) opae-intel-fpga-driver-<release>.tar.gz (GPLv2 License) (driver sources)
opae-intel-fpga-drv-<release>-1.x86_64.rpm (GPLv2 License) (dkms and driver src to generate \*.ko at installation)
For building the kernel driver, the kernel development environment is required.
For building libopae-c, tools and samples, the following dependences are required:
Install rpm package:
$ sudo yum install opae-intel-fpga-driver-<release>.x86_64.rpm
Uninstall rpm package:
$ sudo yum remove opae-intel-fpga-driver-<release>
Install deb package:
$ sudo dpkg -i opae-intel-fpga-driver_<release>_amd64.deb
Uninstall deb package:
$ sudo dpkg -r opae-intel-fpga-driver
During the installation process, the tool will compile the driver from source then install the driver automatically. Driver installed by these packages will be automatically install again after system reboot.
Using the following command to untar the source tar ball:
$ tar zxvf opae-intel-fpga-driver-<release>.tar.gz
Following directory shall be extracted at the working directory where the above command is executed.
opae-intel-fpga-driver-<release>
Build the fpga driver from source with following procedures:
$ cd opae-intel-fpga-driver-<release> $ make
Following kernel modules shall be generated from source:
Install the above modules in the following order:
$ sudo insmod fpga-mgr-mod.ko $ sudo insmod intel-fpga-pci.ko $ sudo insmod intel-fpga-fme.ko $ sudo insmod intel-fpga-afu.ko
Use lsmod to check if all 4 modules are installed correctly or not:
$ lsmod | grep fpga
Output should look like:
intel_fpga_fme 36864 0 intel_fpga_afu 28672 0 intel_fpga_pci 28672 2 intel_fpga_afu,intel_fpga_fme fpga_mgr_mod 16384 1 intel_fpga_fme
Remove the driver modules in the following order:
$ sudo rmmod intel-fpga-afu $ sudo rmmod intel-fpga-fme $ sudo rmmod intel-fpga-pci $ sudo rmmod fpga-mgr-mod
Use the following command to extract the driver source files from the rpm:
$ mkdir opae-intel-fpga-driver-<release> $ cd opae-intel-fpga-driver-<release> $ rpm2cpio ../opae-intel-fpga-driver-<release>.rpm | cpio -idmv
Build the fpga driver from source with the following procedure:
$ cd ./usr/src/intel-fpga-<release> $ make
Using the following command to untar the source tar ball:
$ tar zxvf opae-sdk-<release>.tar.gz
Following directory shall be created at the working directory where the above command is executed.
opae-sdk-<release>
Build the OPAE C library (libopae-c), samples, tools, and the AFU Simulation Environment (ASE) library (libopae-c-ase) with the following commands:
$ cd opae-sdk-<release> $ mkdir mybuild $ cd mybuild $ cmake .. -DOPAE_BUILD_SIM=ON $ make
By default, the OPAE SDK will install into /usr/local
if you also issue the following:
$ make install
You can change this installation prefix from /usr/local
into something else
by adding -DCMAKE_INSTALL_PREFIX=<new prefix>
to the cmake
command above.
Please see Quick Start Guide on how to run the hello_fpga sample to verify libopae-c & driver are built correctly.
The tools that can be built with python distutils are: - packager - fpgaflash - fpgadiag
$ cd opae-sdk-<release> $ mkdir mybuild $ cd mybuild $ cmake .. -DOPAE_BUILD_PYTHON_DIST=ON $ make <toolname>-dist
The python distributions will be available in mybuild/<tools-directory>/<toolname>/stage/dist
In addition to building and installation from the source, users can also generate rpm and deb packages for the SDK. The generated packages can then be distributed to other users for easy installation. The advantage of this approach is that the other users do not need to have the build toolchain on their systems to install the OPAE SDK.
$ cd opae-sdk-<release> $ mkdir mybuild $ cd mybuild $ cmake .. -DOPAE_BUILD_SIM=ON -DCPACK_GENERATOR=RPM -DCMAKE_INSTALL_PREFIX=<desired install location> $ make package_rpm
.. note::
Note: Providing CMAKE_INSTALL_PREFIX is optional, by default the install prefix will be /usr.
This will generate the following rpm packages.
opae-<release>.x86_64.rpm (meta package) opae-libs-<release>.x86_64.rpm (libopae-c and samples) opae-tools-<release>.x86_64.rpm (base tools) opae-tools-extra-<release>.x86_64.rpm (extra tools) opae-devel-<release>.x86_64.rpm (headers) opae-ase-<release>.x86_64.rpm (libopae-c-ase)
.. note::
Note: For generating deb packages, cmake version 3.0.0 and above is required.
$ cd opae-sdk-<release> $ mkdir mybuild $ cd mybuild $ cmake .. -DOPAE_BUILD_SIM=ON -DCPACK_GENERATOR=DEB -DCMAKE_INSTALL_PREFIX=<desired install location> $ make package_deb
.. note::
Note: Providing CMAKE_INSTALL_PREFIX is optional, by default the install prefix will be /usr.
This will generate the following deb packages.
opae-libs-<release>.x86_64.deb (libopae-c and samples) opae-tools-<release>.x86_64.deb (tools) opae-tools-extra-<release>.x86_64.deb (tools) opae-devel-<release>.x86_64.deb (headers) opae-ase-<release>.x86_64.deb (libopae-c-ase)
The rpm packages generated in the previous step can be installed using these commands:
$ sudo yum install opae-<release>.x86_64.rpm $ sudo yum install opae-libs-<release>.x86_64.rpm $ sudo yum install opae-tools-<release>.x86_64.rpm $ sudo yum install opae-tools-extra-<release>.x86_64.rpm $ sudo yum install opae-devel-<release>.x86_64.rpm $ sudo yum install opae-ase-<release>.x86_64.rpm
.. note: If you want to install all the packages, you can also do: $ sudo yum install opae-*.rpm
To uninstall:
$ sudo yum remove opae $ sudo yum remove opae-libs $ sudo yum remove opae-tools $ sudo yum remove opae-tools-extra $ sudo yum remove opae-devel $ sudo yum remove opae-ase
The deb packages generated in the previous step can be installed using these commands:
$ sudo dpkg -i opae-libs-<release>.x86_64.deb $ sudo dpkg -i opae-tools-<release>.x86_64.deb $ sudo dpkg -i opae-tools-extra-<release>.x86_64.deb $ sudo dpkg -i opae-devel-<release>.x86_64.deb $ sudo dpkg -i opae-ase-<release>.x86_64.deb
.. note: If you want to install all the packages, you can also do: $ sudo dpkg -i opae-*.deb
To uninstall:
$ sudo dpkg -r opae-libs $ sudo dpkg -r opae-tools $ sudo dpkg -r opae-tools-extra $ sudo dpkg -r opae-devel $ sudo dpkg -r opae-ase
Access to FPGA accelerators and devices is controlled using file access permissions on the
Intel® FPGA device files, /dev/intel-fpga-fme.*
and /dev/intel-fpga-port.*
, as well as to the files reachable through /sys/class/fpga/
.
In order to allow regular (non-root) users to access accelerators, you need to grant them read and write permissions on /dev/intel/fpga-port.*
(with *
denoting the respective socket, i.e. 0 or 1). E.g.:
$ sudo chmod a+rw /dev/intel-fpga-port.0
Depending on the requirements of your application, you may also want to increase the maximum amount of memory a user process is allowed to lock. The exact way to do this depends on your Linux distribution.
You can check the current memlock limit using
$ ulimit -l
A way to permanently remove the limit for locked memory for a regular user is to add the following lines to your /etc/security/limits.conf:
user1 hard memlock unlimited user1 soft memlock unlimited
This removes the limit on locked memory for user user1
. To remove it for
all users, you can replace user1
with *
:
* hard memlock unlimited * soft memlock unlimited
Note that settings in the /etc/security/limits.conf file don't apply to services. To increase the locked memory limit for a service you need to modify the application's systemd service file and add the line:
[Service] LimitMEMLOCK=infinity
Users need to configure system hugepage to reserve 2MB-hugepages or 1GB-hugepages. For example, the 'hello_fpga' sample requires several 2MB-hugepages. And the fpgadiag tool requires several 1GB-hugepages.
The command below reserves 20 2M-hugepages:
$ sudo sh -c 'echo 20 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages'
The command below reserves 4 1GB-hugepages:
$ sudo sh -c 'echo 4 > /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages'
For x86_64 architecture processors, user can use following command to find out avaiable hugepage sizes:
$ grep pse /proc/cpuinfo | uniq flags : ... pse ...
If this commands returns a non-empty string, 2MB pages are supported.
$ grep pse /proc/cpuinfo | uniq flags : ... pdpe1gb ...
If this commands returns a non-empty string, 1GB pages are supported.