Skip to content

Commit

Permalink
Fix nvimgcodec version check, do not install it separately in tests e…
Browse files Browse the repository at this point in the history
…nv (#5713)

* Do not install nvimgcodec separately in tests env
* Fix version check
* Use nvimgcodec 0.3 headers
---------

Signed-off-by: Kamil Tokarski <[email protected]>
Signed-off-by: Joaquin Anton Guirao <[email protected]>
Co-authored-by: Joaquin Anton Guirao <[email protected]>
  • Loading branch information
stiepan and jantonguirao committed Nov 14, 2024
1 parent e0ca4e4 commit a0feb6c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cmake/Dependencies.common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ if(BUILD_NVIMAGECODEC)
include(FetchContent)
FetchContent_Declare(
nvimgcodec_headers
URL https://developer.download.nvidia.com/compute/nvimgcodec/redist/nvimgcodec/linux-x86_64/nvimgcodec-linux-x86_64-0.2.0.6-archive.tar.xz
URL_HASH SHA512=6577a8ff5589400cdf5767aa4a507245527a96e48065f23f626dfc6ba13b136960cacfe7f61c345dc158ed0352e1e971834aec6fd98038649b08b250c3306aeb
URL https://developer.download.nvidia.com/compute/nvimgcodec/redist/nvimgcodec/linux-x86_64/nvimgcodec-linux-x86_64-0.3.0.5-archive.tar.xz
URL_HASH SHA512=259bff93305c301fb4325c6e2f71da93f3f6e0b38c7c8739913ca70b5a9c74cc898a608c5ac6e830dba1739878e53607ded03deaf2f23af3a9cc473463f100eb
)
FetchContent_Populate(nvimgcodec_headers)
set(nvimgcodec_SEARCH_PATH "${nvimgcodec_headers_SOURCE_DIR}/${CUDA_VERSION_MAJOR}/include")
Expand Down
9 changes: 6 additions & 3 deletions dali/operators/operators.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,20 @@ DLL_PUBLIC void EnforceMinimumNvimgcodecVersion() {
if (version == -1) {
throw std::runtime_error("Failed to check the version of nvimgcodec.");
}

int major = NVIMGCODEC_MAJOR_FROM_SEMVER(version);
int minor = NVIMGCODEC_MINOR_FROM_SEMVER(version);
int patch = NVIMGCODEC_PATCH_FROM_SEMVER(version);
if (major < NVIMGCODEC_VER_MAJOR || minor < NVIMGCODEC_VER_MINOR ||
patch < NVIMGCODEC_VER_PATCH) {

if (version < NVIMGCODEC_VER) {
std::stringstream ss;
ss << "DALI requires nvImageCodec at minimum version" << NVIMGCODEC_VER_MAJOR << "."
<< NVIMGCODEC_VER_MINOR << "." << NVIMGCODEC_VER_PATCH << ", but got " << major << "."
<< minor << "." << patch
<< ". Please upgrade: See https://developer.nvidia.com/nvimgcodec-downloads or simply do "
"`pip install nvidia-nvimgcodec-cu${CUDA_MAJOR_VERSION} --upgrade`.";
"`pip install nvidia-nvimgcodec-cu${CUDA_MAJOR_VERSION}=="
<< NVIMGCODEC_VER_MAJOR << "." << NVIMGCODEC_VER_MINOR << "." << NVIMGCODEC_VER_PATCH
<< "`.";
throw std::runtime_error(ss.str());
}
#endif
Expand Down
1 change: 0 additions & 1 deletion qa/test_template_impl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ do
# or we just want to use CUDA from system, not wheels
# or we are in conda
version_ge "${CUDA_VERSION}" "110" && \
install_pip_pkg "pip install --upgrade nvidia-nvimgcodec-cu${DALI_CUDA_MAJOR_VERSION} -f /pip-packages" && \
if [ "$(uname -m)" == "x86_64" ] && [ -z "${DO_NOT_INSTALL_CUDA_WHEEL}" ] && [ -z "${CONDA_PREFIX}" ]; then
NPP_VERSION=$(if [[ $DALI_CUDA_MAJOR_VERSION == "12" ]]; then echo "==12.2.5.30"; else echo ""; fi)
install_pip_pkg "pip install --upgrade nvidia-npp-cu${DALI_CUDA_MAJOR_VERSION}${NPP_VERSION} \
Expand Down

0 comments on commit a0feb6c

Please sign in to comment.