Skip to content

Commit 3bcb633

Browse files
retifclaude
andcommitted
Document OpenCV CUDA 13.0 incompatibility
After extensive testing, opencv-python cannot be built with CUDA 13.0: Root cause: opencv_contrib cudev module uses deprecated CUDA texture APIs that were removed in CUDA 12.0+: - texture<T, ...> template → removed - cudaUnbindTexture() → removed - textureReference type → removed These were replaced with cudaTextureObject_t API in CUDA 12.0+. Impact: - All three opencv workflows (py314t-cpu, py314t-cu130, py314-cu130) cannot build - py314t builds also blocked by ADE library C++ issue - py314-cu130 blocked only by CUDA API incompatibility Solutions: - Use CUDA 11.x (has legacy texture API) - Wait for opencv_contrib to be updated for CUDA 12.0+ - Build CPU-only (but py314t has ADE issue) Testing summary: 1. CMAKE_CXX_STANDARD=17 → Failed (C++17 error) 2. + CMAKE_CUDA_STANDARD=17 → Failed (C++17 error) 3. + CUDA_NVCC_FLAGS=--std=c++17 → Failed (texture API error) ✓ C++17 fixed Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 2567cb7 commit 3bcb633

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

CLAUDE.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,33 +144,38 @@ OpenCV-Python has **three** separate workflows:
144144
- **No PyTorch/CUDA dependency**: CPU-only for simplicity and compatibility
145145
- **Benefits**: Simpler build, faster compilation (~15-20 minutes)
146146
- **Use case**: Free-threaded Python's main benefit is CPU parallelism
147-
- **Status**: ❌ Blocked by upstream ADE library C++ compatibility issue
147+
- **Status**: ❌ Blocked by upstream ADE library C++ compatibility issue (missing `#include <cstdint>`)
148148
- Built with `-DWITH_CUDA=OFF`
149149

150150
### 2. CUDA Build (Python 3.14t Free-threaded)
151151
- **Workflow**: `build-opencv-python-py314t-cu130.yml`
152152
- **Release tag**: `opencv-python-v{version}-py314t-cu130`
153-
- **CUDA 13.0 support**: GPU acceleration via `cv2.cuda` module
154-
- **C++17 required**: CUDA 13.0 Thrust library requires C++17 standard
155-
- **Longer build**: ~30-45 minutes due to CUDA compilation
156-
- **Status**: ⚠️ Untested (may have same ADE compatibility issues)
153+
- **Status**: ❌ **CANNOT BUILD** - Two blocking issues:
154+
1. ADE library C++ compatibility (same as CPU build)
155+
2. opencv_contrib cudev module incompatible with CUDA 13.0 (deprecated texture APIs)
157156
- Requires opencv_contrib for cudev module
158157

159158
### 3. CUDA Build (Python 3.14 with GIL)
160159
- **Workflow**: `build-opencv-python-py314-cu130.yml`
161160
- **Release tag**: `opencv-python-v{version}-py314-cu130`
162-
- **CUDA 13.0 support**: GPU acceleration via `cv2.cuda` module
163-
- **C++17 required**: CUDA 13.0 Thrust library requires C++17 standard
164-
- **Longer build**: ~30-45 minutes due to CUDA compilation
165-
- **Status**: 🔄 Currently testing (should work better than py314t)
161+
- **Status**: ❌ **CANNOT BUILD** - opencv_contrib incompatible with CUDA 13.0
162+
- opencv_contrib cudev uses deprecated CUDA texture APIs (`texture<>`, `cudaUnbindTexture`, `textureReference`)
163+
- These APIs were removed in CUDA 12.0+
164+
- Would need CUDA 11.x or wait for opencv_contrib update
166165
- Requires opencv_contrib for cudev module
167166

168167
### Common Notes
169168
1. **No PyTorch Dependency**: OpenCV doesn't depend on PyTorch
170169
2. **Build System**: Uses scikit-build with CMake
171170
- Requires system dependencies (GTK, video codecs, etc.)
172171
3. **Python 3.14 Compatibility**: Standard Python 3.14 (GIL) has better C++ library compatibility than free-threaded
173-
4. **Upstream Issue**: Free-threaded builds blocked by missing `#include <cstdint>` in ADE library
172+
4. **Upstream Issues**:
173+
- **ADE Library**: Free-threaded builds blocked by missing `#include <cstdint>` in ADE library
174+
- **CUDA 13.0**: opencv_contrib cudev uses deprecated texture APIs removed in CUDA 12.0+
175+
- Errors: `texture is not a template`, `cudaUnbindTexture is undefined`, `textureReference is undefined`
176+
- Cannot build ANY opencv-python wheels with CUDA 13.0
177+
- Would need CUDA 11.x or updated opencv_contrib
178+
5. **C++17 Requirement for CUDA**: Must set `-DCMAKE_CXX_STANDARD=17 -DCMAKE_CUDA_STANDARD=17 -DCUDA_NVCC_FLAGS=--std=c++17`
174179

175180
## llvmlite Special Notes
176181

0 commit comments

Comments
 (0)