Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Python packages failed to load with static compilation and RTK_USE_CUDA #446

Open
SimonRit opened this issue Oct 14, 2021 · 3 comments

Comments

@SimonRit
Copy link
Collaborator

Error message is

File “D:\lib\pyITK_build\Wrapping\Generators\Python\itk\support…\RTKPython.py”, line 13, in
from . import _RTKPython
ImportError: DLL load failed while importing _RTKPython: cannot find specified module.

See https://discourse.itk.org/t/building-itk-with-python-wrappers/4396/6. This issue should be fixed before #434 in my opinion. @LucasGandel @Thibault-Pelletier @GabrieleBelotti

@LucasGandel
Copy link
Collaborator

The bug is still present using ITK and RTK master branches. Looks like _RTKPython fails to load the CUDA Toolkit libraries.

@GabrieleBelotti FYI it can be worked around by providing the CUDAToolkit libraries at runtime:
os.add_dll_directory("C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.5/bin")
I'll investigate why the CUDA libs are not found and will update.

I'll also look into builds using shared libs which fail because of redefinition issues.

I also reproduce #434 but let's fix this first.

@GabrieleBelotti
Copy link
Contributor

The bug is still present using ITK and RTK master branches. Looks like _RTKPython fails to load the CUDA Toolkit libraries.

@GabrieleBelotti FYI it can be worked around by providing the CUDAToolkit libraries at runtime: os.add_dll_directory("C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.5/bin") I'll investigate why the CUDA libs are not found and will update.

I'll also look into builds using shared libs which fail because of redefinition issues.

I also reproduce #434 but let's fix this first.

Thanks Lucas, I managed to reproduce again the error and using your workaround I managed to run some reconstruction codes in python.

@GabrieleBelotti
Copy link
Contributor

@LucasGandel By chance I compiled the library on a similar win10 machine that was running python 3.7 instead of 3.8.
The issue is not reproduced and I don't need a workaround. Can't tell if this is due to the python version or to the different folder organization for this other machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants