Giter Club home page Giter Club logo

fpga-runtime-for-opencl's Introduction

Intel® FPGA Runtime for OpenCL™ Software Technology

Prerequisites

Linux

  • Red Hat Enterprise Linux (RHEL)* or Rocky Linux* 8
  • SUSE Linux Enterprise Server (SLES)* or openSUSE Leap* 15
  • Ubuntu* 18.04 or 20.04 LTS
  • GCC 7.4.0 and higher
  • CMake 3.10 and higher
  • Ninja 1.8.2 and higher
  • Git
  • libelf
  • zlib (only needed for simulation flow)

Windows

Building the Runtime

Build Instructions for Linux and Windows

Perform these steps to build the runtime:

  1. Clone and change to the runtime repository.

    git clone https://github.com/intel/fpga-runtime-for-opencl
    cd fpga-runtime-for-opencl
    
  2. Switch to the latest release version.

    git checkout v2022.2
    
  3. Create and change to the runtime build directory.

    mkdir build
    cd build
    
  4. Generate the Ninja build files using the cmake command.

    cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install
    
  5. Build the runtime.

    ninja
    
  6. Install the runtime to the runtime installation directory.

    ninja install
    

Build Options

  • Build without debugging symbols and with optimization.

    cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install
    
  • Build with debugging symbols and without optimization.

    cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../install
    
  • Use GCC as the compiler instead of the system default (for Linux only).

    CC=gcc CXX=g++ cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install
    
  • Specify installation paths to libelf and zlib (for Windows only).

    cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=C:\libelf;C:\zlib -DCMAKE_INSTALL_PREFIX=../install
    

    Alternatively, specify header and library directories explicitly.

    cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INCLUDE_PATH=C:\libelf\include;C:\zlib\include -DCMAKE_LIBRARY_PATH=C:\libelf\lib;C:\zlib\lib -DCMAKE_INSTALL_PREFIX=../install
    

Running Unit Tests

To run unit tests, execute the following command in the runtime build directory:

ctest -V

Notes

  • To run unit tests, you need the aoc executable from the IntelⓇ FPGA SDK for OpenCL™.

    To set the path to aoc, change to the IntelⓇ FPGA SDK for OpenCL™ installation directory and source the initialization script.

    • On Linux:

      source init_opencl.sh
      
    • On Windows:

      call init_opencl.bat
      
  • On Linux, aoc requires the libtinfo.so.5 library, which you can install using one of the following OS-specific commands:

    • Red Hat Enterprise Linux (RHEL)* or Rocky Linux* 8:

      sudo yum install ncurses-compat-libs-6.1
      
    • SUSE Linux Enterprise Server (SLES)* or openSUSE Leap* 15:

      sudo zypper install libncurses5
      
    • Ubuntu* 18.04 or 20.04 LTS:

      sudo apt install libtinfo5
      
  • On Windows, you need to set the paths to the libelf and (optionally) zlib libraries.

    set PATH=C:\libelf\lib;C:\zlib\lib;%PATH%
    
  • Running unit tests is not supported for ARM cross compilation.

  • To run unit tests individually, first set the board package directory:

    export AOCL_BOARD_PACKAGE_ROOT="$(git rev-parse --show-toplevel)/test/board/a10_ref"
    

    Switch to the directory containing the test executable:

    cd build/test
    

    Run the tests whose group and name contain the given substrings:

    ./acl_test -v -g acl_mem -n create_buffer
    

Using the Runtime

With IntelⓇ FPGA SDK for OpenCL™ or IntelⓇ FPGA RTE for OpenCL™

Perform these steps if you have the IntelⓇ FPGA SDK for OpenCL™ or IntelⓇ FPGA RTE for OpenCL™ installed on your system:

  1. In the IntelⓇ FPGA SDK for OpenCL™ installation directory, source the initialization script (see Running Unit Tests).

  2. Update the /etc/OpenCL/vendors/Altera.icd file with the full path to the libalteracl.so library in the runtime installation directory.

  3. Compile your OpenCL host program with the OpenCL header files included from the runtime installation directory.

    -Ifpga-runtime-for-opencl/install/include
    
  4. Link your OpenCL host program with the libOpenCL.so library from the IntelⓇ FPGA SDK for OpenCL™ installation directory.

    -L$INTELFPGAOCLSDKROOT/host/linux64/lib -lOpenCL
    
  5. Run your OpenCL host program.

Without IntelⓇ FPGA SDK for OpenCL™ or IntelⓇ FPGA RTE for OpenCL™

Perform these steps if you do not have the IntelⓇ FPGA SDK for OpenCL™ or IntelⓇ FPGA RTE for OpenCL™ installed on your system:

  1. Download, build, and install the OpenCL ICD Loader.

  2. Create the /etc/OpenCL/vendors/Altera.icd file with the full path to the libalteracl.so library in the runtime installation directory.

  3. Compile your OpenCL host program with the OpenCL header files included from the runtime installation directory.

    -Ifpga-runtime-for-opencl/install/include
    
  4. Link your OpenCL host program with the libOpenCL.so library from the OpenCL ICD Loader.

    -lOpenCL
    
  5. Run your OpenCL host program.

fpga-runtime-for-opencl's People

Contributors

pcolberg avatar sherry-yuan avatar sophimao avatar bsyrowik avatar ericxu233 avatar shuoniu-intel avatar zibaiwan avatar alisanikiforova avatar huangbri avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.