InsightSoftwareConsortium / InsightSoftwareConsortium/ITK

ENH: Drop OpenGL/OpenCL GPU modules in ITK 6

Open
#6,075 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
1.7k
Forks
748
Avg merge
1d 1h
Merged PRs (30d)
64

Description

## Proposal

Remove the 8 in-tree OpenGL/OpenCL-based GPU modules from ITK 6. Per @thewtex in #6060: "+1 for dropping the OpenGL GPU modules in ITK 6."

These modules (`ITK_USE_GPU=OFF` by default) depend on OpenCL, which is deprecated on macOS (since 2018) and increasingly unsupported. The GPU compute landscape has moved to CUDA, Vulkan compute, Metal, and C++ standard parallelism (stdexec/`std::execution`). Retaining the OpenCL modules creates maintenance burden without delivering modern GPU acceleration.

CUDA support should remain in separate repositories (RTK/CudaCommon, VkFFTBackend) where CI and packaging constraints are self-contained.

Modules to remove (8)

| Module | Location | Last functional change |
|---|---|---|
| GPUCommon | Modules/Core/GPUCommon | 2026-02-05 (CMake modernization only) |
| GPUFiniteDifference | Modules/Core/GPUFiniteDifference | 2026-01-27 (OpenCL target cleanup) |
| GPUImageFilterBase | Modules/Filtering/GPUImageFilterBase | 2026-01-27 (OpenCL target cleanup) |
| GPUAnisotropicSmoothing | Modules/Filtering/GPUAnisotropicSmoothing | 2026-01-27 (OpenCL target cleanup) |
| GPUSmoothing | Modules/Filtering/GPUSmoothing | 2026-01-27 (OpenCL target cleanup) |
| GPUThresholding | Modules/Filtering/GPUThresholding | 2026-01-27 (OpenCL target cleanup) |
| GPUCommon (Registration) | Modules/Registration/GPUCommon | 2022-05-17 (last real change) |
| GPUPDEDeformable | Modules/Registration/GPUPDEDeformable | 2026-04-06 (COMP fix) |

All recent commits are STYLE/COMP/DOC — no new functionality has been added to these modules since the ITK 4 era.

Known issues with current GPU modules

- #415 — GPU modules listed as available even when `ITK_USE_GPU=OFF`
- #4846 — GPU filters fail when invoked from Python (`CL_INVALID_MEM_OBJECT`)
- #1887 — GPU memory leakage
- #3744 — Build failures with `ITK_USE_GPU=ON`
- OpenCL deprecated on macOS since 2018 (macOS 10.14); removed from new Apple Silicon SDKs
- No CI coverage — none of the GPU modules are tested in any ITK CI pipeline

Modern GPU alternatives

| Technology | Status in ITK ecosystem | Notes |
|---|---|---|
| **CUDA** (RTK/CudaCommon) | Separate repo, working | CI/packaging easier outside ITK (@thewtex) |
| **VkFFT** (ITKVkFFTBackend) | Remote module, active | Vulkan compute for FFT |
| **stdexec** (`std::execution`) | #4433, proposed | Future C++ standard parallelism model |
| **Metal** | Not started | Apple's GPU compute replacement for OpenCL |

Migration path

1. Mark all GPU modules as `EXCLUDE_FROM_DEFAULT` + emit deprecation warning in ITK 5.4.x / 6.0 beta
2. Remove from ITK 6.0 release
3. Optionally archive as a standalone remote module for users who still need OpenCL (unlikely given macOS deprecation)
4. Update wrapping to remove GPU filter bindings
5. Clean up `CMakeLists.txt`: remove `ITK_USE_GPU`, `itkOpenCL.cmake`, OpenCL find module

## References

- #6060 (comment) — @thewtex: "+1 for dropping the OpenGL GPU modules in ITK 6"
- #4433 — stdexec threading backend proposal (modern replacement path)
- #415, #4846, #1887, #3744 — existing GPU module bugs
- Discourse: [Status of ITK+GPU](https://discourse.itk.org/t/status-of-itk-gpu/277) (2017-2020, no resolution)
- Discourse: [Accelerators via executors](https://discourse.itk.org/t/accelerators-via-executors-in-itk/3456) (2020, modern direction)
- Apple OpenCL deprecation: WWDC 2018

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.