Skip to content

Commit 1c36776

Browse files
committed
Merge branch 'release_v0.3.0' into 'main'
sync with internal nvimagecodec repo release_v0.3.0 branch (commit c80dfc7) See merge request cuda-hpc-libraries/nvimagecodec-public!2
2 parents e61f259 + 4c278b7 commit 1c36776

171 files changed

Lines changed: 7706 additions & 4407 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE/bug_report_form.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ body:
2828
attributes:
2929
label: Version
3030
description: What version of nvImageCodec are you running?
31-
placeholder: "example: 0.2.0"
31+
placeholder: "example: 0.3.0"
3232
validations:
3333
required: true
3434

.gitmodules

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
[submodule "external/pybind11"]
2-
path = external/pybind11
3-
url = https://github.com/pybind/pybind11.git
1+
[submodule "python/pybind11"]
2+
path = external/pybind11
3+
url = https://github.com/pybind/pybind11.git
44
[submodule "external/NVTX"]
5-
path = external/NVTX
6-
url = https://github.com/NVIDIA/NVTX.git
7-
branch = release-v3
5+
path = external/NVTX
6+
url = https://github.com/NVIDIA/NVTX.git
7+
branch = release-v3
88
[submodule "external/googletest"]
9-
path = external/googletest
10-
url = https://github.com/google/googletest.git
11-
branch = main
9+
path = external/googletest
10+
url = https://github.com/google/googletest.git
11+
branch = main
1212
[submodule "external/dlpack"]
13-
path = external/dlpack
14-
url = https://github.com/dmlc/dlpack.git
13+
path = external/dlpack
14+
url = https://github.com/dmlc/dlpack.git
1515
[submodule "external/boost/preprocessor"]
16-
path = external/boost/preprocessor
17-
url = https://github.com/boostorg/preprocessor
16+
path = external/boost/preprocessor
17+
url = https://github.com/boostorg/preprocessor
1818
[submodule "external/libjpeg-turbo"]
19-
path = external/libjpeg-turbo
20-
url = https://github.com/libjpeg-turbo/libjpeg-turbo.git
21-
branch = main
19+
path = external/libjpeg-turbo
20+
url = https://github.com/libjpeg-turbo/libjpeg-turbo.git
21+
branch = main
2222
[submodule "external/openjpeg"]
23-
path = external/openjpeg
24-
url = https://github.com/uclouvain/openjpeg.git
23+
path = external/openjpeg
24+
url = https://github.com/uclouvain/openjpeg.git
2525
[submodule "external/opencv"]
26-
path = external/opencv
27-
url = https://github.com/opencv/opencv.git
26+
path = external/opencv
27+
url = https://github.com/opencv/opencv.git
2828
[submodule "external/libtiff"]
29-
path = external/libtiff
30-
url = https://gitlab.com/libtiff/libtiff.git
29+
path = external/libtiff
30+
url = https://gitlab.com/libtiff/libtiff.git
3131
[submodule "external/zstd"]
32-
path = external/zstd
33-
url = https://github.com/facebook/zstd.git
32+
path = external/zstd
33+
url = https://github.com/facebook/zstd.git
3434
[submodule "external/zlib"]
35-
path = external/zlib
36-
url = https://github.com/madler/zlib.git
35+
path = external/zlib
36+
url = https://github.com/madler/zlib.git

CMakeLists.txt

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@
1515

1616
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
1717

18+
include(CMakeDependentOption)
19+
1820
set(NVIMGCODEC_PROJECT_NAME "nvimgcodec")
19-
set(NVIMGCODEC_VERSION "0.2.0")
21+
set(NVIMGCODEC_VERSION "0.3.0")
2022

2123
if (NVIMGCODEC_FLAVOR)
22-
set(NVIMGCODEC_FLAVOR "${NVIMGCODEC_FLAVOR} ") # could be nightly, weekly, etc if necessary
24+
set(NVIMGCODEC_FLAVOR "${NVIMGCODEC_FLAVOR}") # could be nightly, weekly, etc if necessary
2325
set(NVIMGCODEC_FLAVOR_MINUS "-${NVIMGCODEC_FLAVOR}") # -nightly, -weekly, etc
2426
endif()
2527

@@ -31,7 +33,11 @@ if (NOT ARCH)
3133
endif()
3234

3335
if (NOT NVIMGCODEC_WHL_PLATFORM_NAME)
34-
set(NVIMGCODEC_WHL_PLATFORM_NAME "manylinux2014_${ARCH}")
36+
if(UNIX)
37+
set(NVIMGCODEC_WHL_PLATFORM_NAME "manylinux2014_${ARCH}")
38+
else()
39+
set(NVIMGCODEC_WHL_PLATFORM_NAME "win_amd64")
40+
endif()
3541
endif()
3642

3743
if(NOT BUILD_ID)
@@ -69,7 +75,6 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
6975
endif()
7076

7177
if(WIN32)
72-
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
7378
# XXX: cmake appends /MT after /MD that produces D9025 warnings about overriding flags, hence...
7479
string(REGEX REPLACE "/MD " "" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
7580
string(REGEX REPLACE "/MDd " "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
@@ -90,15 +95,21 @@ option(BUILD_LIBTIFF_EXT "Build libtiff extensions module" ON)
9095
option(BUILD_OPENCV_EXT "Build opencv extensions module" ON)
9196
option(BUILD_PYTHON "Build Python binding" ON)
9297
option(BUILD_WHEEL "Build python wheel package" ON)
93-
option(WITH_DYNAMIC_NVJPEG "Dynamically loads nvjpeg at runtime" ON)
98+
99+
cmake_dependent_option(WITH_DYNAMIC_NVJPEG "Dynamically loads nvjpeg at runtime" ON
100+
"BUILD_NVJPEG_EXT" OFF)
94101
propagate_option(WITH_DYNAMIC_NVJPEG)
95-
option(WITH_DYNAMIC_NVJPEG2K "Dynamically loads nvjpeg2k at runtime" OFF)
102+
cmake_dependent_option(WITH_DYNAMIC_NVJPEG2K "Dynamically loads nvjpeg2k at runtime" ON
103+
"BUILD_NVJPEG2K_EXT" OFF)
96104
propagate_option(WITH_DYNAMIC_NVJPEG2K)
97105

98106
string(TOLOWER ${CMAKE_SYSTEM_NAME} SYS_NAME)
99107

100108
if(WIN32)
101109
set(CPACK_GENERATOR "ZIP")
110+
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
111+
set(CMAKE_INSTALL_PREFIX "C:\\Program Files\\nvimgcodec_cuda${CUDA_VERSION_MAJOR}" CACHE PATH "where nvImageCodec will be installed" FORCE)
112+
endif()
102113
else()
103114
set(CPACK_GENERATOR "TGZ;DEB")
104115

@@ -183,9 +194,9 @@ endif()
183194
CUDA_get_cmake_cuda_archs(CMAKE_CUDA_ARCHITECTURES ${CUDA_targeted_archs})
184195
message(STATUS "Generated CMAKE_CUDA_ARCHITECTURES: ${CMAKE_CUDA_ARCHITECTURES}")
185196

186-
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --compiler-options \"-fvisibility=hidden -Wno-free-nonheap-object\" --Wno-deprecated-gpu-targets -Xfatbin -compress-all")
187-
188197
if(WIN32)
198+
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --Wno-deprecated-gpu-targets -Xfatbin -compress-all")
199+
189200
include(third_party/generate_product_version)
190201

191202
generate_product_version(ProductVersionFiles
@@ -195,6 +206,9 @@ if(WIN32)
195206
VERSION_PATCH ${CMAKE_PROJECT_VERSION_PATCH}
196207
VERSION_REVISION ${CMAKE_PROJECT_VERSION_TWEAK}
197208
COMPANY_NAME NVIDIA Corporation)
209+
elseif()
210+
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --compiler-options \"-fvisibility=hidden -Wno-free-nonheap-object\" --Wno-deprecated-gpu-targets -Xfatbin -compress-all")
211+
198212
endif()
199213

200214
set(CMAKE_CXX_STANDARD 20)
@@ -205,6 +219,9 @@ set(CMAKE_CUDA_STANDARD 14)
205219
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
206220
set(CMAKE_CUDA_EXTENSIONS OFF)
207221

222+
list(APPEND CMAKE_BUILD_RPATH $ORIGIN)
223+
list(APPEND CMAKE_INSTALL_RPATH $ORIGIN)
224+
208225
include_directories(
209226
${PROJECT_SOURCE_DIR}
210227
${PROJECT_SOURCE_DIR}/include

README.md

Lines changed: 83 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
# nvImageCodec
22

3+
![Version](https://img.shields.io/badge/Version-v0.3.0--beta-blue)
34
[![License](https://img.shields.io/badge/License-Apache_2.0-yellogreen.svg)](https://opensource.org/licenses/Apache-2.0)
45

5-
![Version](https://img.shields.io/badge/Version-v0.2.0--beta-blue)
6+
![Platform](https://img.shields.io/badge/Platform-linux--x86__64_%7C_linux--aarch64_%7C_windows--64_wsl2_%7C_windows--64-blue)
67

7-
![Platform](https://img.shields.io/badge/Platform-linux--x86__64_%7C_linux--aarch64_%7C_windows--64_wsl2-gray)
8-
9-
[![Cuda](https://img.shields.io/badge/CUDA-v11.8_%7c_v12.3-%2376B900?logo=nvidia)](https://developer.nvidia.com/cuda-toolkit-archive)
8+
[![Cuda](https://img.shields.io/badge/CUDA-v11.8_%7c_v12.5-%2376B900?logo=nvidia)](https://developer.nvidia.com/cuda-toolkit-archive)
109
[![GCC](https://img.shields.io/badge/GCC->=v9.0-yellow)](https://gcc.gnu.org/gcc-9/)
11-
[![Python](https://img.shields.io/badge/python-v3.8_%7c_v3.9_%7c_v3.10_%7c_v3.11_%7c_v3.12-blue?logo=python)](https://www.python.org/)
1210
[![CMake](https://img.shields.io/badge/CMake->=v3.18-%23008FBA?logo=cmake)](https://cmake.org/)
1311

12+
13+
[![Python](https://img.shields.io/badge/python-v3.8_%7c_v3.9_%7c_v3.10_%7c_v3.11_%7c_v3.12-blue?logo=python)](https://www.python.org/)
14+
![PyPI - Wheel](https://img.shields.io/pypi/wheel/nvidia-nvimgcodec-cu12?pypiBaseUrl=https%3A%2F%2Fpypi.org&label=PyPI&link=https%3A%2F%2Fpypi.org%2Fsearch%2F%3Fq%3Dnvidia-nvimgcodec-cu12)
15+
16+
1417
The nvImageCodec is an open-source library of accelerated codecs with unified interface.
1518
It is designed as a framework for extension modules which delivers codec plugins.
1619

@@ -85,8 +88,14 @@ This section describes the recommended dependencies to use nvImageCodec.
8588
- RHEL 8, 9
8689
- SLES 15
8790
- Ubuntu 20.04, 22.04
91+
- aarch64-jetson (CUDA Toolkit >= 12.0)
92+
- Ubuntu 22.04
93+
- Windows
94+
- x86_64
95+
- [Microsoft Visual C++ Redistributable](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170)
8896
- NVIDIA driver >= 520.56.06
8997
- CUDA Toolkit > = 11.8
98+
- nvJPEG2000 >= 0.8.0
9099
- Python >= 3.8
91100

92101
## Install nvImageCodec library
@@ -127,21 +136,49 @@ Install nvJPEG for CUDA 12.x
127136
pip install nvidia-nvjpeg-cu12
128137
```
129138

139+
### Optional installation of nvJPEG2000 library
140+
141+
[nvJPEG2000 library](https://developer.nvidia.com/nvjpeg2000-downloads) can be installed in the system, or installed as a Python package. For the latter, follow the instructions below.
142+
143+
Install nvJPEG2000 for CUDA 11.x
144+
145+
```
146+
pip install nvidia-nvjpeg2k-cu11
147+
```
148+
149+
Install nvJPEG2000 for CUDA 12.x
150+
151+
```
152+
pip install nvidia-nvjpeg2k-cu12
153+
```
154+
155+
Install nvJPEG2000 for CUDA 12.x on Tegra platforms
156+
157+
```
158+
pip install nvidia-nvjpeg2k-tegra-cu12
159+
```
160+
161+
Please see also [nvJPEG2000 installation documentation](https://docs.nvidia.com/cuda/nvjpeg2000/userguide.html#installing-nvjpeg2000) for more information
162+
163+
130164
### Documentation
131165

132166
[NVIDIA nvImageCodec Documentation](https://docs.nvidia.com/cuda/nvimagecodec/)
133167

134168
## Build and install from Sources
135169

136170
### Additional pre-requisites
137-
- GCC >= 9.4
138-
- cmake >= 3.18
139-
- patchelf >= 0.17.2
171+
- Linux
172+
- GCC >= 9.4
173+
- cmake >= 3.18
174+
- patchelf >= 0.17.2
175+
- Windows
176+
- [Microsoft Visual Studio 2022 Build Tools](https://aka.ms/vs/17/release/vs_buildtools.exe)
140177
- Dependencies for extensions. If you would not like to build particular extension you can skip it.
141-
- nvJPEG2000 >= 0.7.0
178+
- nvJPEG2000 >= 0.8.0
142179
- libjpeg-turbo >= 2.0.0
143180
- libtiff >= 4.5.0
144-
- opencv >= 4.7.0
181+
- opencv >= 4.10.0
145182
- Python packages:
146183
- clang==14.0.1
147184
- wheel
@@ -156,6 +193,8 @@ Please see also Dockerfiles.
156193

157194
### Build
158195

196+
#### Linux
197+
159198
```
160199
git lfs clone https://github.com/NVIDIA/nvImageCodec.git
161200
cd nvimagecodec
@@ -166,20 +205,30 @@ export CUDACXX=nvcc
166205
cmake .. -DCMAKE_BUILD_TYPE=Release
167206
make
168207
```
169-
170-
#### Build CVCUDA samples
208+
##### Build CVCUDA samples
171209

172210
To build CV-CUDA samples, additionally CV-CUDA has to be installed and CVCUDA_DIR and NVCV_TYPES_DIR
173211
need to point folders with *-config.cmake files. Apart of that, BUILD_CVCUDA_SAMPLES variable must be set to ON.
174212

213+
#### Windows
214+
215+
Open Developer Command Prompt for VS 2022
216+
217+
```
218+
git lfs clone https://github.com/NVIDIA/nvImageCodec.git
219+
cd nvimagecodec
220+
git submodule update --init --recursive --depth 1
221+
.\externa\build_deps.bat
222+
.\docker\build_helper.bat .\build 12
223+
```
175224

176225
## Build Python wheel
177226

178227
After succesfully built project, execute below commands.
179228

180229
```
181230
cd build
182-
make wheel
231+
cmake --build . --target wheel
183232
```
184233

185234
## Packaging
@@ -197,25 +246,25 @@ This will generate in build directory *.zip or *tar.xz files
197246
#### Tar file installation
198247

199248
```
200-
tar -xvf nvimgcodec-0.2.0.0-cuda12-x86_64-linux-lib.tar.gz -C /opt/nvidia/
249+
tar -xvf nvimgcodec-0.3.0.0-cuda12-x86_64-linux-lib.tar.gz -C /opt/nvidia/
201250
```
202251

203252
#### DEB File Installation
204253
```
205-
sudo apt-get install -y ./nvimgcodec-0.2.0.0-cuda12-x86_64-linux-lib.deb
254+
sudo apt-get install -y ./nvimgcodec-0.3.0.0-cuda12-x86_64-linux-lib.deb
206255
```
207256
#### Python WHL File Installation
208257

209258
```
210-
pip install nvidia_nvimgcodec_cu12-0.2.0-py3-none-manylinux2014_x86_64.whl
259+
pip install nvidia_nvimgcodec_cu12-0.3.0-py3-none-manylinux2014_x86_64.whl
211260
```
212261

213262
### Installation from sources
214263

215264
##### Linux
216265
```
217266
cd build
218-
cmake --install . --config Release -prefix /opt/nvidia/nvimgcodec_<major_cuda_ver>
267+
cmake --install . --config Release --prefix /opt/nvidia/nvimgcodec_<major_cuda_ver>
219268
```
220269

221270
After execution there should be:
@@ -228,6 +277,21 @@ Add directory with libnvimgcodec.so to LD_LIBRARY_PATH
228277
export LD_LIBRARY_PATH=/opt/nvidia/nvimgcodec_cuda<major_cuda_ver>/lib64:$LD_LIBRARY_PATH
229278
```
230279

280+
##### Windows
281+
282+
Open Developer Command Prompt for VS 2022
283+
284+
```
285+
cd build
286+
cmake --install . --config Release --prefix "c:\Program Files\nvimgcodec_cuda<major_cuda_ver>"
287+
```
288+
289+
After execution there should be:
290+
291+
- all extension modules in c:\Program Files\nvimgcodec_cuda<major_cuda_ver>/extensions (it is default directory for extension discovery)
292+
- nvimgcodec_0.dll in c:\Program Files\nvimgcodec_cuda<major_cuda_ver>\bin
293+
294+
Add directory with nvimgcodec_0.dll to PATH
231295

232296
## Testing
233297
Run CTest to execute L0 and L1 tests
@@ -243,7 +307,7 @@ cd build
243307
cmake --install . --config Release --prefix bin
244308
cd bin/test
245309
246-
LD_LIBRARY_PATH=$PWD/../lib64 pytest -v test_transcoder.py
310+
LD_LIBRARY_PATH=$PWD/../lib64 pytest -v test_transcode.py
247311
248312
```
249313

@@ -252,7 +316,7 @@ Run Python API tests
252316
First install python wheel. You would also need to have installed all Python tests dependencies (see Dockerfiles).
253317

254318
```
255-
pip install nvidia_nvimgcodec_cu12-0.2.0.x-py3-none-manylinux2014_x86_64.whl
319+
pip install nvidia_nvimgcodec_cu12-0.3.0.x-py3-none-manylinux2014_x86_64.whl
256320
```
257321

258322
Run tests

0 commit comments

Comments
 (0)