Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
pipeline_def
✓ from nvidia.dali import pipeline_def
✗ from nvidia.dali.pipeline import pipeline_def
pipeline_def is a decorator defined in the top-level nvidia.dali module, not a submodule.
fn
✓ from nvidia.dali import fn
✗ import nvidia.dali.fn as fn
fn is a module; direct import works but using 'from nvidia.dali import fn' is the canonical way.
types
✓ from nvidia.dali import types
Used for DALIDataType, DALIInterpType, etc.
Pipeline
✓ from nvidia.dali.pipeline import Pipeline
✗ from nvidia.dali import Pipeline
Pipeline class is in nvidia.dali.pipeline submodule.
Basic image classification pipeline using DALI with PyTorch integration. Ensure /data/images contains subdirectories per class with JPEG images.
from nvidia.dali import pipeline_def, fn, types
from nvidia.dali.plugin.pytorch import DALIGenericIterator
@pipeline_def(batch_size=4, num_threads=2, device_id=0)
def simple_pipeline():
jpegs, labels = fn.readers.file(file_root='/data/images', random_shuffle=True)
images = fn.decoders.image(jpegs, device='mixed')
images = fn.resize(images, resize_x=224, resize_y=224)
images = fn.crop_mirror_normalize(
images,
dtype=types.FLOAT,
output_layout='CHW',
mean=[0.485*255,0.456*255,0.406*255],
std=[0.229*255,0.224*255,0.225*255])
return images, labels
pipe = simple_pipeline()
pipe.build()
train_loader = DALIGenericIterator(pipe, ['images', 'labels'])
for data in train_loader:
print(data[0]['images'].shape)
break
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'nvidia.dali'
You installed the generic 'nvidia-dali' package (without CUDA suffix) or the wrong CUDA variant. The generic package may not exist for your Python version.
fixUninstall any existing DALI and install the correct variant: `pip uninstall nvidia-dali nvidia-dali-cudaXX -y && pip install nvidia-dali-cuda120` (replace 120 with your CUDA version). Ensure your CUDA version is 12.0.
RuntimeError: cuInit returned 999
The DALI CUDA variant does not match the installed CUDA driver version. This typically happens when running on a system with a different CUDA version than the package was built for.
fixCheck your CUDA driver version with `nvidia-smi` and install the corresponding DALI package (e.g., `nvidia-dali-cuda124` for CUDA 12.4).
TypeError: pipeline_def() got an unexpected keyword argument 'enable_experimental_executor'
The `enable_experimental_executor` argument was introduced in DALI 2.0. If you are using an older version, this argument does not exist.
fixRemove `enable_experimental_executor` or upgrade to DALI 2.0+ with `pip install --upgrade nvidia-dali-cuda120`.
AttributeError: module 'nvidia.dali.fn' has no attribute 'decoders'
You likely imported `fn` incorrectly using `from nvidia.dali import fn` (which is correct) but the 'decoders' submodule is not automatically imported. You need a separate import or use `fn.experimental.decoders` in older versions.
fixAdd `from nvidia.dali import fn, decoders` or use `fn.decoders.image(...)` (with submodule). In DALI <1.50, use `fn.experimental.decoders.image(...)`.
Upgrade
Version history
2.1.0latest on PyPI · released Apr 28, 2026
Audit
Dependencies
cupy-cuda12xoptionalFor using DALI with CuPy tensors (optional but common when GPU data processing is needed).
torchoptionalNative integration: DALI can output PyTorch tensors directly.
tensorflowoptionalNative integration: DALI can output TensorFlow tensors.