In order to reduce the loading time if RTK, I first generate itk wheels by ITKPythonPackage with "-DITK_WRAP_IMAGE_DIMS:STRING=2;3". And then pip install itk-rtk-cuda, but that method will cause the error, so I think I need generate rtk wheels like itk.
I set "-DModule_RTK:BOOL=ON", and -DRTK_USE_CUDA:BOOL=ON", on the windows-build-wheels.py like below:
Thak you very much for your reply. I’ll try it. But I have a question: do I need set "-DITK_WRAP_IMAGE_DIMS:STRING=2;3"? If I need , where to modify it?
I’m not sure, I have never done that. It seems to me that instead of using the distributed ITKPythonBuilds-windows.zip file here, you should simply use your local ITK build.
Actually I confused now.
I first generate itk wheels with "-DITK_WRAP_IMAGE_DIMS:STRING=2;3" like below:
And then use pip install itk-rtk-cuda116 from Pypi to use RTK like itk.RTK.ThreeDCircularProjectionGeometry.New(). But there will occur error like this:
I think the problem may that the pypi IMAGE_DIMS:STRING=2;3;4, which is conflict with itk. So I need to generate a rtk wheels can set same configuration as I generate itk.
As @simon.rit advise, I generate itkcudacommon wheels by default.
I didn’t find where to set the configuration, I install this whl on my python environment, the error still exists. It seem like there is no difference between the Whl generated by myself and the one I installed from Pypi.
As far as my understanding of ITKPythonPackage goes, it downloads an existing ITK build (from here) and compile the module on top of it. You need to do the same but use your ITK build to have the correct set of options.
I replace ITKPythonBuild by my generate code. At fist I can successful generate ITKCudaCommon wheels, but late I failed. With the same code, there occur the error like below:
Good news, I rebuilt ITK and I can successfully generate ITKCudaCommon wheels. But on the next step, an error occurred during the final step of generating RTK with cmake-options: '-DRTK_BUILD_APPLICATIONS:BOOL=OFF'.
Although a wheel was generated, running rtk will result in an error( I use windows and have set os.add_dll_directory(os.path.join(os.environ['CUDA_PATH'], 'bin'))).
I wish I could but I don’t see what is the issue. I guess you have to find out which DLL is missing for _RTKPython.dll. Maybe you can try to find out with Dependency Walker?
There is the probelm. In the final step of generating the wheel, a dependency needs to be added, but an error RuntimeError: itk\_RTKPython.pyd has a CPU architecture that is not compatible with this wheel is reported. This resulted in me not having the itk_rtk.libs folder when I finally installed the wheels for RTK.
This dependency can successfully add to ITKCudaCommon wheels.
As RTK2.6 has published, I tried to generate rtk2.6 wheel based on itk5.4(-DITK_WRAP_IMAGE_DIMS:STRING=2;3). Unfortunately, it failed too. The ITKCudaComman can generate successfully, but on the last step of rtk build, display some accessories that will generate RTK:
But I didn’t find the .lib file. And when I opened the _PTKPython.pyd file by depends, it shows that the the file was not a 32-bit or 64-bit Windows module. there was nothing on the file.
I think that may cause the repair progress failed? Although the wheel generated, but can’t use on the python.
Have you encountered this situation and given me some advice?