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

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
File Actions
itk_cudacommon_cuda130-2.2.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for itk_cudacommon_cuda130-2.2.0-cp311-abi3-win_amd64.whl
itk_cudacommon_cuda130-2.2.0-cp311-abi3-manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.28+ x86-64 Details for itk_cudacommon_cuda130-2.2.0-cp311-abi3-manylinux_2_28_x86_64.whl
itk_cudacommon_cuda130-2.2.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for itk_cudacommon_cuda130-2.2.0-cp310-cp310-win_amd64.whl
itk_cudacommon_cuda130-2.2.0-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details for itk_cudacommon_cuda130-2.2.0-cp310-cp310-manylinux_2_28_x86_64.whl
itk_cudacommon_cuda130-2.2.0-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details for itk_cudacommon_cuda130-2.2.0-cp39-cp39-win_amd64.whl
itk_cudacommon_cuda130-2.2.0-cp39-cp39-manylinux_2_28_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.28+ x86-64 Details for itk_cudacommon_cuda130-2.2.0-cp39-cp39-manylinux_2_28_x86_64.whl

Total release size: 73.3 MB

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

Download URL itk_cudacommon_cuda130-2.2.0-cp311-abi3-win_amd64.whl
Size 7.1 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
1c4a3989940e13ad5ba38e6e2e38ea4ff8578a9d77819445223e851d5f5fb7ec
BLAKE2b-256 checksum
How to use checksums
0d2d9858ea5b98a27bb473feb22767860e0c2a4d5e5a7a410fe7f957d302654d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / itk_cudacommon_cuda130-2.2.0-cp311-abi3-manylinux_2_28_x86_64.whl

Download URL itk_cudacommon_cuda130-2.2.0-cp311-abi3-manylinux_2_28_x86_64.whl
Size 17.4 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
3738da9ffb57bd03821807c8bd0438744d90f9f7a5b4e3d500a45689e32de761
BLAKE2b-256 checksum
How to use checksums
d2ad8ed4c49a431c80cb189ab43d47eba518399a3fc03952590459afe08d8dab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

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

Download URL itk_cudacommon_cuda130-2.2.0-cp310-cp310-win_amd64.whl
Size 7.1 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
f8720b67052537c37ee1ced31d3f98d0d2c95adf6b688d801dcb03fb185b0ef7
BLAKE2b-256 checksum
How to use checksums
df6cd44b1e3de78fe384b0018d4cecc85d0b737dc0451dd1fbb288c1f4e809d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / itk_cudacommon_cuda130-2.2.0-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL itk_cudacommon_cuda130-2.2.0-cp310-cp310-manylinux_2_28_x86_64.whl
Size 17.3 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
547a075a54e8cdf49197428488a88aacf7d77b5c45c018f2729e96961b3e91eb
BLAKE2b-256 checksum
How to use checksums
fecd2dead3b1995fda0216d947361b0909fdc0afe638a3ff601e7c1c78ca0c57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

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

Download URL itk_cudacommon_cuda130-2.2.0-cp39-cp39-win_amd64.whl
Size 7.1 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
037f9fa572906140d01b0198cda85b173ca827c7aa9b3ab8174061afa382b30d
BLAKE2b-256 checksum
How to use checksums
d9652da33d163b7c2f61997f92274fae40ad673893350a557963ca88260dd163
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / itk_cudacommon_cuda130-2.2.0-cp39-cp39-manylinux_2_28_x86_64.whl

Download URL itk_cudacommon_cuda130-2.2.0-cp39-cp39-manylinux_2_28_x86_64.whl
Size 17.3 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
8b0bc280d1642a03256090ce137d9f34c6420dd82ffc196a8cc5103240c0bd5c
BLAKE2b-256 checksum
How to use checksums
522f89a999eacd56e4def22a036ff1bbe0b26c8d91ef41aa072a483479f32bb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Security for itk-cudacommon-cuda130 2.2.0

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.

Release history Release notifications | RSS feed

This release

2.2.0 This release

6 release files No provenance

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