Insight Toolkit (ITK) -- Official Repository. ITK builds on a proven, spatially-oriented architecture for processing, segmentation, and registration of scientific images in two, three, or more dimensions.
ITKFFT fails to lazily import in ITK Python if built with ITK_USE_CUFFTW.
Steps to Reproduce
Build ITK with ITK_USE_CUFFTW=ON and ITK_WRAP_PYTHON=ON
Create a new Python virtual environment and add WrapITK.pth to site-packages
Run the Python console and force ITKFFT to import by calling an FFT filter
Expected behavior
ITKFFT imports successfully.
Actual behavior
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import itk
>>> itk.auto_progress(2)
>>> itk.ComplexToComplex1DFFTImageFilter
Loading ITKPyBase... done
Loading ITKCommon... done
Loading ITKStatistics... done
Loading ITKImageFilterBase... done
Loading ITKTransform... done
Loading ITKImageFunction... done
Loading ITKImageGrid... done
Loading ITKFFT... Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\repos\ITK-GPU-bld\Wrapping\Generators\Python\itk\support\lazy.py", line 138, in __getattribute__
base.itk_load_swig_module(module, namespace)
File "D:\repos\ITK-GPU-bld\Wrapping\Generators\Python\itk\support\base.py", line 132, in itk_load_swig_module
l_module = loader.load(swig_module_name)
File "D:\repos\ITK-GPU-bld\Wrapping\Generators\Python\itk\support\base.py", line 291, in load
l_spec.loader.exec_module(l_module) # pytype: disable=attribute-error
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "D:\repos\ITK-GPU-bld\Wrapping\Generators\Python\itk\support\..\ITKFFTPython.py", line 13, in <module>
from . import _ITKFFTPython
ImportError: DLL load failed while importing _ITKFFTPython: The specified module could not be found.
Description
ITKFFT
fails to lazily import in ITK Python if built withITK_USE_CUFFTW
.Steps to Reproduce
ITK_USE_CUFFTW=ON
andITK_WRAP_PYTHON=ON
WrapITK.pth
tosite-packages
Expected behavior
ITKFFT imports successfully.
Actual behavior
Reproducibility
100%
Versions
ITK@815d0f0531 (
main
)Environment
Windows 11 Python 3.10.9 CMake 3.24.3
Additional Information
CMakeCache.txt
Error persists after adding the NVIDIA GPU Computing Toolkit x64 directory to system
PATH
and restarting the console.ITK FFT C++ tests all pass, the problem is limited to importing ITKFFT.