Intel® FPGA AI Suite: Getting Started Guide

ID 768970
Date 9/06/2023
Public

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

Document Table of Contents

4.4. Installing OpenVINO™ Toolkit

The Intel® FPGA AI Suite requires the OpenVINO™ Toolkit 2022.3.1 for Linux.
To prepare OpenVINO™ Toolkit for Intel® FPGA AI Suite:
  1. Install the required OpenVINO™ Toolkit components.
  2. Configure your OpenVINO™ environment.

    You must configure the OpenVINO™ environment each time you want to use the OpenVINO™ Toolkit. For convenience, you can add the configuration to your .bashrc file.

The installer might issue an error message that indicates the OpenCL is not installed and is needed for GPU operation of OpenVINO™ . You can safely ignore this error message. The Intel® FPGA AI Suite does not require OpenVINO™ GPU support.

Installing Required OpenVINO™ Toolkit Components

Intel® FPGA AI Suite requires you to install the OpenVINO™ Runtime and OpenVINO™ Development Tools separately.

If you plan run the Intel® FPGA AI Suite in a WSL 2 environment, ensure that you complete these instructions from an Ubuntu* command prompt in your WSL 2 environment and not from a Windows* command line.

The location where you install the OpenVINO™ Runtime is often referred to as <openvino_installdir> in Intel® FPGA AI Suite documentation. Typically, this location is /opt/intel or /home/<user>/intel.

To install the required OpenVINO™ Toolkit components:
  1. Ensure that you have the curl utility installed. This utility is required to install OpenVINO™ Toolkit.

    To install the curl utility, run the following commands:

    Ubuntu* Linux* :
    sudo apt update
    sudo apt install curl
    Red Hat* Enterprise Linux* :
    sudo dnf install curl
  2. Create a Python 3.8 virtual environment and start it:
    1. Install Python 3.8:
      Ubuntu* Linux* :
      sudo apt update
      sudo apt install python3.8 python3.8-venv -y
      Red Hat* Enterprise Linux* :
      sudo yum install python3.8
    2. Verify your Python installation with the following command:
      python3.8 -V

      This command should return output indicating that you are using Python 3.8. For example:

      Python 3.8.16

    3. Create a new directory and switch to it:
      mkdir ~/build-openvino-dev && cd ~/build-openvino-dev
    4. Create a Python 3.8 virtual environment:
      python3.8 -m venv openvino_env
      source openvino_env/bin/activate
    5. Confirm that you are in the new Python virtual environment:
      python -V

      This command should return output indicating that you are using Python 3.8. For example:

      Python 3.8.5

  3. Install the OpenVINO™ 2022.3.1 Runtime:
    1. If you do not have an opt/intel folder, create one as follows:
      sudo mkdir /opt/intel
    2. Go to your Downloads folder:
      cd ~/Downloads
    3. Download the OpenVINO™ 2022.3.1 Runtime archive file for your system, extract the files, and move them to the /opt/intel folder as follows:
      • Ubuntu 18:
        curl -L https://storage.openvinotoolkit.org/\
        repositories/openvino/packages/2022.3.1/linux/\
        l_openvino_toolkit_ubuntu18_2022.3.1.9227.cf2c7da5689_x86_64.tgz \
             --output openvino_2022.3.1.tgz
        
        tar -xf openvino_2022.3.1.tgz
        
        sudo mv l_openvino_toolkit_ubuntu18_2022.3.1.9227.cf2c7da5689_x86_64 \
                /opt/intel/openvino_2022.3.1
      • Ubuntu 20:
        curl -L https://storage.openvinotoolkit.org/\
        repositories/openvino/packages/2022.3.1/linux/\
        l_openvino_toolkit_ubuntu20_2022.3.1.9227.cf2c7da5689_x86_64.tgz \
             --output openvino_2022.3.1.tgz
        
        tar -xf openvino_2022.3.1.tgz
        
        sudo mv l_openvino_toolkit_ubuntu20_2022.3.1.9227.cf2c7da5689_x86_64 \
             /opt/intel/openvino_2022.3.1
        
      • Red Hat* Enterprise Linux* 8:
        curl -L https://storage.openvinotoolkit.org/\
        repositories/openvino/packages/2022.3.1/linux/\
        l_openvino_toolkit_rhel8_2022.3.1.9227.cf2c7da5689_x86_64.tgz \
             --output openvino_2022.3.1.tgz
        
        tar -xf openvino_2022.3.1.tgz
        
        sudo mv l_openvino_toolkit_rhel8_2022.3.1.9227.cf2c7da5689_x86_64 \
        /opt/intel/openvino_2022.3.1
    4. Install system dependencies required by the OpenVINO™ Runtime by running the provided script:
      • Ubuntu* Linux* :
        cd /opt/intel/openvino_2022.3.1/install_dependencies/
        sudo -E ./install_openvino_dependencies.sh
      • Red Hat* Enterprise Linux* :
        cd /opt/intel/openvino_2022.3.1/install_dependencies/
        sed -i -e 's/download-ib01/dl/' ./install_openvino_dependencies.sh
        sudo -E ./install_openvino_dependencies.sh
    5. Create a symbolic link:
      cd /opt/intel
      sudo ln -s openvino_2022.3.1 openvino_2022
      Important: If you have already installed a previous release of OpenVINO™ 2022, a symbolic link to the openvino_2022 folder might already exist. Unlink the previous link with the sudo unlink openvino_2022 command, and then re-run the commands in this step.
    6. Configure the OpenVINO™ Runtime environment variables with the following command:
      source /opt/intel/openvino_2022/setupvars.sh
  4. [Ubuntu *18 users only] As a precaution, reinstall the libappstream4 library package with the following command:
    sudo apt-get install --reinstall libappstream4

    This library package is required by Intel® FPGA AI Suite, but the OpenVINO™ Runtime installation sometimes removes it.

  5. Install the OpenVINO™ Development Tools:
    1. Upgrade the Python pip command:
      python -m pip install --upgrade pip
    2. Install the openvino-dev package:
      pip install "openvino-dev[<frameworks>]==2022.3.1"

      Where <frameworks> is a comma-separated list of the deep learning frameworks that you want your OpenVINO™ development tools to support. The following values are supported: caffe, kaldi, mxnet, onnx, pytorch, tensorflow, tensorflow2.

      For example, to install the OpenVINO™ development tools to support the Caffe, PyTorch*, and TensorFlow* frameworks, run the following command:
      pip install "openvino-dev[caffe, pytorch, tensorflow]==2022.3.1"
  6. Install OpenCV as follows:
    • On Ubuntu* Linux systems, OpenCV is available in the default repositories. Install OpenCV with the following commands:
      sudo apt update
      sudo apt install libopencv-dev python3-opencv
    • On Red Hat* Enterprise Linux* systems, OpenCV is available from the CodeReady Linux Builder repository. Enable the repository and install OpenCV with the following commands:
      sudo subscription-manager repos \
           --enable codeready-builder-for-rhel-8-x86_64-rpms
      sudo yum update
      sudo yum install opencv opencv-devel
      pip3 install opencv-python

    If you need a version of OpenCV optimized for your hardware, you might need to build OpenCV from source. For instructions, refer to "Approach #2: Build OpenCV against specific version of OpenVINO™ " section of OpenCV usage with OpenVINO .

Configuring the OpenVINO™ Environment

You must configure the OpenVINO™ environment each time you want to use the OpenVINO™ Toolkit. For convenience, you can add the configuration to your .bashrc file.

To configure the OpenVINO™ environment, start a Linux terminal session and run the following commands:
source ~/build-openvino-dev/openvino_env/bin/activate
unset python_version
source <openvino_installdir>/openvino_2022/setupvars.sh

You can add these comments to your .bashrc file to configure the OpenVINO™ environment for you automatically when you log on.

Recommended Python Version

OpenVINO™ Toolkit supports Python versions 3.7-3.10.

Python 3.8 is recommended.

Next Step

After installing OpenVINO™ toolkit, continue your installation with the steps in Installing Intel Quartus Prime Pro Edition Software.