-
Notifications
You must be signed in to change notification settings - Fork 69
feat: Add cuslide2 plugin with nvImageCodec GPU acceleration #949
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
base: branch-25.12
Are you sure you want to change the base?
feat: Add cuslide2 plugin with nvImageCodec GPU acceleration #949
Conversation
09d4db6
to
ad8c10c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @cdinea, a couple initial comments on a few stray files to remove.
Note to potential reviewers, >90% of the lines here are a copy of the existing "cuslide" plugin. To review, I recommend NOT using GitHub, but instead using a diff tool such as "Beyond Compare" to compare only the modified files from the cpp/plugins/cucim.kit.cuslide2
vs. cpp/plugins/cucim.kit.cuslide
. Then you will see that the difference is only a small percentage of the lines shown here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can delete this file and keep only the cudslide2 one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you @grlee77 - indeed, based on the integration plan we decided to have a copy of the cuslide and modify the needed files as we incrementally add integration with nvImageCodec.This PR only tests successful nvImageCodec installation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the entire test-build
folder. It seems to have been accidentally checked in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you @grlee77 - indeed, just removed the folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it expected that this is a stub implementation for now, or was the final version of this not checked in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is expected to have a stub implementation for now, just to check nvImageCodec succesfull installation in the cuslide2 plugin.
/ok to test 0de560e |
….com/cdinea/cucim into feature/cuslide2-nvimagecodec-plugin
Add cuslide2 plugin with nvImageCodec GPU acceleration
Add cuslide2 Plugin with nvImageCodec GPU Acceleration (Stub Implementation)
🚀 Overview
This PR introduces the cuslide2 plugin, a new high-performance image decoder for cuCIM that leverages NVIDIA's nvImageCodec library to provide GPU-accelerated JPEG and JPEG2000 decoding for digital pathology images.
Architecture
🔧 Building the cuslide2 Plugin
Prerequisites
Step-by-Step Build Instructions
1. Install nvImageCodec (Required for Testing)
2. Build cuslide2 Plugin (Standalone)
3. Alternative: Build with Main cuCIM (Requires CMake 3.30.4+)
Note: If you encounter CMake version issues, use the standalone plugin build method above.
Build Verification
Environment Setup
🧪 Comprehensive Testing Suite
This PR includes a comprehensive testing suite with multiple validation scripts. All tests are designed to work with the stub implementation and validate the integration architecture.
1. Primary Validation Test:
test_cuslide2_simple.py
Purpose: Complete validation of plugin build, nvImageCodec integration, and API functionality.
Expected Output:
2. nvImageCodec API Demo:
nvimagecodec_example_demo.py
Purpose: Standalone demonstration of nvImageCodec API following official documentation examples.
Expected Output:
3. Image Visualization Tools
3.1 Complete Image Visualization:
visualize_images_nogui.py
Purpose: Create comprehensive visualizations of all test images and compression results.
Expected Output:
3.2 Original Image Analysis:
show_original_image.py
Purpose: Detailed analysis of the mathematical test pattern used for validation.
Expected Output:
3.3 Pixel Value Verification:
show_pixel_values.py
Purpose: Verify the mathematical correctness of the test pattern at pixel level.
Expected Output:
4. Analysis and Information Tools
4.1 Compression Analysis:
analyze_demo_results.py
Purpose: Detailed analysis of compression efficiency and image quality.
Expected Output:
4.2 File Information Summary:
show_image_info.py
Purpose: Summary of all generated test files and their properties.
Expected Output:
4.3 Visualization Guide:
describe_visualizations.py
Purpose: Explain what each generated visualization contains.
Expected Output:
5. Test Execution Summary
Run all tests in sequence:
Expected Total Runtime: ~30-60 seconds for all tests
Generated Files: 15+ visualization and analysis files in
/tmp/
demonstrating complete functionality🔍 Test Failure Troubleshooting
Plugin Not Found
nvImageCodec Not Available
Library Loading Errors
CUDA/GPU Issues
📁 Files Added/Modified
New Files - Plugin Implementation
cpp/plugins/cucim.kit.cuslide2/
- Complete cuslide2 plugin implementation (stub)cpp/plugins/cucim.kit.cuslide2/src/cuslide/nvimgcodec/
- nvImageCodec integration layercpp/plugins/cucim.kit.cuslide2/cmake/deps/nvimgcodec.cmake
- nvImageCodec dependency managementtest_cuslide2_header_only.cpp
- C++ header-only testNew Files - Comprehensive Testing Suite
test_cuslide2_simple.py
- Primary validation script with nvImageCodec API integrationnvimagecodec_example_demo.py
- Standalone nvImageCodec API demonstrationvisualize_images_nogui.py
- Complete image visualization toolshow_original_image.py
- Original test pattern analysisshow_pixel_values.py
- Pixel-level pattern verificationanalyze_demo_results.py
- Compression analysis and quality assessmentshow_image_info.py
- File information and summary tooldescribe_visualizations.py
- Visualization guide and explanationNew Files - Documentation
CUSLIDE2_USAGE.md
- Usage instructions and examplesPR_DESCRIPTION_CUSLIDE2.md
- This comprehensive PR descriptionModified Files
dependencies.yaml
- Added nvImageCodec dependency specificationsconda/recipes/libcucim/meta.yaml
- Added nvImageCodec runtime dependenciesconda/recipes/libcucim/conda_build_config.yaml
- Version configuration for nvImageCodec🎯 Validation Checklist
Build Verification
make -j$(nproc)
)ldd
check)Core Functionality Tests
test_cuslide2_simple.py
passes completelyImage Processing Validation
Visualization and Analysis
Performance and Compatibility
Documentation and Usability
🚀 Impact and Future Work
Current Impact (Stub Implementation)
This PR establishes the foundation for significant performance improvements in cuCIM's digital pathology workflows:
Future Impact (Full Implementation)
Subsequent PRs will build on this foundation to deliver:
Technical Foundation Established
✅ Plugin Architecture: Complete cuslide2 plugin structure
✅ nvImageCodec Integration: Library integration and API validation
✅ Build System: CMake configuration with dependency management
✅ Testing Framework: Comprehensive validation and visualization tools
✅ Documentation: Complete setup, build, and testing instructions
Next Steps