Skip to content

Commit 2188773

Browse files
authored
Bump nvimagecodec requirement to 0.5.0 (NVIDIA#5854)
* Bump nvimagecodec requirement to 0.5.0 * Fix hw_decoder_load for variable bs tests Signed-off-by: Joaquin Anton Guirao <[email protected]>
1 parent 47941ae commit 2188773

File tree

5 files changed

+17
-49
lines changed

5 files changed

+17
-49
lines changed

cmake/Dependencies.common.cmake

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -273,17 +273,9 @@ endif()
273273
# nvimagecodec
274274
##################################################################
275275
set(DALI_INSTALL_REQUIRES_NVIMGCODEC "")
276-
set(DALI_INSTALL_REQUIRES_NVJPEG2K "")
277-
set(DALI_INSTALL_REQUIRES_NVTIFF "")
278276
if(BUILD_NVIMAGECODEC)
279-
set(NVJPEG2K_MIN_VERSION "0.8.0")
280-
set(NVJPEG2K_MAX_VERSION "0.9.0")
281-
282-
set(NVTIFF_MIN_VERSION "0.4.0")
283-
set(NVTIFF_MAX_VERSION "0.5.0")
284-
285-
set(NVIMGCODEC_MIN_VERSION "0.4.1")
286-
set(NVIMGCODEC_MAX_VERSION "0.5.0")
277+
set(NVIMGCODEC_MIN_VERSION "0.5.0")
278+
set(NVIMGCODEC_MAX_VERSION "0.6.0")
287279
message(STATUS "nvImageCodec - requires version >=${NVIMGCODEC_MIN_VERSION}, <${NVIMGCODEC_MAX_VERSION}")
288280
if (WITH_DYNAMIC_NVIMGCODEC)
289281
message(STATUS "nvImageCodec - dynamic load")
@@ -297,8 +289,8 @@ if(BUILD_NVIMAGECODEC)
297289
include(FetchContent)
298290
FetchContent_Declare(
299291
nvimgcodec_headers
300-
URL https://developer.download.nvidia.com/compute/nvimgcodec/redist/nvimgcodec/linux-x86_64/nvimgcodec-linux-x86_64-0.4.1.21-archive.tar.xz
301-
URL_HASH SHA512=3f20f6944a360597586bfe3550a0605257bcd944748477a869691ec1a42716e3722f8ddbd0b525995ebab89a33cd91ed82d5b151194008f1a8424971448a4824
292+
URL https://developer.download.nvidia.com/compute/nvimgcodec/redist/nvimgcodec/linux-x86_64/nvimgcodec-linux-x86_64-0.5.0.13-archive.tar.xz
293+
URL_HASH SHA512=f220f06315e18dece601971c0b31798cc819522ed0daf651fcc12e5436f62e051de8e7171a11e8e10af25930493b00c2e3a214a0e1eabb27ab57748b9966d3bd
302294
)
303295
FetchContent_Populate(nvimgcodec_headers)
304296
set(nvimgcodec_SEARCH_PATH "${nvimgcodec_headers_SOURCE_DIR}/${CUDA_VERSION_MAJOR}/include")
@@ -315,24 +307,11 @@ if(BUILD_NVIMAGECODEC)
315307

316308
if("$ENV{ARCH}" STREQUAL "aarch64-linux")
317309
message(STATUS "ARCH is set to aarch64-linux")
318-
set(NVIMGCODEC_PACKAGE_NAME "nvidia-nvimgcodec-tegra-cu${CUDA_VERSION_MAJOR}")
319-
set(NVJPEG2K_PACKAGE_NAME "nvidia-nvjpeg2k-tegra-cu${CUDA_VERSION_MAJOR}")
320-
set(NVTIFF_PACKAGE_NAME "nvidia-nvtiff-tegra-cu${CUDA_VERSION_MAJOR}")
321-
# TODO(janton): Replace with nvimgcodec[nvtiff+nvjpeg2k+...] when available
322-
# TODO(janton): enable support for nvimgcodec on Tegra
323-
set(DALI_INSTALL_REQUIRES_NVJPEG2K "")
324-
set(DALI_INSTALL_REQUIRES_NVTIFF "")
310+
set(NVIMGCODEC_PACKAGE_NAME "nvidia-nvimgcodec-tegra-cu${CUDA_VERSION_MAJOR}[all]")
325311
set(DALI_INSTALL_REQUIRES_NVIMGCODEC "")
326312
else()
327313
message(STATUS "ARCH is set to $ENV{ARCH}")
328-
set(NVIMGCODEC_PACKAGE_NAME "nvidia-nvimgcodec-cu${CUDA_VERSION_MAJOR}")
329-
set(NVJPEG2K_PACKAGE_NAME "nvidia-nvjpeg2k-cu${CUDA_VERSION_MAJOR}")
330-
set(NVTIFF_PACKAGE_NAME "nvidia-nvtiff-cu${CUDA_VERSION_MAJOR}")
331-
# TODO(janton): Replace with nvimgcodec[nvtiff+nvjpeg2k+...] when available
332-
set(DALI_INSTALL_REQUIRES_NVJPEG2K "\'${NVJPEG2K_PACKAGE_NAME} >= ${NVJPEG2K_MIN_VERSION}, < ${NVJPEG2K_MAX_VERSION}',")
333-
message(STATUS "Adding nvjpeg2k requirement as: ${DALI_INSTALL_REQUIRES_NVJPEG2K}")
334-
set(DALI_INSTALL_REQUIRES_NVTIFF "\'${NVTIFF_PACKAGE_NAME} >= ${NVTIFF_MIN_VERSION}, < ${NVTIFF_MAX_VERSION}',")
335-
message(STATUS "Adding nvtiff requirement as: ${DALI_INSTALL_REQUIRES_NVTIFF}")
314+
set(NVIMGCODEC_PACKAGE_NAME "nvidia-nvimgcodec-cu${CUDA_VERSION_MAJOR}[all]")
336315
set(DALI_INSTALL_REQUIRES_NVIMGCODEC "\'${NVIMGCODEC_PACKAGE_NAME} >= ${NVIMGCODEC_MIN_VERSION}, < ${NVIMGCODEC_MAX_VERSION}',")
337316
message(STATUS "Adding nvimagecodec requirement as: ${DALI_INSTALL_REQUIRES_NVIMGCODEC}")
338317
endif()
@@ -352,7 +331,7 @@ if(BUILD_NVIMAGECODEC)
352331
ExternalProject_Add(
353332
nvImageCodec
354333
GIT_REPOSITORY https://github.com/NVIDIA/nvImageCodec.git
355-
GIT_TAG v0.4.0
334+
GIT_TAG v0.5.0
356335
GIT_SUBMODULES "external/pybind11"
357336
"external/NVTX"
358337
"external/googletest"

conda/third_party/dali_nvimagecodec/recipe/meta.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
# limitations under the License.
1414

1515

16-
{% set build_version = "0.4.1" %}
16+
{% set build_version = "0.5.0" %}
1717

1818
package:
1919
name: nvidia-nvimagecodec-cuda{{ environ.get('CUDA_VERSION', '') | replace(".","") }}
2020
version: {{ build_version }}
2121

2222
source:
2323
git_url: https://github.com/NVIDIA/nvImageCodec.git
24-
git_rev: v0.4.1
24+
git_rev: v0.5.0
2525

2626
build:
2727
number: 0

dali/operators/imgcodec/image_decoder.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -491,19 +491,6 @@ class ImageDecoder : public StatelessOperator<Backend> {
491491
// Make sure we set the default that DALI expects
492492
if (decoder_params_.count("jpeg_fancy_upsampling") == 0)
493493
decoder_params_["jpeg_fancy_upsampling"] = false;
494-
495-
// Overriding hw_decoder_load default if nvImageCodec 0.4.x version
496-
if (!spec.HasArgument("hw_decoder_load") && decoder_params_.count("hw_decoder_load") > 0) {
497-
int major = -1, minor = -1, patch = -1;
498-
get_nvimgcodec_version(&major, &minor, &patch);
499-
if (MAKE_SEMANTIC_VERSION(major, minor, patch) >= MAKE_SEMANTIC_VERSION(0, 4, 0) &&
500-
MAKE_SEMANTIC_VERSION(major, minor, patch) < MAKE_SEMANTIC_VERSION(0, 5, 0)) {
501-
DALI_WARN(
502-
"nvImageCodec 0.4.x version detected. Setting hw_decoder_load to 1.0f for "
503-
"deterministic results");
504-
decoder_params_["hw_decoder_load"] = 1.0f;
505-
}
506-
}
507494
}
508495

509496
void ParseSample(ParsedSample &parsed_sample, span<const uint8_t> encoded) {

dali/python/setup.py.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ For more details please check the
9090
'dm-tree <= 0.1.8; python_version<"3.10"',
9191
'dm-tree <= 0.1.9; python_version>="3.10"',
9292
'packaging <= 24.2',
93-
@DALI_INSTALL_REQUIRES_NVJPEG2K@
94-
@DALI_INSTALL_REQUIRES_NVTIFF@
9593
@DALI_INSTALL_REQUIRES_NVIMGCODEC@
9694
],
9795
)

dali/test/python/test_dali_variable_batch_size.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,31 +1120,35 @@ def audio_decoder_pipe(max_batch_size, input_data, device):
11201120

11211121

11221122
def test_image_decoders():
1123+
extra_args = {
1124+
"hw_decoder_load": 0.0, # for deterministic results regardless of batch size
1125+
}
1126+
11231127
def image_decoder_pipe(module, max_batch_size, input_data, device):
11241128
pipe = Pipeline(batch_size=max_batch_size, num_threads=4, device_id=0)
11251129
encoded = fn.external_source(source=input_data, cycle=False, device="cpu")
1126-
decoded = module.image(encoded, device=device)
1130+
decoded = module.image(encoded, device=device, **extra_args)
11271131
pipe.set_outputs(decoded)
11281132
return pipe
11291133

11301134
def image_decoder_crop_pipe(module, max_batch_size, input_data, device):
11311135
pipe = Pipeline(batch_size=max_batch_size, num_threads=4, device_id=0)
11321136
encoded = fn.external_source(source=input_data, cycle=False, device="cpu")
1133-
decoded = module.image_crop(encoded, device=device)
1137+
decoded = module.image_crop(encoded, device=device, **extra_args)
11341138
pipe.set_outputs(decoded)
11351139
return pipe
11361140

11371141
def image_decoder_slice_pipe(module, max_batch_size, input_data, device):
11381142
pipe = Pipeline(batch_size=max_batch_size, num_threads=4, device_id=0)
11391143
encoded = fn.external_source(source=input_data, cycle=False, device="cpu")
1140-
decoded = module.image_slice(encoded, 0.1, 0.4, axes=0, device=device)
1144+
decoded = module.image_slice(encoded, 0.1, 0.4, axes=0, device=device, **extra_args)
11411145
pipe.set_outputs(decoded)
11421146
return pipe
11431147

11441148
def image_decoder_rcrop_pipe(module, max_batch_size, input_data, device):
11451149
pipe = Pipeline(batch_size=max_batch_size, num_threads=4, device_id=0)
11461150
encoded = fn.external_source(source=input_data, cycle=False, device="cpu")
1147-
decoded = module.image_random_crop(encoded, device=device)
1151+
decoded = module.image_random_crop(encoded, device=device, **extra_args)
11481152
pipe.set_outputs(decoded)
11491153
return pipe
11501154

0 commit comments

Comments
 (0)