Skip to main content

ITKCudaCommon

GitHub release PyPI Wheels License

Overview

ITKCudaCommon is an ITK module for processing images with Cuda, including the itk::CudaImage class and base classes for processing objects of this type, itk::CudaImageToImageFilter and itk::CudaInPlaceImageFilter. ITKCudaCommon was originally based on the GPUCommon module for OpenCL.

The installation is described in INSTALLATION.md.

CudaCommon's documentation is limited to a few Markdown files (README.md, cuda_array_interface.md, INSTALLATION.md, etc.) integrated into RTK's documentation.

What is a CudaImage?

An itk::CudaImage is an itk::Image (by inheritance) with a new member, m_DataManager of type itk::CudaDataManager. The role of this member is to manage a GPU memory buffer with the same size as the itk::Image::m_Buffer. Data is transferred from one buffer to the other (m_GPUBuffer and m_CPUBuffer) only when necessary, i.e., when accessing one of the two buffers and the other has been accessed more recently and therefore marked as "dirty" (using the members m_IsGPUBufferDirty and m_IsCPUBufferDirty).

The Python CudaImage wrapping exposes a __cuda_array_interface__ for zero-copy views to other packages such as PyTorch or CuPy. See the CUDA array interface documentation for more information.

Selecting the GPU device

When no device is explicitly selected (and no environment variable is set), the GPU used by all freshly created itk::CudaImage (or itk::CudaDataManager) objects is selected automatically as the device with the maximum FLOPS. In a multi-GPU system you may want to choose a specific device instead.

Call this from C++ before creating any CudaImage:

// Use GPU number 2 for all subsequent images.
itk::SetDefaultCudaDevice(2);

// Automatically select the (first) device with the max FLOPS.
itk::SetDefaultCudaDevice(-1);

The equivalent is available from Python:

import itk

# Use GPU number 2 for all subsequently created CudaImages.
itk.set_default_cuda_device(2)

# Automatically select the (first) device with the max FLOPS.
itk.set_default_cuda_device(-1)

An explicitly set value takes precedence over the ITK_CUDA_DEFAULT_DEVICE environment variable which itself takes precedence over the automated value.

Passing a device index outside the valid range throws an itk::ExceptionObject. The environment variable must be a non-negative integer, otherwise an exception is thrown.

What is a CudaImageToImageFilter?

An itk::CudaImageToImageFilter and its in place child, itk::CudaInPlaceImageFilter, are ITK filters which can be integrated in an ITK pipeline to process an itk::CudaImage. They are CUDA equivalent to the CPU classes itk::ImageToImageFilter and itk::InPlaceImageFilter in ITK's Common module. See the ITK software guide for more information. Their GPUGenerateData member function must process the output CudaImage objects.

CUDA image operators

CudaCommon includes CUDA implementations of common ITK unary and binary image operators.

These operators were added to perform pixel-wise calculations directly on the GPU within an ITK pipeline. They allow pipelines using itk::CudaImage to keep image data on the GPU between operations, avoiding transfers to and from CPU memory just to apply these calculations.

Metadata

Release files for itk-cudacommon-cuda130 2.2.0.post1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for itk-cudacommon-cuda130 2.2.0.post1
File Interpreter ABI Platform Actions
itk_cudacommon_cuda130-2.2.0.post1-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for itk_cudacommon_cuda130-2.2.0.post1-cp311-abi3-win_amd64.whl
itk_cudacommon_cuda130-2.2.0.post1-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for itk_cudacommon_cuda130-2.2.0.post1-cp310-cp310-win_amd64.whl
itk_cudacommon_cuda130-2.2.0.post1-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details for itk_cudacommon_cuda130-2.2.0.post1-cp39-cp39-win_amd64.whl

Total release size: 20.8 MB

Release files / itk_cudacommon_cuda130-2.2.0.post1-cp311-abi3-win_amd64.whl

Download URL itk_cudacommon_cuda130-2.2.0.post1-cp311-abi3-win_amd64.whl
Size 7.0 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
2961841a454e6dc72a5d7c4677aa3a87dd1757dce71ba269aeef40dcb8e9e4ad
BLAKE2b-256 checksum
How to use checksums
27d3dd9cd02b7744a41f12a11fa74f74d9ad26e4379e419b3fc5d84aea91bcf9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / itk_cudacommon_cuda130-2.2.0.post1-cp310-cp310-win_amd64.whl

Download URL itk_cudacommon_cuda130-2.2.0.post1-cp310-cp310-win_amd64.whl
Size 6.9 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
88434dc7e56a1bf0ae119d839d09fe9d1777eeceb9b120513166289e26b207bb
BLAKE2b-256 checksum
How to use checksums
955803bab1122358242f133a7f766778b4789505b501d8799728728343a1773b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / itk_cudacommon_cuda130-2.2.0.post1-cp39-cp39-win_amd64.whl

Download URL itk_cudacommon_cuda130-2.2.0.post1-cp39-cp39-win_amd64.whl
Size 6.9 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
1dfc827109fe85ed382b13fdba0cf512a36a3dca850080b5588c3dbc55895267
BLAKE2b-256 checksum
How to use checksums
31d6307c5d7096af1a306d8c99d62cc701b7844b5e483aa7f1166e380e7b1c88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for itk-cudacommon-cuda130 2.2.0.post1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page