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

Loading adam_upd_cuda extension failure on Windows 10 (Pytorch with Cuda11.6) Python3.10 #54

Open
mrsaleh opened this issue Feb 20, 2023 · 2 comments

Comments

@mrsaleh
Copy link

mrsaleh commented Feb 20, 2023

I get the following error on windows 10 (Pytorch with Cuda 11.6, Python 3.10), It seems that the extensions built, but couldn't get loaded.

  warnings.warn(
Using C:\Users\Saleh\AppData\Local\torch_extensions\torch_extensions\Cache\py310_cu116 as PyTorch extensions root...
Detected CUDA files, patching ldflags
Emitting ninja build file C:\Users\Saleh\AppData\Local\torch_extensions\torch_extensions\Cache\py310_cu116\adam_upd_cuda\build.ninja...
Building extension module adam_upd_cuda...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
1.11.1
Loading extension module adam_upd_cuda...
Traceback (most recent call last):
  File "E:\3D-Reconstruction\DirectVoxGO\run.py", line 13, in <module>
    from lib import utils, dvgo, dcvgo, dmpigo
  File "E:\3D-Reconstruction\DirectVoxGO\lib\utils.py", line 11, in <module>
    from .masked_adam import MaskedAdam
  File "E:\3D-Reconstruction\DirectVoxGO\lib\masked_adam.py", line 7, in <module>
    adam_upd_cuda = load(
  File "D:\Program Files\Python310\lib\site-packages\torch\utils\cpp_extension.py", line 1284, in load
    return _jit_compile(
  File "D:\Program Files\Python310\lib\site-packages\torch\utils\cpp_extension.py", line 1534, in _jit_compile
    return _import_module_from_library(name, build_directory, is_python_module)
  File "D:\Program Files\Python310\lib\site-packages\torch\utils\cpp_extension.py", line 1936, in _import_module_from_library
    module = importlib.util.module_from_spec(spec)
ImportError: DLL load failed while importing adam_upd_cuda: The specified module could not be found.
@mrsaleh
Copy link
Author

mrsaleh commented Feb 20, 2023

I was wrong , extension failed to build with Cuda 11.6 and Visual Studio 2022,
I just ran ninja build file manually. If you wonder where it is , its at the following address.
C:\Users\[Your Username]\AppData\Local\torch_extensions\torch_extensions\Cache\py310_cu116\adam_upd_cuda
You probably need to run "vcvarsall.bat x86_amd64" before running ninja , or you get weird messages like "Can't find cassert file"
After all, I stuck at the following error.

[2/3] C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v...xGO\lib\cuda\adam_upd_kernel.cu -o adam_upd_kernel.cuda.o
FAILED: adam_upd_kernel.cuda.o
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\bin\nvcc --generate-dependencies-with-compile --dependency-output adam_upd_kernel.cuda.o.d -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcompiler /EHsc -Xcompiler /wd4190 -Xcompiler /wd4018 -Xcompiler /wd4275 -Xcompiler /wd4267 -Xcompiler /wd4244 -Xcompiler /wd4251 -Xcompiler /wd4819 -Xcompiler /MD -DTORCH_EXTENSION_NAME=adam_upd_cuda -DTORCH_API_INCLUDE_EXTENSION_H "-ID:\Program Files\Python310\lib\site-packages\torch\include" "-ID:\Program Files\Python310\lib\site-packages\torch\include\torch\csrc\api\include" "-ID:\Program Files\Python310\lib\site-packages\torch\include\TH" "-ID:\Program Files\Python310\lib\site-packages\torch\include\THC" "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\include" "-ID:\Program Files\Python310\Include" -D_GLIBCXX_USE_CXX11_ABI=0 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -gencode=arch=compute_52,code=compute_52 -gencode=arch=compute_52,code=sm_52 -c E:\3D-Reconstruction\DirectVoxGO\lib\cuda\adam_upd_kernel.cu -o adam_upd_kernel.cuda.o
D:/Program Files/Python310/lib/site-packages/torch/include\c10/macros/Macros.h(138): warning C4067: unexpected tokens following preprocessor directive - expected a newline
D:/Program Files/Python310/lib/site-packages/torch/include\c10/macros/Macros.h(138): warning C4067: unexpected tokens following preprocessor directive - expected a newline
D:\Program Files\Python310\lib\site-packages\torch\include\pybind11\cast.h(624): error: too few arguments for template template parameter "Tuple"
          detected during instantiation of class "pybind11::detail::tuple_caster<Tuple, Ts...> [with Tuple=std::pair, Ts=<T1, T2>]"
(721): here

D:\Program Files\Python310\lib\site-packages\torch\include\pybind11\cast.h(717): error: too few arguments for template template parameter "Tuple"
          detected during instantiation of class "pybind11::detail::tuple_caster<Tuple, Ts...> [with Tuple=std::pair, Ts=<T1, T2>]"
(721): here

2 errors detected in the compilation of "E:/3D-Reconstruction/DirectVoxGO/lib/cuda/adam_upd_kernel.cu".
adam_upd_kernel.cu
ninja: build stopped: subcommand failed.

It seems that is has something to do with Cuda 11.6 and pybind11.

@tourbliu
Copy link

Hello, have you solved this problem?

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

2 participants