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-cuda118 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-cuda118 2.2.0
File Actions
itk_cudacommon_cuda118-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_cuda118-2.2.0-cp311-abi3-manylinux_2_28_x86_64.whl
itk_cudacommon_cuda118-2.2.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details for itk_cudacommon_cuda118-2.2.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
itk_cudacommon_cuda118-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_cuda118-2.2.0-cp310-cp310-manylinux_2_28_x86_64.whl
itk_cudacommon_cuda118-2.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details for itk_cudacommon_cuda118-2.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
itk_cudacommon_cuda118-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_cuda118-2.2.0-cp39-cp39-manylinux_2_28_x86_64.whl
itk_cudacommon_cuda118-2.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details for itk_cudacommon_cuda118-2.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Total release size: 104.2 MB

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

Download URL itk_cudacommon_cuda118-2.2.0-cp311-abi3-manylinux_2_28_x86_64.whl
Size 17.2 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
67af38f34d4890017a2253b90b12ad5731d4363c993fbd3aa975c5b0698df74c
BLAKE2b-256 checksum
How to use checksums
cb147df0447f06ceb428806b91dfe044d94018dc117fbf0010dc0f5ffa954031
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_cuda118-2.2.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL itk_cudacommon_cuda118-2.2.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 17.8 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
64d1f8da815dc0badf62e18f9fb2b3b41409d2a03b5bed32989217c77e32c892
BLAKE2b-256 checksum
How to use checksums
b402c0885a6f8d1b08a142287e839f7dc0ff8c9dd0bef4d5d57e501728a046c4
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_cuda118-2.2.0-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL itk_cudacommon_cuda118-2.2.0-cp310-cp310-manylinux_2_28_x86_64.whl
Size 17.2 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
f05a3aa9304e8c0c49794e6aa6518c503a7000b9df11de4db89548d6cdfa5471
BLAKE2b-256 checksum
How to use checksums
e4cb051267d42d1b9d67aaf4c1dfc34e9945e5b7f06cb65f1be521c7cf5cd54d
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_cuda118-2.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL itk_cudacommon_cuda118-2.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 17.4 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
26e928b2a75338d87f2c0986a607d00a35d53a9795d810761628d72ec5a663db
BLAKE2b-256 checksum
How to use checksums
d5141e94b1882f128f84c1cddf47986c07994f8766834607fe8365fbe44766d8
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_cuda118-2.2.0-cp39-cp39-manylinux_2_28_x86_64.whl

Download URL itk_cudacommon_cuda118-2.2.0-cp39-cp39-manylinux_2_28_x86_64.whl
Size 17.2 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
262e9a8d6d5de446fd23cd65e21b08fe508ad43907c81a7017ba5f1c8ca2c611
BLAKE2b-256 checksum
How to use checksums
8a8fa5325ac6bb06605d68398ec57ed6f4e505f2f3419841ded023bf1cc78ae5
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_cuda118-2.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL itk_cudacommon_cuda118-2.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 17.4 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
e621af33a03af487ff1dd9ecc048a58c934730cabc30289dbce3502eeccbbfa2
BLAKE2b-256 checksum
How to use checksums
1259dec3d3053f26b7e66da77a4ff7287290ebef48d7b27f4af0b904661c8065
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-cuda118 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