{"id":28001,"library":"nvidia-dali-cuda120","title":"NVIDIA DALI for CUDA 12.0","description":"NVIDIA DALI (Data Loading Library) is a GPU-accelerated data loading and augmentation library for deep learning. This package (nvidia-dali-cuda120) is built specifically for CUDA 12.0. Current version is 2.1.0, with a rapid release cadence (about monthly). Supports Python 3.10–3.14. Requires NVIDIA GPU with CUDA 12.0 driver (R525+) and nvJPEG2000 support. For CUDA 12.0 users, install this package instead of the generic nvidia-dali.","status":"active","version":"2.1.0","language":"python","source_language":"en","source_url":"https://github.com/NVIDIA/dali","tags":["deep-learning","data-loading","gpu-acceleration","cuda","nvidia","dali","augmentation"],"install":[{"cmd":"pip install nvidia-dali-cuda120","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"For using DALI with CuPy tensors (optional but common when GPU data processing is needed).","package":"cupy-cuda12x","optional":true},{"reason":"Native integration: DALI can output PyTorch tensors directly.","package":"torch","optional":true},{"reason":"Native integration: DALI can output TensorFlow tensors.","package":"tensorflow","optional":true}],"imports":[{"note":"pipeline_def is a decorator defined in the top-level nvidia.dali module, not a submodule.","wrong":"from nvidia.dali.pipeline import pipeline_def","symbol":"pipeline_def","correct":"from nvidia.dali import pipeline_def"},{"note":"fn is a module; direct import works but using 'from nvidia.dali import fn' is the canonical way.","wrong":"import nvidia.dali.fn as fn","symbol":"fn","correct":"from nvidia.dali import fn"},{"note":"Used for DALIDataType, DALIInterpType, etc.","wrong":"","symbol":"types","correct":"from nvidia.dali import types"},{"note":"Pipeline class is in nvidia.dali.pipeline submodule.","wrong":"from nvidia.dali import Pipeline","symbol":"Pipeline","correct":"from nvidia.dali.pipeline import Pipeline"}],"quickstart":{"code":"from nvidia.dali import pipeline_def, fn, types\nfrom nvidia.dali.plugin.pytorch import DALIGenericIterator\n\n@pipeline_def(batch_size=4, num_threads=2, device_id=0)\ndef simple_pipeline():\n    jpegs, labels = fn.readers.file(file_root='/data/images', random_shuffle=True)\n    images = fn.decoders.image(jpegs, device='mixed')\n    images = fn.resize(images, resize_x=224, resize_y=224)\n    images = fn.crop_mirror_normalize(\n        images,\n        dtype=types.FLOAT,\n        output_layout='CHW',\n        mean=[0.485*255,0.456*255,0.406*255],\n        std=[0.229*255,0.224*255,0.225*255])\n    return images, labels\n\npipe = simple_pipeline()\npipe.build()\ntrain_loader = DALIGenericIterator(pipe, ['images', 'labels'])\nfor data in train_loader:\n    print(data[0]['images'].shape)\n    break","lang":"python","description":"Basic image classification pipeline using DALI with PyTorch integration. Ensure /data/images contains subdirectories per class with JPEG images."},"warnings":[{"fix":"Add `enable_experimental_executor=False` to pipeline_def or Pipeline constructor to revert to old executor behavior.","message":"Starting with DALI 2.0, the default executor is the new 'dynamic' executor. If you relied on the exact scheduling order of the old executor, your pipeline may behave differently. To use the old executor, set `enable_experimental_executor=False` in your pipeline definition.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Upgrade Python to 3.10 or later.","message":"Python 3.9 support dropped in DALI 2.0. Requires Python >=3.10.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Run `nvidia-smi` to check driver CUDA version, then install the matching package (e.g., `pip install nvidia-dali-cuda124`).","message":"The 'nvidia-dali-cuda120' package is specific to CUDA 12.0. If your system uses a different CUDA version (e.g., 12.4, 12.5, 12.6, 12.8), you must install the corresponding '-cudaXXX' variant. Installing the wrong variant may lead to silent performance degradation or runtime errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Replace `split` with individual decoder calls (e.g., `fn.decoders.image(images)`, `fn.decoders.video(videos)`).","message":"The DecodersSplit operator (fn.decoders.split) was removed in DALI 1.50. Use separate decoder calls per output instead.","severity":"gotcha","affected_versions":">=1.50.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Uninstall 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.","cause":"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.","error":"ModuleNotFoundError: No module named 'nvidia.dali'"},{"fix":"Check your CUDA driver version with `nvidia-smi` and install the corresponding DALI package (e.g., `nvidia-dali-cuda124` for CUDA 12.4).","cause":"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.","error":"RuntimeError: cuInit returned 999"},{"fix":"Remove `enable_experimental_executor` or upgrade to DALI 2.0+ with `pip install --upgrade nvidia-dali-cuda120`.","cause":"The `enable_experimental_executor` argument was introduced in DALI 2.0. If you are using an older version, this argument does not exist.","error":"TypeError: pipeline_def() got an unexpected keyword argument 'enable_experimental_executor'"},{"fix":"Add `from nvidia.dali import fn, decoders` or use `fn.decoders.image(...)` (with submodule). In DALI <1.50, use `fn.experimental.decoders.image(...)`.","cause":"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.","error":"AttributeError: module 'nvidia.dali.fn' has no attribute 'decoders'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}