Installation


DALI and NGC

DALI is preinstalled in the NVIDIA GPU Cloud TensorFlow, PyTorch, and MXNet containers in versions 18.07 and later.


Installing prebuilt DALI packages

Prerequisites

  1. Linux x64.

  2. NVIDIA Driver supporting CUDA 9.0 or later (i.e., 384.xx or later driver releases).

  3. One or more of the following deep learning frameworks:

Installation

Execute the below command CUDA 9.0 based build:

pip install --extra-index-url https://developer.download.nvidia.com/compute/redist/cuda/9.0 nvidia-dali

For CUDA 10.0 based build use:

pip install --extra-index-url https://developer.download.nvidia.com/compute/redist/cuda/10.0 nvidia-dali

Note

The nvidia-dali package contains prebuilt versions of the DALI TensorFlow plugin for several versions of TensorFlow. Starting DALI 0.6.1 you can also install DALI TensorFlow plugin for the currently installed version of TensorFlow, thus allowing forward compatibility:

pip install --extra-index-url https://developer.download.nvidia.com/compute/redist/cuda/9.0 nvidia-dali-tf-plugin

For CUDA 10.0 based build execute:

pip install --extra-index-url https://developer.download.nvidia.com/compute/redist/cuda/10.0 nvidia-dali-tf-plugin

Installing this package will install nvidia-dali and its dependencies, if these dependencies are not already installed. The package tensorflow-gpu must be installed before attempting to install nvidia-dali-tf-plugin.

Note

The package nvidia-dali-tf-plugin has a strict requirement with nvidia-dali as its exact same version. Thus, installing nvidia-dali-tf-plugin at its latest version will replace any older nvidia-dali versions already installed with the latest. To work with older versions of DALI, provide the version explicitly to the pip install command.

OLDER_VERSION=0.6.1
pip install --extra-index-url https://developer.download.nvidia.com/compute/redist nvidia-dali-tf-plugin==$OLDER_VERSION

Compiling DALI from source (bare metal)

Prerequisites

Required Component

Notes

Linux x64

GCC 4.9.2 or later

Boost 1.66 or later

Modules: preprocessor.

NVIDIA CUDA 9.0

CUDA 8.0 compatibility is provided unofficially.

nvJPEG library

This can be unofficially disabled. See below.

protobuf

Version 2 or later
(Version 3 or later is required for TensorFlow TFRecord file format support).

CMake 3.5 or later

libjpeg-turbo 1.5.x or later

This can be unofficially disabled. See below.

FFmpeg 3.4.2 or later

We recommend using version 3.4.2 compiled following the instructions below.

OpenCV 3 or later

We recommend using version 3.4+. However previous versions are also compatible.
OpenCV 2.x compatibility is provided unofficially.

(Optional) liblmdb 0.9.x or later

One or more of the following Deep Learning frameworks:

Note

TensorFlow installation is required to build the TensorFlow plugin for DALI.

Note

Items marked “unofficial” are community contributions that are believed to work but not officially tested or maintained by NVIDIA.

Note

This software uses the FFmpeg licensed code under the LGPLv2.1. Its source can be downloaded from here.

FFmpeg was compiled using the following command line:

./configure \
 --prefix=/usr/local \
 --disable-static \
 --disable-all \
 --disable-autodetect \
 --disable-iconv \
 --enable-shared \
 --enable-avformat \
 --enable-avcodec \
 --enable-avfilter \
 --enable-protocol=file \
 --enable-demuxer=mov,matroska \
 --enable-bsf=h264_mp4toannexb,hevc_mp4toannexb && \
 make

Get the DALI source

git clone --recursive https://github.com/NVIDIA/dali
cd dali

Make the build directory

mkdir build
cd build

Compile DALI

Building DALI without LMDB support:

cmake ..
make -j"$(nproc)"

Building DALI with LMDB support:

cmake -DBUILD_LMDB=ON ..
make -j"$(nproc)"

Building DALI using Clang (experimental):

Note

This build is experimental. It is neither maintained nor tested. It is not guaranteed to work. We recommend using GCC for production builds.

cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang  ..
make -j"$(nproc)"

Optional CMake build parameters:

  • BUILD_PYTHON - build Python bindings (default: ON)

  • BUILD_TEST - include building test suite (default: ON)

  • BUILD_BENCHMARK - include building benchmarks (default: ON)

  • BUILD_LMDB - build with support for LMDB (default: OFF)

  • BUILD_NVTX - build with NVTX profiling enabled (default: OFF)

  • BUILD_TENSORFLOW - build TensorFlow plugin (default: OFF)

  • WERROR - treat all build warnings as errors (default: OFF)

  • (Unofficial) BUILD_JPEG_TURBO - build with libjpeg-turbo (default: ON)

  • (Unofficial) BUILD_NVJPEG - build with nvJPEG (default: ON)

Install Python bindings

pip install dali/python