-
Notifications
You must be signed in to change notification settings - Fork 70
[REVIEW] Feat: PR #2 Add GPU-accelerated TIFF decoding via nvImageCodec v0.6.0 for digital pathology #978
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
rapids-bot
merged 34 commits into
rapidsai:release/25.12
from
cdinea:feature/nvimagecodec-v0.6.0
Dec 4, 2025
Merged
[REVIEW] Feat: PR #2 Add GPU-accelerated TIFF decoding via nvImageCodec v0.6.0 for digital pathology #978
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
d25d71d
feat: Add GPU-accelerated TIFF decoding via nvImageCodec v0.6.0
cdinea e5248df
refactor: Remove unnecessary CUDA_INCLUDE_PATH from run script
cdinea 2f2f1e0
build: Add libnvimgcodec metapackage to capture run_exports
cdinea 9c698d1
refactor: Use cucim.__version__ instead of reading VERSION file
cdinea 184a11a
refactor: Use cucim.__version__ in test_philips_tiff.py
cdinea 417c715
build: Bump minimum CuPy version to 14.0.0
cdinea c550305
refactor: Remove AUTO_INSTALL_NVIMGCODEC feature
cdinea 785efe2
build: Update pyproject.toml for CuPy 14.0.0
cdinea d85de65
refactor: Use const string_views for spacing units
cdinea 5eb6a1d
Update cpp/plugins/cucim.kit.cuslide2/src/cuslide/nvimgcodec/nvimgcod…
cdinea 76dd669
refactor: Use reference to pointer for output_buffer parameter
cdinea 539f33f
test: Remove assertionn
cdinea 214d6fb
style: Update copyright header to SPDX format in test_philips_tiff.cpp
cdinea e3f25b2
build: Remove redundant libnvimgcodec0 dependency.
cdinea 0285c3b
style: Add braces to single-line if statements in TIFF parser.
cdinea 228864e
refactor: Remove unused tile-based decoding methods
cdinea e9b22e0
Revert "build: Update pyproject.toml for CuPy 14.0.0"
cdinea ffdabfa
Revert "build: Bump minimum CuPy version to 14.0.0"
cdinea d85c839
Revert "refactor: Remove unnecessary CUDA_INCLUDE_PATH from run script"
cdinea 3dc14fe
chore: Remove local environment-specific entries from .gitignore
cdinea 60874fe
test: Rename cuslide_tests to cuslide2_tests and enable tests
cdinea 73332f9
Rename cuslide_benchmarks to cuslide2_benchmarks for consistency
cdinea b8ae2dd
Fix pre-commit formatting: remove trailing whitespace
cdinea 4360b5c
Remove nvimgcodec_manager.h from CMakeLists.txt (file was removed in …
cdinea be1eb77
refactor: Remove unused codec library dependencies
cdinea 798d326
style: Remove redundant license line from config.h header
cdinea 085cb46
Update cpp/plugins/cucim.kit.cuslide2/tests/main.cpp
cdinea 2a8c0b7
Update cpp/plugins/cucim.kit.cuslide2/benchmarks/main.cpp
cdinea 5124f91
refactor: Remove incorrectly named config.cmake.in file
cdinea 6d84512
Update cpp/plugins/cucim.kit.cuslide2/src/cuslide/cuslide.h
cdinea 053238d
Update cpp/plugins/cucim.kit.cuslide2/tests/config.h
cdinea 6d2767d
Update cpp/plugins/cucim.kit.cuslide2/tests/test_read_region.cpp
cdinea 2f22839
style: Clean up main.cpp files for cuslide2egration.
cdinea 75515df
style: Add cuslide2-specific comments to cuslide.h.
cdinea File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| # | ||
| # cmake-format: off | ||
| # SPDX-FileCopyrightText: Copyright (c) 2020-2025, NVIDIA CORPORATION. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # cmake-format: on | ||
| # | ||
|
|
||
| if (NOT TARGET deps::nvimgcodec) | ||
| # First try to find it as a package | ||
| find_package(nvimgcodec QUIET) | ||
|
|
||
| if(nvimgcodec_FOUND) | ||
| # Use the found package | ||
| add_library(deps::nvimgcodec INTERFACE IMPORTED GLOBAL) | ||
| target_link_libraries(deps::nvimgcodec INTERFACE nvimgcodec::nvimgcodec) | ||
| message(STATUS "✓ nvImageCodec found via find_package") | ||
| else() | ||
| # Manual detection in various environments | ||
| set(NVIMGCODEC_LIB_PATH "") | ||
| set(NVIMGCODEC_INCLUDE_PATH "") | ||
|
|
||
| # Try conda environment detection (both Python packages and native packages) | ||
| if(DEFINED ENV{CONDA_BUILD}) | ||
| # Conda build environment | ||
| set(NVIMGCODEC_LIB_PATH "$ENV{PREFIX}/lib/libnvimgcodec.so.0") | ||
| set(NVIMGCODEC_INCLUDE_PATH "$ENV{PREFIX}/include/") | ||
| if(NOT EXISTS "${NVIMGCODEC_LIB_PATH}") | ||
| set(NVIMGCODEC_LIB_PATH "$ENV{PREFIX}/lib/libnvimgcodec.so") | ||
| endif() | ||
| elseif(DEFINED ENV{CONDA_PREFIX}) | ||
| # Active conda environment - try native package first | ||
| set(CONDA_NATIVE_ROOT "$ENV{CONDA_PREFIX}") | ||
| if(EXISTS "${CONDA_NATIVE_ROOT}/include/nvimgcodec.h") | ||
| set(NVIMGCODEC_INCLUDE_PATH "${CONDA_NATIVE_ROOT}/include/") | ||
| if(EXISTS "${CONDA_NATIVE_ROOT}/lib/libnvimgcodec.so.0") | ||
| set(NVIMGCODEC_LIB_PATH "${CONDA_NATIVE_ROOT}/lib/libnvimgcodec.so.0") | ||
| elseif(EXISTS "${CONDA_NATIVE_ROOT}/lib/libnvimgcodec.so") | ||
| set(NVIMGCODEC_LIB_PATH "${CONDA_NATIVE_ROOT}/lib/libnvimgcodec.so") | ||
| endif() | ||
| else() | ||
| # Fallback: try Python site-packages in conda environment | ||
| foreach(PY_VER "3.13" "3.12" "3.11" "3.10" "3.9") | ||
| set(CONDA_PYTHON_ROOT "$ENV{CONDA_PREFIX}/lib/python${PY_VER}/site-packages/nvidia/nvimgcodec") | ||
| if(EXISTS "${CONDA_PYTHON_ROOT}/include/nvimgcodec.h") | ||
| set(NVIMGCODEC_INCLUDE_PATH "${CONDA_PYTHON_ROOT}/include/") | ||
| if(EXISTS "${CONDA_PYTHON_ROOT}/lib/libnvimgcodec.so.0") | ||
| set(NVIMGCODEC_LIB_PATH "${CONDA_PYTHON_ROOT}/lib/libnvimgcodec.so.0") | ||
| elseif(EXISTS "${CONDA_PYTHON_ROOT}/lib/libnvimgcodec.so") | ||
| set(NVIMGCODEC_LIB_PATH "${CONDA_PYTHON_ROOT}/lib/libnvimgcodec.so") | ||
| endif() | ||
| break() | ||
| endif() | ||
| endforeach() | ||
| endif() | ||
| else() | ||
| # Try Python site-packages detection | ||
| find_package(Python3 COMPONENTS Interpreter) | ||
| if(Python3_FOUND) | ||
| execute_process( | ||
| COMMAND ${Python3_EXECUTABLE} -c "import site; print(site.getsitepackages()[0])" | ||
| OUTPUT_VARIABLE PYTHON_SITE_PACKAGES | ||
| OUTPUT_STRIP_TRAILING_WHITESPACE | ||
| ERROR_QUIET | ||
| ) | ||
|
|
||
| if(PYTHON_SITE_PACKAGES) | ||
| set(NVIMGCODEC_PYTHON_ROOT "${PYTHON_SITE_PACKAGES}/nvidia/nvimgcodec") | ||
| if(EXISTS "${NVIMGCODEC_PYTHON_ROOT}/include/nvimgcodec.h") | ||
| set(NVIMGCODEC_INCLUDE_PATH "${NVIMGCODEC_PYTHON_ROOT}/include/") | ||
| if(EXISTS "${NVIMGCODEC_PYTHON_ROOT}/lib/libnvimgcodec.so.0") | ||
| set(NVIMGCODEC_LIB_PATH "${NVIMGCODEC_PYTHON_ROOT}/lib/libnvimgcodec.so.0") | ||
| elseif(EXISTS "${NVIMGCODEC_PYTHON_ROOT}/lib/libnvimgcodec.so") | ||
| set(NVIMGCODEC_LIB_PATH "${NVIMGCODEC_PYTHON_ROOT}/lib/libnvimgcodec.so") | ||
| endif() | ||
| endif() | ||
| endif() | ||
| endif() | ||
|
|
||
| # System-wide installation fallback | ||
| if(NOT NVIMGCODEC_LIB_PATH) | ||
| if(EXISTS /usr/lib/x86_64-linux-gnu/libnvimgcodec.so.0) | ||
| set(NVIMGCODEC_LIB_PATH /usr/lib/x86_64-linux-gnu/libnvimgcodec.so.0) | ||
| set(NVIMGCODEC_INCLUDE_PATH "/usr/include/") | ||
| elseif(EXISTS /usr/lib/aarch64-linux-gnu/libnvimgcodec.so.0) | ||
| set(NVIMGCODEC_LIB_PATH /usr/lib/aarch64-linux-gnu/libnvimgcodec.so.0) | ||
| set(NVIMGCODEC_INCLUDE_PATH "/usr/include/") | ||
| elseif(EXISTS /usr/lib64/libnvimgcodec.so.0) # CentOS (x86_64) | ||
| set(NVIMGCODEC_LIB_PATH /usr/lib64/libnvimgcodec.so.0) | ||
| set(NVIMGCODEC_INCLUDE_PATH "/usr/include/") | ||
| endif() | ||
| endif() | ||
| endif() | ||
|
|
||
| # Create the target if we found the library | ||
| if(NVIMGCODEC_LIB_PATH AND EXISTS "${NVIMGCODEC_LIB_PATH}") | ||
| add_library(deps::nvimgcodec SHARED IMPORTED GLOBAL) | ||
| set_target_properties(deps::nvimgcodec PROPERTIES | ||
| IMPORTED_LOCATION "${NVIMGCODEC_LIB_PATH}" | ||
| INTERFACE_INCLUDE_DIRECTORIES "${NVIMGCODEC_INCLUDE_PATH}" | ||
| ) | ||
| message(STATUS "✓ nvImageCodec found:") | ||
| message(STATUS " Library: ${NVIMGCODEC_LIB_PATH}") | ||
| message(STATUS " Headers: ${NVIMGCODEC_INCLUDE_PATH}") | ||
| else() | ||
| # Create a dummy target to prevent build failures | ||
| add_library(deps::nvimgcodec INTERFACE IMPORTED GLOBAL) | ||
| message(STATUS "✗ nvImageCodec not found - GPU acceleration disabled") | ||
| message(STATUS "To enable nvImageCodec support:") | ||
| message(STATUS " Option 1 (conda): conda install libnvimgcodec-dev -c conda-forge") | ||
| message(STATUS " Option 2 (pip): pip install nvidia-nvimgcodec-cu12[all]") | ||
| endif() | ||
| endif() | ||
| endif() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| AccessModifierOffset: -4 | ||
| AlignAfterOpenBracket: Align | ||
| AlignConsecutiveAssignments: false | ||
| AlignConsecutiveDeclarations: false | ||
| AlignEscapedNewlinesLeft: false | ||
| AlignTrailingComments: false | ||
| AllowAllParametersOfDeclarationOnNextLine: true | ||
| AllowShortFunctionsOnASingleLine: false | ||
| AllowShortIfStatementsOnASingleLine: false | ||
| AllowShortCaseLabelsOnASingleLine : false | ||
| AllowShortLoopsOnASingleLine: false | ||
| AlwaysBreakAfterDefinitionReturnType: false | ||
| AlwaysBreakBeforeMultilineStrings: true | ||
| AlwaysBreakTemplateDeclarations: true | ||
| BinPackArguments: true | ||
| BinPackParameters: false | ||
| BreakBeforeBinaryOperators: false | ||
| BreakBeforeBraces: Custom | ||
| BraceWrapping: | ||
| AfterClass: true | ||
| AfterControlStatement: true | ||
| AfterEnum: true | ||
| AfterFunction: true | ||
| AfterNamespace: true | ||
| AfterObjCDeclaration: true | ||
| AfterStruct: true | ||
| AfterUnion: true | ||
| AfterExternBlock: true | ||
| BeforeCatch: true | ||
| BeforeElse: true | ||
| IndentBraces: false | ||
| SplitEmptyFunction: true | ||
| SplitEmptyRecord: true | ||
| SplitEmptyNamespace : true | ||
| BreakBeforeTernaryOperators: false | ||
| BreakConstructorInitializersBeforeComma: false | ||
| BreakStringLiterals: false | ||
| ColumnLimit: 120 | ||
| CommentPragmas: '' | ||
| ConstructorInitializerAllOnOneLineOrOnePerLine: true | ||
| ConstructorInitializerIndentWidth: 4 | ||
| ContinuationIndentWidth: 4 | ||
| Cpp11BracedListStyle: false | ||
| DerivePointerBinding: false | ||
| FixNamespaceComments: true | ||
| IndentCaseLabels: false | ||
| IndentPPDirectives: AfterHash | ||
| IndentFunctionDeclarationAfterType: false | ||
| IndentWidth: 4 | ||
| SortIncludes: false | ||
| IncludeCategories: | ||
| - Regex: '[<"](.*\/)?Defines.h[>"]' | ||
| Priority: 1 | ||
| # - Regex: '<cuslide\/.+>' | ||
| # Priority: 3 | ||
| - Regex: '<[[:alnum:]_.]+>' | ||
| Priority: 5 | ||
| - Regex: '<[[:alnum:]_.\/]+>' | ||
| Priority: 4 | ||
| - Regex: '".*"' | ||
| Priority: 2 | ||
| IncludeBlocks: Regroup | ||
| Language: Cpp | ||
| MaxEmptyLinesToKeep: 2 | ||
| NamespaceIndentation: None | ||
| ObjCSpaceAfterProperty: true | ||
| ObjCSpaceBeforeProtocolList: true | ||
| PenaltyBreakBeforeFirstCallParameter: 0 | ||
| PenaltyBreakComment: 1 | ||
| PenaltyBreakFirstLessLess: 0 | ||
| PenaltyBreakString: 1 | ||
| PenaltyExcessCharacter: 10 | ||
| PenaltyReturnTypeOnItsOwnLine: 1000 | ||
| PointerAlignment: Left | ||
| SpaceBeforeAssignmentOperators: true | ||
| SpaceBeforeParens: ControlStatements | ||
| SpaceInEmptyParentheses: false | ||
| SpacesBeforeTrailingComments: 1 | ||
| SpacesInAngles: false | ||
| SpacesInCStyleCastParentheses: false | ||
| SpacesInContainerLiterals: false | ||
| SpacesInParentheses: false | ||
| Standard: Cpp11 | ||
| ReflowComments: true | ||
| TabWidth: 4 | ||
| UseTab: Never |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| [*] | ||
| indent_style = space | ||
| indent_size = 4 | ||
| charset = utf-8 | ||
| trim_trailing_whitespace = true | ||
| max_line_length = 120 | ||
| insert_final_newline = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| cmake-build* | ||
| install |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.