Installation

DALI and NGC

DALI is preinstalled in the NVIDIA GPU Cloud TensorFlow, PyTorch, and MXNet containers in versions 18.07 and later. More info can be found here.

Installing prebuilt DALI packages

Prerequisites

Installation

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

Compiling DALI from source

Prerequisites

Linux x64  
GCC 4.9.2 or later  
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
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.

Get the DALI source

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

Make the build directory

mkdir build
cd build

Compile DALI

To build DALI without LMDB support:

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

To build DALI with LMDB support:

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

To build DALI using Clang (experimental):

Note

This build is experimental and it is not maintained and tested like the default configuration. 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)
  • (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