Skip to content

Commit

Permalink
Correct nvimagecodec version in conda and in installation instruction…
Browse files Browse the repository at this point in the history
… message (#5714)

Signed-off-by: Joaquin Anton Guirao <janton@nvidia.com>
  • Loading branch information
jantonguirao authored Nov 18, 2024
1 parent 2d07f81 commit 7fd3876
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 18 deletions.
2 changes: 1 addition & 1 deletion conda/third_party/dali_nvimagecodec/recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.


{% set build_version = "0.2.0" %}
{% set build_version = "0.3.0" %}

package:
name: nvidia-nvimagecodec-cuda{{ environ.get('CUDA_VERSION', '') | replace(".","") }}
Expand Down
7 changes: 5 additions & 2 deletions dali/nvimgcodec/nvimgcodec_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,14 @@ NVIMGCODECDRIVER loadNvimgcodecLibrary() {
if (ret)
break;
}
if (!ret)

if (!ret) {
int cuda_version_major = CUDA_VERSION / 1000; // 11020 -> 11, 12000 -> 12
throw std::runtime_error(
"dlopen libnvimgcodec.so failed!. Please install nvimagecodec: See "
"https://developer.nvidia.com/nvimgcodec-downloads or simply do `pip install "
"nvidia-nvimgcodec-cu${CUDA_MAJOR_VERSION}`.");
"nvidia-nvimgcodec-cu" + std::to_string(cuda_version_major) + "`.");
}
return ret;
}

Expand Down
13 changes: 0 additions & 13 deletions dali/operators/imgcodec/decoder_schema.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ Values will be converted to the dynamic range of the requested type.)code",
.AddOptionalArg("memory_stats", "", false)
.DeprecateArg("memory_stats", false); // deprecated since in Nov 2022


DALI_SCHEMA(experimental__decoders__Image)
.DocStr(R"code(Decodes images.
Expand All @@ -149,9 +148,6 @@ Supported formats: JPEG, JPEG 2000, TIFF, PNG, BMP, PNM, PPM, PGM, PBM, WebP.
The output of the decoder is in *HWC* layout.
The implementation uses NVIDIA nvImageCodec to decode images.
You need to install it separately. See https://developer.nvidia.com/nvimgcodec-downloads
or simply do `pip install nvidia-nvimgcodec-cu${CUDA_MAJOR_VERSION}` where
CUDA_MAJOR_VERSION is your CUDA major version (e.g. 12).
.. note::
GPU accelerated decoding is only available for a subset of the image formats (JPEG, and JPEG2000).
Expand All @@ -176,9 +172,6 @@ Supported formats: JPEG, JPEG 2000, TIFF, PNG, BMP, PNM, PPM, PGM, PBM, WebP.
The output of the decoder is in *HWC* layout.
The implementation uses NVIDIA nvImageCodec to decode images.
You need to install it separately. See https://developer.nvidia.com/nvimgcodec-downloads
or simply do `pip install nvidia-nvimgcodec-cu${CUDA_MAJOR_VERSION}` where
CUDA_MAJOR_VERSION is your CUDA major version (e.g. 12).
When possible, the operator uses the ROI decoding, reducing the decoding time and memory consumption.
Expand Down Expand Up @@ -207,9 +200,6 @@ Supported formats: JPEG, JPEG 2000, TIFF, PNG, BMP, PNM, PPM, PGM, PBM, WebP.
The output of the decoder is in *HWC* layout.
The implementation uses NVIDIA nvImageCodec to decode images.
You need to install it separately. See https://developer.nvidia.com/nvimgcodec-downloads
or simply do `pip install nvidia-nvimgcodec-cu${CUDA_MAJOR_VERSION}` where
CUDA_MAJOR_VERSION is your CUDA major version (e.g. 12).
The slice can be specified by proving the start and end coordinates, or start coordinates
and shape of the slice. Both coordinates and shapes can be provided in absolute or relative terms.
Expand Down Expand Up @@ -280,9 +270,6 @@ Supported formats: JPEG, JPEG 2000, TIFF, PNG, BMP, PNM, PPM, PGM, PBM, WebP.
The output of the decoder is in *HWC* layout.
The implementation uses NVIDIA nvImageCodec to decode images.
You need to install it separately. See https://developer.nvidia.com/nvimgcodec-downloads
or simply do `pip install nvidia-nvimgcodec-cu${CUDA_MAJOR_VERSION}` where
CUDA_MAJOR_VERSION is your CUDA major version (e.g. 12).
The cropping window's area (relative to the entire image) and aspect ratio can be restricted to
a range of values specified by ``area`` and ``aspect_ratio`` arguments, respectively.
Expand Down
5 changes: 3 additions & 2 deletions dali/operators/operators.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,14 @@ DLL_PUBLIC void EnforceMinimumNvimgcodecVersion() {
int minor = NVIMGCODEC_MINOR_FROM_SEMVER(version);
int patch = NVIMGCODEC_PATCH_FROM_SEMVER(version);

int cuda_version_major = CUDA_VERSION / 1000; // 11020 -> 11, 12000 -> 12
if (version < NVIMGCODEC_VER) {
std::stringstream ss;
ss << "DALI requires nvImageCodec at minimum version" << NVIMGCODEC_VER_MAJOR << "."
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}=="
"`pip install nvidia-nvimgcodec-cu" + std::to_string(cuda_version_major) + "~="
<< NVIMGCODEC_VER_MAJOR << "." << NVIMGCODEC_VER_MINOR << "." << NVIMGCODEC_VER_PATCH
<< "`.";
throw std::runtime_error(ss.str());
Expand Down

0 comments on commit 7fd3876

Please sign in to comment.