-
Notifications
You must be signed in to change notification settings - Fork 70
Forward-merge release/25.12 into main #987
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
Merged
Conversation
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
# Feature: nvImageCodec Infrastructure Setup for cuslide2
This PR adds the infrastructure and build system support for integrating nvImageCodec into the cuslide2 plugin. This is a foundational PR that sets up the dependencies, CMake configuration, and conda packaging without implementing the actual nvImageCodec functionality in the plugin.
## Changes Overview
### 1. Dependency Management
- Added nvImageCodec dependencies to `dependencies.yaml`:
- `libnvimgcodec` (runtime library)
- `libnvimgcodec-dev` (development headers)
- `libnvimgcodec0` (base library)
- Regenerated all conda environment files from dependencies
### 2. Build System Updates
- Updated `cpp/plugins/cucim.kit.cuslide2/CMakeLists.txt` with nvImageCodec integration
- Added CMake dependency files in `cpp/plugins/cucim.kit.cuslide2/cmake/deps/`:
- `cli11.cmake`, `catch2.cmake`, `boost.cmake`
- `fmt.cmake`, `json.cmake`, `pugixml.cmake`
- `libdeflate.cmake`, `libtiff.cmake`, `libopenjpeg.cmake`
- `googletest.cmake`, `googlebenchmark.cmake`, `openslide.cmake`
- Policy fix files for libjpeg-turbo and libtiff
### 3. Python Package Updates
- Updated `python/cucim/pyproject.toml` with nvImageCodec dependencies
- Ensured Python bindings are ready for future nvImageCodec integration
### 4. Verification Script
- Added `scripts/verify_cuslide2_infrastructure.py` - comprehensive infrastructure verification tool
- Checks nvImageCodec installation, library files, CMake configuration, CUDA environment, and plugin build
## Setup and Verification Instructions
### Prerequisites
- Micromamba or conda/mamba package manager
- NVIDIA GPU with appropriate drivers
### Step 1: Create and Activate Environment
```bash
# Create conda environment with all dependencies based on your CUDA system version - use all_cuda-130 for CUDA 13 and all_cuda-129 for CUDA 12
conda env create -n cucim -f ./conda/environments/all_cuda-130_arch-x86_64.yaml
# Activate environment
conda activate cucim
```
**Build cuslide2 Plugin:**
```bash
```bash
# Set compilers to use conda environment versions
export CC=$CONDA_PREFIX/bin/gcc
export CXX=$CONDA_PREFIX/bin/g++
# Set CUDA compiler (uses conda's CUDA toolkit)
export CUDACXX=$CONDA_PREFIX/pkgs/cuda-toolkit/bin/nvcc
# Build libcucim + cuslide2 plugin
./run build_local all release $CONDA_PREFIX
```
**Install Python Package:**
```bash
# Install in editable mode for development
python -m pip install --editable python/cucim
```
**Note**: The `build_local` script will:
- Install nvImageCodec packages (libnvimgcodec, libnvimgcodec-dev, libnvimgcodec0) from conda-forge based on `dependencies.yaml`
- Install additional Python and C++ dependencies from `dependencies.yaml`
- Configure and build the C++ library including the cuslide2 plugin
- Build and install the Python package
### Step 5: Run Verification Script
```bash
# From the repository root
python scripts/verify_cuslide2_infrastructure.py
```
## Verification Output
When the infrastructure is properly set up, the verification script produces the following output:
```
============================================================
cuslide2 Infrastructure Verification
============================================================
Platform: Linux 6.8.0-1029-gcp
Python: 3.10.19 | packaged by conda-forge | (main, Oct 22 2025, 22:29:10) [GCC 14.3.0]
----------------------------------------
nvImageCodec Installation Detection
----------------------------------------
✓ Method 1: Conda packages detected (from dependencies.yaml):
libnvimgcodec-dev 0.6.0 h0850aa4_0 conda-forge
libnvimgcodec0 0.6.0 hb7e823c_0 conda-forge
Environment: /home/cdinea/micromamba/envs/cucim-test3
----------------------------------------
nvImageCodec Library Files Check
----------------------------------------
✓ Header found: /home/cdinea/micromamba/envs/cucim-test3/include/nvimgcodec.h
✓ Library found: /home/cdinea/micromamba/envs/cucim-test3/lib/libnvimgcodec.so.0 (33.3 MB)
----------------------------------------
CMake Build Configuration Check
----------------------------------------
✓ CMake cache found: /home/cdinea/Downloads/cucim_pr1/cucim/cpp/plugins/cucim.kit.cuslide2/build-release/CMakeCache.txt
✓ nvImageCodec configuration found in CMake cache
AUTO_INSTALL_NVIMGCODEC:BOOL=ON
NVIMGCODEC_VERSION:STRING=0.6.0
nvimgcodec_DIR:PATH=/home/cdinea/micromamba/envs/cucim-test3/lib/cmake/nvimgcodec
----------------------------------------
CUDA Environment Check
----------------------------------------
✓ NVIDIA GPU detected:
| 0 NVIDIA RTX A6000 Off | 00000000:01:00.0 On | Off |
✓ CUDA compiler: Cuda compilation tools, release 12.9, V12.9.86
----------------------------------------
cuslide2 Plugin Check
----------------------------------------
ℹ️ Infrastructure-only build detected
✓ This build validates dependencies without generating plugin binary
✓ CMake configuration verified - dependencies checked
ℹ️ Plugin source code not yet added (planned for follow-up PR)
📋 Infrastructure-only build is working as intended!
----------------------------------------
Python Import Test
----------------------------------------
✓ nvidia.nvimgcodec module imported successfully
Version: 0.6.1
============================================================
Infrastructure Summary
============================================================
🎉 cuslide2 infrastructure validation PASSED!
✓ This is an infrastructure-only build
✓ CMake configuration verified
✓ All dependencies can be fetched/built
✓ nvImageCodec packages detected via conda
ℹ️ Note: Plugin binary intentionally not built in infrastructure-only mode
Actual plugin implementation will be added in follow-up PR
```
## Notes
- **This PR does NOT implement nvImageCodec functionality** - it only sets up the infrastructure
- The cuslide2 plugin builds successfully with nvImageCodec dependencies available
- Future PRs will add the actual nvImageCodec codec implementation
- All existing functionality remains unchanged
## Related Issues
This is part of the work to integrate nvImageCodec support into cuCIM for improved image decoding performance.
Authors:
- https://github.com/cdinea
- Gil Forsyth (https://github.com/gforsyth)
- https://github.com/jakirkham
Approvers:
- Gigon Bae (https://github.com/gigony)
- Kyle Edwards (https://github.com/KyleFromNVIDIA)
- https://github.com/jakirkham
URL: #966
Author
|
SUCCESS - forward-merge complete. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Forward-merge triggered by push to release/25.12 that creates a PR to keep main up-to-date. If this PR is unable to be immediately merged due to conflicts, it will remain open for the team to manually merge. See forward-merger docs for more info.