MCPcopy Create free account
hub / github.com/NVIDIA/DALI / EnforceMinimumNvimgcodecVersion

Function EnforceMinimumNvimgcodecVersion

dali/operators/operators.cc:58–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58DLL_PUBLIC void EnforceMinimumNvimgcodecVersion() {
59#if NVIMAGECODEC_ENABLED
60 auto version = GetNvimgcodecVersion();
61 if (version == -1) {
62 throw std::runtime_error("Failed to check the version of nvimgcodec.");
63 }
64
65 int major = NVIMGCODEC_MAJOR_FROM_SEMVER(version);
66 int minor = NVIMGCODEC_MINOR_FROM_SEMVER(version);
67 int patch = NVIMGCODEC_PATCH_FROM_SEMVER(version);
68
69 int cuda_version_major = CUDA_VERSION / 1000; // 11020 -> 11, 12000 -> 12
70 if (version < NVIMGCODEC_VER) {
71 std::stringstream ss;
72 ss << "DALI requires nvImageCodec at minimum version " << NVIMGCODEC_VER_MAJOR << "."
73 << NVIMGCODEC_VER_MINOR << "." << NVIMGCODEC_VER_PATCH << ", but got " << major << "."
74 << minor << "." << patch
75 << ". Please upgrade: See https://developer.nvidia.com/nvimgcodec-downloads or simply do "
76 "`pip install nvidia-nvimgcodec-cu" + std::to_string(cuda_version_major) + "~="
77 << NVIMGCODEC_VER_MAJOR << "." << NVIMGCODEC_VER_MINOR << "." << NVIMGCODEC_VER_PATCH
78 << "`.";
79 throw std::runtime_error(ss.str());
80 }
81#endif
82}
83
84} // namespace dali
85

Callers 4

EnsureCodecsMethod · 0.85
SequenceParserMethod · 0.85
ImageDecoderMethod · 0.85

Calls 3

GetNvimgcodecVersionFunction · 0.85
strMethod · 0.80
to_stringFunction · 0.50

Tested by

no test coverage detected