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-cuda128 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-cuda128 2.2.0
File Actions
itk_cudacommon_cuda128-2.2.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for itk_cudacommon_cuda128-2.2.0-cp311-abi3-win_amd64.whl
itk_cudacommon_cuda128-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_cuda128-2.2.0-cp311-abi3-manylinux_2_28_x86_64.whl
itk_cudacommon_cuda128-2.2.0-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for itk_cudacommon_cuda128-2.2.0-cp310-cp310-win_amd64.whl
itk_cudacommon_cuda128-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_cuda128-2.2.0-cp310-cp310-manylinux_2_28_x86_64.whl
itk_cudacommon_cuda128-2.2.0-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details for itk_cudacommon_cuda128-2.2.0-cp39-cp39-win_amd64.whl
itk_cudacommon_cuda128-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_cuda128-2.2.0-cp39-cp39-manylinux_2_28_x86_64.whl

Total release size: 72.4 MB

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

Download URL itk_cudacommon_cuda128-2.2.0-cp311-abi3-win_amd64.whl
Size 6.9 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
a8dfb52278e777e831183d67e75659d5b4a828e0265a7bc1e4576f125f54fa71
BLAKE2b-256 checksum
How to use checksums
983ca69b46359c9c559a8a1dd5f91b90be350e499e3beadb32fef9f9d16f02a1
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_cuda128-2.2.0-cp311-abi3-manylinux_2_28_x86_64.whl

Download URL itk_cudacommon_cuda128-2.2.0-cp311-abi3-manylinux_2_28_x86_64.whl
Size 17.3 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
8250dc3d0b44af2d8bd543936c858eb8c03e989979b008572c5876a8856b7832
BLAKE2b-256 checksum
How to use checksums
f91259dc6c03930a2c8348dc313b2408f8227b941ef02966e1e140fd6bc40207
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_cuda128-2.2.0-cp310-cp310-win_amd64.whl

Download URL itk_cudacommon_cuda128-2.2.0-cp310-cp310-win_amd64.whl
Size 6.9 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
52bc6ba7cb4d22a657fb4c2fc5f8f1015ab92a2391a83546625b8bd982ef4faf
BLAKE2b-256 checksum
How to use checksums
f392336edb35696987bbc0f1a99ba09d990eb5ae631f4a4ce301adbc5de834d8
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_cuda128-2.2.0-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL itk_cudacommon_cuda128-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
59b3b21b584d300335d6fffd6af0a0cd36658787d7494cd20990ad6f8333b2f8
BLAKE2b-256 checksum
How to use checksums
493271ddf80efcb9800b7e6d2dbc7f45064eb49a5387a62956bbb4ea205d7e7b
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_cuda128-2.2.0-cp39-cp39-win_amd64.whl

Download URL itk_cudacommon_cuda128-2.2.0-cp39-cp39-win_amd64.whl
Size 6.8 MB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
a88338ccce70ad59fcc41046ed27763ae11db7a34215d747ae5953f7d3007860
BLAKE2b-256 checksum
How to use checksums
69931638a8965c09ef19fc8d881261c857b6697254c1e7890db1ed023f753ad6
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_cuda128-2.2.0-cp39-cp39-manylinux_2_28_x86_64.whl

Download URL itk_cudacommon_cuda128-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
2582846b523c88cc7ac585f7c75eea50cb252dad99a76b951842591d08c76b41
BLAKE2b-256 checksum
How to use checksums
741bf8caf8649eb3ca85bd9fedc7abee74ffba2abdefc4fb18c12fbabe1d100e
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-cuda128 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