Intel® FPGA RTE for OpenCL™ Pro Edition: Getting Started Guide

ID 683173
Date 3/28/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

4.2.4. Recompiling the Linux Kernel Driver

Compile the OpenCL™ Linux kernel driver against the compiled kernel source. If you need to rebuild the Linux kernel driver, recompile the aclsoc Linux kernel driver to the exact version of the Linux kernel running on the SoC FPGA.

The driver source is available in the Intel® FPGA RTE for OpenCL™ installation directory. Compile the driver yourself on a host machine that has sudo and the most recent version of the SoC EDS.

  1. Copy the driver source from $INTELFPGAOCLSDKROOT/board/a10soc/arm32/driver/ to a new directory.
  2. Set the KDIR value in the driver Makefile to the directory containing the Linux kernel source files that you downloaded in Compiling the Linux Kernel for the Intel Arria 10 SoC Development Kit.
  3. In the new directory that contains the driver source files, run the make clean command.
  4. Run the make command to create the aclsoc_drv.ko file.

    This file is used later in Building the SD Card Image.

    The driver might need to be updated to work with newer version of the Linux kernel if you see the following message while building the kernel driver:
    aclsoc_cmd.c:165:14: error: too many arguments to function ‘get_user_pages_unlocked’ 
    In file included from aclsoc_cmd.c:50:0
    To update the driver, make the following changes to $INTELFPGAOCLSDKROOT/board/a10soc/arm32/driver/aclsoc_cmd.c:
    1. Find the following code in aclsoc_cmd.c:
      ret = get_user_pages_unlocked(target_task, target_task->mm,
                   start_page + got * PAGE_SIZE,
                   num_pages - got, write, 1,
                   p + got);
    2. Replace that code with the following code:
      ret = get_user_pages_remote(target_task, target_task->mm,
                   start_page + got * PAGE_SIZE,
                   num_pages - got, FOLL_WRITE|FOLL_FORCE,
                   p + got, vma);