Skip to content

Upgrade nvimgcodec to 0.9.0#6426

Merged
mzient merged 5 commits into
NVIDIA:mainfrom
mzient:nvimgcodec_0_9_0
Jul 21, 2026
Merged

Upgrade nvimgcodec to 0.9.0#6426
mzient merged 5 commits into
NVIDIA:mainfrom
mzient:nvimgcodec_0_9_0

Conversation

@mzient

@mzient mzient commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Category:

Other (e.g. Documentation, Tests, Configuration)

Description:

This PR updates the nvimgcodec dependency to version 0.9 and removes the workarounds needed for 0.8.

Additional information:

Affected modules and functionalities:

Key points relevant for the review:

Tests:

  • Existing tests apply
  • New tests added
    • Python tests
    • GTests
    • Benchmark
    • Other
  • N/A

Checklist

Documentation

  • Existing documentation applies
  • Documentation updated
    • Docstring
    • Doxygen
    • RST
    • Jupyter
    • Other
  • N/A

DALI team only

Requirements

  • Implements new requirements
  • Affects existing requirements
  • N/A

REQ IDs: N/A

JIRA TASK: DALI-4811

Signed-off-by: Joaquin Anton Guirao <janton@nvidia.com>
- cmake: prefer local third_party/nvimgcodec/include over FetchContent
  download, falling back to download if the local header is absent
- third_party/nvimgcodec/include: bundle nvimgcodec 0.9.0 headers
  (nvimgcodec.h + nvimgcodec_version.h) so builds compile against the
  matching ABI for the runtime library this branch targets

Signed-off-by: Joaquin Anton Guirao <janton@nvidia.com>
nvImageCodec 0.9.0 fixes the contract bug where the decoder validated the
ROI against raw codestream dimensions while interpreting it in
post-EXIF-orientation coordinates. With the bug fixed upstream, DALI can
pass ROIs in display coordinates directly and let the decoder apply the
EXIF orientation in one step.

This drops:
- ImageDecoder::roi_orient_war_ flag (always false now that the minimum
  required version is 0.9.0)
- SampleState::post_decode_orientation (only set by the workaround)
- ImageDecoder::OutputToRawROI() helper (only used by the workaround)
- The decode_shape height/width swap in PrepareOutput for 90/270 rotation
  (only needed because the decoder produced raw-orientation output)
- The post_decode_orient term in the need_processing predicate
- The roi_orient_war_-gated branches in setup_block

ConvertCPU/ConvertGPU now receive a default-constructed orientation
(a no-op) from this code path; their orientation API stays unchanged for
any other callers and the rotation/flip tests in convert_test.cc keep
exercising it.

Signed-off-by: Joaquin Anton Guirao <janton@nvidia.com>
@greptile-apps

greptile-apps Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR bumps the nvimgcodec dependency from 0.8.x to 0.9.x and removes the ROI/EXIF-orientation workaround that was required for the older release. Version bounds are updated consistently across CMake, conda recipes, and ExternalProject_Add; the workaround code paths in image_decoder.h and the associated comment in convert_test.cc are cleanly excised.

  • cmake/Dependencies.common.cmake: Minimum version raised to 0.9.0, FetchContent fallback updated to 0.9.0.20 tarballs (split by CUDA major version 12/13), and ExternalProject_Add GIT_TAG moved from v0.8.0 to v0.9.0. The include/ directory path in the tarball is now a direct child of the source root rather than inside a per-CUDA subdirectory.
  • dali/operators/imgcodec/image_decoder.h: roi_orient_war_ flag, post_decode_orientation per-sample state, OutputToRawROI() helper, and all related decode-path branches are removed; apply_exif_orientation is now set unconditionally from use_orientation_.
  • conda recipes: libnvimgcodec* version pins updated to >=0.9.0,<0.10.0 in both dali_native_libs and dali_python_bindings.

Confidence Score: 5/5

Safe to merge — all three build paths now consistently target nvimgcodec 0.9.0, the workaround removal is correct given the updated minimum version, and the conda recipes are updated in lock-step.

The workaround removal is well-scoped: gated behind the 0.9.0 minimum enforced at runtime by EnforceMinimumNvimgcodecVersion. The static-link ExternalProject_Add was updated to v0.9.0 and the FetchContent fallback now fetches the correct 0.9.0.20 tarballs per CUDA major version.

cmake/Dependencies.common.cmake — the bare message() added in the FetchContent block should carry a STATUS prefix to match the rest of the file.

Important Files Changed

Filename Overview
cmake/Dependencies.common.cmake Version bounds, FetchContent URL/hash, and ExternalProject GIT_TAG all updated to 0.9.0; one bare message() without STATUS prefix is a leftover debug print.
dali/operators/imgcodec/image_decoder.h ROI/orientation workaround removed cleanly; apply_exif_orientation now unconditionally reflects use_orientation_; no residual branching on roi_orient_war_ remains.
dali/operators/imgcodec/util/convert_test.cc Comment updated to remove the reference to the now-deleted WAR; no logic changes.
conda/dali_native_libs/recipe/meta.yaml All four libnvimgcodec* version pins updated from >=0.8.0,<0.9.0 to >=0.9.0,<0.10.0 consistently.
conda/dali_python_bindings/recipe/meta.yaml All four libnvimgcodec* version pins updated from >=0.8.0,<0.9.0 to >=0.9.0,<0.10.0 consistently.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[BUILD_NVIMAGECODEC] --> B{WITH_DYNAMIC_NVIMGCODEC?}
    B -- Yes --> C{find_package nvimgcodec 0.9.0..0.10.0}
    C -- Found --> D[Use system headers]
    C -- Not Found --> E{CUDA_VERSION_MAJOR?}
    E -- 13 --> F[FetchContent cuda13 tarball 0.9.0.20]
    E -- 12 --> G[FetchContent cuda12 tarball 0.9.0.20]
    E -- Other --> H[FATAL_ERROR]
    F --> I[include_dirs source_dir/include]
    G --> I
    B -- No --> J[ExternalProject_Add GIT_TAG v0.9.0]
    J --> K[Static link nvimgcodec 0.9.0]
    D --> L[Dynamic load nvimgcodec >= 0.9.0 < 0.10.0]
    I --> L
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[BUILD_NVIMAGECODEC] --> B{WITH_DYNAMIC_NVIMGCODEC?}
    B -- Yes --> C{find_package nvimgcodec 0.9.0..0.10.0}
    C -- Found --> D[Use system headers]
    C -- Not Found --> E{CUDA_VERSION_MAJOR?}
    E -- 13 --> F[FetchContent cuda13 tarball 0.9.0.20]
    E -- 12 --> G[FetchContent cuda12 tarball 0.9.0.20]
    E -- Other --> H[FATAL_ERROR]
    F --> I[include_dirs source_dir/include]
    G --> I
    B -- No --> J[ExternalProject_Add GIT_TAG v0.9.0]
    J --> K[Static link nvimgcodec 0.9.0]
    D --> L[Dynamic load nvimgcodec >= 0.9.0 < 0.10.0]
    I --> L
Loading

Reviews (3): Last reviewed commit: "Use upstream nvimgcodec." | Re-trigger Greptile

Comment thread cmake/Dependencies.common.cmake Outdated
@mzient
mzient marked this pull request as draft July 20, 2026 11:32
mzient added 2 commits July 20, 2026 14:19
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
Signed-off-by: Michal Zientkiewicz <michalz@nvidia.com>
@mzient
mzient force-pushed the nvimgcodec_0_9_0 branch from 88dc2c3 to 8c1ba15 Compare July 20, 2026 13:22
@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [58774048]: BUILD STARTED

@mzient
mzient marked this pull request as ready for review July 20, 2026 13:39
@mzient

mzient commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator Author

@greptileai Please review again

@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [58785890]: BUILD STARTED

@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [58785874]: BUILD STARTED

@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [58774048]: BUILD PASSED

@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [58785890]: BUILD PASSED

@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [58785874]: BUILD PASSED

@mzient mzient changed the title Nvimgcodec 0 9 0 Upgrade nvimgcodec to 0.9.0 Jul 21, 2026
@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [58896425]: BUILD STARTED

@JanuszL JanuszL self-assigned this Jul 21, 2026
URL https://developer.download.nvidia.com/compute/nvimgcodec/redist/nvimgcodec/linux-x86_64/nvimgcodec-linux-x86_64-0.8.0.22-archive.tar.xz
URL_HASH SHA512=2a400f75c619a10c3dbcd298a83ef3307f6e08453b2cfb5040f6b22c64c7be0ac4552a2a80ed057afe7657cf0bb8cc2d54cdccf8bc50ffdf34cfd05b45082978
)
if ("${CUDA_VERSION_MAJOR}" EQUAL "13")

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now there are separate archives for CUDA 12 and 13.

@dali-automaton

Copy link
Copy Markdown
Collaborator

CI MESSAGE: [58896425]: BUILD PASSED

@mzient
mzient merged commit e0c8566 into NVIDIA:main Jul 21, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants