-
Notifications
You must be signed in to change notification settings - Fork 143
How to build NVIDIA GPU Plugin
OpenVINO™ NVIDIA GPU plugin is not included into Intel® Distribution of OpenVINO™. To use the plugin, it should be built from source code.
In order to build the plugin, you must prebuild OpenVINO™ package from source using this guideline.
Afterwards plugin build procedure is as following:
- Install one of the following compilers with support of C++17:
- Install gcc-7 compiler
sudo apt-get update
sudo apt-get install gcc-7 g++7
- Install clang-8 compiler
sudo apt-get update
sudo apt-get install clang-8 clang++8
-
Install NVIDIA 460 version of driver from NVIDIA download drivers
-
Install CUDA 11.2 from How to install CUDA
Do not forget to add
<path_to_cuda>/bin/
in PATH variable for exampleexport PATH="<path_to_cuda>/bin:$PATH"
-
Install cuDNN 8.1.0 from How to install cuDNN
-
Install cuTENSOR 1.3.0 from How to install cuTENSOR
-
Clone
openvino_contrib
repository:
git clone --recurse-submodules --single-branch --branch=master https://github.com/openvinotoolkit/openvino_contrib.git
- Go to plugin directory:
cd openvino_contrib/modules/nvidia_plugin
git checkout develop
- Prepare a build folder:
mkdir build && cd build
-
Build plugin
First of all, switch OpenVINO™ to tag 2021.4 and then build it according the instruction How to build
Then build NVIDIA GPU Plugin with one of 2 options:
-
Using
build.sh
Setup the following environment variables:
export OPENVINO_HOME=<OpenVINO source directory> export OPENVINO_CONTRIB=<OpenVINO Contrib packages source directory> export OPENVINO_BUILD_PATH=<OpenVINO build directory>
Then run one of the following commands:
# Run cmake configuration (if necessary) and then build ../build.sh --build # Run cmake configuration ../build.sh --setup # For old build delete old configuration, generate new one and then build ../build.sh --rebuild
-
Using OpenVINODeveloperPackage
Run the following command:
cmake -DOpenVINODeveloperPackage_DIR=<path to OpenVINO package build folder> -DCMAKE_BUILD_TYPE=Release .. cmake --build . --target openvino_nvidia_gpu_plugin -j `nproc`
First build docker container:
- Install
docker
:
./docker.sh install
su $USER # Relogin for current user
- Download all
*.deb
packages for CUDA and put them in one folder - Build docker container:
CUDA_PACKAGES_PATH=<path to CUDA packages> ./docker.sh build
In order to build NVIDIA GPU Plugin in docker, follow the steps:
- Enter the docker container:
docker run --gpus all -it openvino/cudaplugin bin/bash
- Build the OpenVINO and NVIDIA GPU Plugin according the steps described in ## How to build, except 3), 4), 5) steps (this packages already installed in image)
- Commit all your changes in container:
docker commit openvino/cudaplugin <name of new image>