Skip to content

Commit

Permalink
nvImageCodec related fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Joaquin Anton Guirao <janton@nvidia.com>
  • Loading branch information
jantonguirao committed Jul 29, 2024
1 parent 552ffe2 commit 39d4d3c
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 26 deletions.
19 changes: 0 additions & 19 deletions dali/python/nvidia/dali/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,22 +117,3 @@ def check_cuda_runtime():
"#pip-wheels-installation-linux "
"for the reference."
)


nvimgcodec_checked = False


def check_nvimgcodec():
"""
Checks the availability of nvImageCodec library, and prints an appropriate warning.
"""
global nvimgcodec_checked
if not nvimgcodec_checked:
nvimgcodec_checked = True
if GetNvimgcodecVersion() == -1:
deprecation_warning(
"DALI's experimental image decoder functionality now requires NVIDIA nvImageCodec "
"library to run. You need to install it separately. "
"See https://developer.nvidia.com/nvimgcodec-downloads or simply do "
f"`pip install nvidia-nvimgcodec-cu{str(__cuda_version__)[:2]}`"
)
1 change: 0 additions & 1 deletion dali/python/nvidia/dali/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,6 @@ def _start_py_workers(self):

def _init_pipeline_backend(self):
device_id = self._device_id if self._device_id is not None else types.CPU_ONLY_DEVICE_ID
b.check_nvimgcodec()
if device_id != types.CPU_ONLY_DEVICE_ID:
b.check_cuda_runtime()
self._pipe = b.Pipeline(
Expand Down
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ ARG BUILD_NVCOMP
ENV BUILD_NVCOMP=${BUILD_NVCOMP}
ARG BUILD_CVCUDA
ENV BUILD_CVCUDA=${BUILD_CVCUDA}
ARG BUILD_NVIMGCODEC
ENV BUILD_NVIMGCODEC=${BUILD_NVIMGCODEC}
ARG BUILD_NVIMAGECODEC
ENV BUILD_NVIMAGECODEC=${BUILD_NVIMAGECODEC}
ARG LINK_DRIVER
ENV LINK_DRIVER=${LINK_DRIVER}
ARG WITH_DYNAMIC_CUDA_TOOLKIT
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.build.aarch64-linux
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ CMD WERROR=ON \
BUILD_NVML=OFF \
VERBOSE_LOGS=OFF \
BUILD_CUFILE=OFF \
BUILD_NVIMGCODEC=ON \
BUILD_NVIMAGECODEC=ON \
TEST_BUNDLED_LIBS=NO \
WITH_DYNAMIC_CUDA_TOOLKIT=ON \
WITH_DYNAMIC_NVJPEG=ON \
Expand Down
2 changes: 1 addition & 1 deletion docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ if [ "$BUILD_INHOST" == "YES" ]; then
BUILD_CFITSIO=${BUILD_CFITSIO} \
BUILD_CUFILE=${BUILD_CUFILE} \
BUILD_NVCOMP=${BUILD_NVCOMP} \
BUILD_NVIMGCODEC=${BUILD_NVIMGCODEC} \
BUILD_NVIMAGECODEC=${BUILD_NVIMAGECODEC} \
LINK_DRIVER=${LINK_DRIVER} \
WITH_DYNAMIC_CUDA_TOOLKIT=${WITH_DYNAMIC_CUDA_TOOLKIT} \
WITH_DYNAMIC_NVJPEG=${WITH_DYNAMIC_NVJPEG:-ON} \
Expand Down
3 changes: 2 additions & 1 deletion docker/build_helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export BUILD_BENCHMARK=${BUILD_BENCHMARK:-ON}
export BUILD_NVTX=${BUILD_NVTX}
export BUILD_PYTHON=${BUILD_PYTHON:-ON}
export BUILD_LMDB=${BUILD_LMDB:-ON}
export BUILD_NVIMAGECODEC=${BUILD_NVIMAGECODEC:-ON}
export BUILD_JPEG_TURBO=${BUILD_JPEG_TURBO:-ON}
export BUILD_OPENCV=${BUILD_OPENCV:-ON}
export BUILD_PROTOBUF=${BUILD_PROTOBUF:-ON}
Expand All @@ -48,7 +49,6 @@ export BUILD_CFITSIO=${BUILD_CFITSIO:-ON}
export BUILD_CVCUDA=${BUILD_CVCUDA:-ON}
export BUILD_CUFILE=${BUILD_CUFILE:-OFF}
export BUILD_NVCOMP=${BUILD_NVCOMP:-OFF}
export BUILD_NVIMGCODEC=${BUILD_NVIMGCODEC:-OFF}
export LINK_LIBCUDA=${LINK_LIBCUDA:-OFF}
export WITH_DYNAMIC_CUDA_TOOLKIT=${WITH_DYNAMIC_CUDA_TOOLKIT:-OFF}
export WITH_DYNAMIC_NVJPEG=${WITH_DYNAMIC_NVJPEG:-ON}
Expand Down Expand Up @@ -85,6 +85,7 @@ cmake ../ -DCMAKE_INSTALL_PREFIX=. \
-DBUILD_NVTX=${BUILD_NVTX} \
-DBUILD_PYTHON=${BUILD_PYTHON} \
-DBUILD_LMDB=${BUILD_LMDB} \
-DBUILD_NVIMAGECODEC=${BUILD_NVIMAGECODEC} \
-DBUILD_JPEG_TURBO=${BUILD_JPEG_TURBO} \
-DBUILD_OPENCV=${BUILD_OPENCV} \
-DBUILD_PROTOBUF=${BUILD_PROTOBUF} \
Expand Down
2 changes: 1 addition & 1 deletion docs/compilation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ Optional CMake Build Parameters
- ``BUILD_NVDEC`` - build with ``NVIDIA NVDEC`` support (default: ON)
- ``BUILD_NVML`` - build with ``NVIDIA Management Library`` (``NVML``) support (default: ON)
- ``BUILD_CUFILE`` - build with ``GPU Direct Storage`` support (default: ON)
- ``BUILD_NVIMGCODEC`` - build with ``NVIDIA nvImageCodec library`` support (default: ON)
- ``BUILD_NVIMAGECODEC`` - build with ``NVIDIA nvImageCodec library`` support (default: ON)
- ``VERBOSE_LOGS`` - enables verbose loging in DALI. (default: OFF)
- ``WERROR`` - treat all build warnings as errors (default: OFF)
- ``BUILD_DALI_NODEPS`` - disables support for third party libraries that are normally expected to be available in the system
Expand Down

0 comments on commit 39d4d3c

Please sign in to comment.