-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Open3D Python cannot find DLLs in add_dll_directory-locations #7104
Comments
I reproduced the experiment from here with the open3d-package, i.e. tried all combinations of
Open3D currently uses I'll open a PR with a change to I guess |
This PR introduced `winmode=0` for loading DLLs during import: isl-org#5259 This however leads to directories added via `os.add_dll_directory` not being considered, when loading DLLs (see isl-org#7104 (comment)). In particular this leads to open3d/tbb12.dll not being found. Fix this by going back to the default DLL-search mode (`winmode=None`). In order to still be able to find CUDA-DLLs, that are not part of the open3d-package, search their directory in PATH and explicitly add it to the DLL-search-locations for CUDA-builds.
This PR introduced `winmode=0` for loading DLLs during import: isl-org#5259 This however leads to directories added via `os.add_dll_directory` not being considered, when loading DLLs (see isl-org#7104 (comment)). In particular this leads to open3d/tbb12.dll not being found. Fix this by going back to the default DLL-search mode (`winmode=None`). In order to still be able to find CUDA-DLLs, that are not part of the open3d-package, search their directory in PATH and explicitly add it to the DLL-search-locations for CUDA-builds.
This PR introduced `winmode=0` for loading DLLs during import: isl-org#5259 This however leads to directories added via `os.add_dll_directory` not being considered, when loading DLLs (see isl-org#7104 (comment)). In particular this leads to open3d/tbb12.dll not being found. Fix this by going back to the default DLL-search mode (`winmode=None`). In order to still be able to find CUDA-DLLs, that are not part of the open3d-package, search their directory in PATH and explicitly add it to the DLL-search-locations for CUDA-builds.
This PR introduced `winmode=0` for loading DLLs during import: isl-org#5259 This however leads to directories added via `os.add_dll_directory` not being considered, when loading DLLs (see isl-org#7104 (comment)). In particular this leads to open3d/tbb12.dll not being found. Fix this by going back to the default DLL-search mode (`winmode=None`). In order to still be able to find CUDA-DLLs, that are not part of the open3d-package, search their directory in PATH and explicitly add it to the DLL-search-locations for CUDA-builds.
Checklist
main
branch).Describe the issue
I try to import custom-build Open3D with CUDA on Windows. In
__init__.py
whenopen3d/cuda/pybind.cp310-win_amd64.pyd
is loaded,open3d/tbb12.dll
is not found, although its location has been added to the DLL-search-directories withos.add_dll_directory
before.Workarounds:
tbb12.dll
intoWindows/system32
resolves the problem.tbb12.dll
explicitly withCDLL(str(Path(__file__).parent / "tbb12.dll"))
in__init__.py
before loadingcuda/pybind.cp310-win_amd64.pyd
resolves the problem.tbb12.dll
's location toPATH
resolves the problem. I.e. doingos.environ['PATH'] = str(Path(__file__).parent) + ';' + os.environ.get('PATH', '')
in__init__.py
.Main question: can anyone reproduce the problem or has any insights into why
add_dll_directory
seems not to be respected here? If this is a general problem, I'd open a PR that applies workaround 3.Steps to reproduce the bug
Error message
I get the warning below. Note that the hint about the CUDA libraries is wrong in my case and only the "Reported error" is relevant.
Expected behavior
pybind.cp310-win_amd64.pyd
is loaded without error. I.e.tbb12.dll
can be located and loaded during the call toCDLL()
.Open3D, Python and System information
Additional information
If I understand this correctly, the problem could perhaps also be thattbb12.dll
is not finding its dependencies and not thattbb12.dll
is not found. I did not follow this particular rabbit hole, further, though. If this is the problem, Open3D should perhaps implement a workaround or switch to a different tbb-version.[edit: with some further research I found that this problem also exists for CUDA-DLLs, so I'm pretty sure the issue above has nothing to do with this issue.]
The text was updated successfully, but these errors were encountered: