facebookresearch / theseus

A library for differentiable nonlinear optimization
MIT License
1.74k stars 124 forks source link

Failed to install theseus #638

Closed ggttkl closed 7 months ago

ggttkl commented 8 months ago

Hi everyone, I attempted to install theseus through Anaconda. My python version is 3.10 and cuda is 11.6 (nvcc --version). I pip installed torch=1.12.1 with cudatoolkit 11.6. The torch.cuda.is_available() returns True. When I downed the project and pip install -e ., the installation failed with

Installing collected packages: theseus-ai Running setup.py develop for theseus-ai error: subprocess-exited-with-error × python setup.py develop did not run successfully. │ exit code: 1 ╰─> [61 lines of output] Theseus CUDA support: True (detected) No BaSpaCho dir given, so extension will not be installed. Excluding theseus.labs running develop F:\Users\FabulousThor\anaconda3\envs\theseus\lib\site-packages\setuptools\command\develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated. !! **** Please avoid running setup.py and easy_install. Instead, use pypa/build, pypa/installer or other standards-based tools. See https://github.com/pypa/setuptools/issues/917 for details. **** !! easy_install.initialize_options(self) F:\Users\FabulousThor\anaconda3\envs\theseus\lib\site-packages\setuptools_distutils\cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated. !! **** Please avoid running setup.py directly. Instead, use pypa/build, pypa/installer or other standards-based tools. See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details. **** !! self.initialize_options() running egg_info writing theseus_ai.egg-info\PKG-INFO writing dependency_links to theseus_ai.egg-info\dependency_links.txt writing requirements to theseus_ai.egg-info\requires.txt writing top-level names to theseus_ai.egg-info\top_level.txt F:\Users\FabulousThor\anaconda3\envs\theseus\lib\site-packages\torch\utils\cpp_extension.py:411: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend. warnings.warn(msg.format('we could not find ninja.')) reading manifest file 'theseus_ai.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching 'py.typed' adding license file 'LICENSE' writing manifest file 'theseus_ai.egg-info\SOURCES.txt' running build_ext F:\Users\FabulousThor\anaconda3\envs\theseus\lib\site-packages\torch\utils\cpp_extension.py:346: UserWarning: Error checking compiler version for cl: [WinError 2] 系统找不到指定的文件。 warnings.warn(f'Error checking compiler version for {compiler}: {error}') building 'theseus.extlib.mat_mult' extension "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\bin\nvcc" -c F:\theseus-main\theseus\extlib\mat_mult.cu -o build\temp.win-amd64-cpython-310\Release\theseus-main\theseus\extlib\mat_mult.obj -IF:\Users\FabulousThor\anaconda3\envs\theseus\lib\site-packages\torch\include -IF:\Users\FabulousThor\anaconda3\envs\theseus\lib\site-packages\torch\include\torch\csrc\api\include -IF:\Users\FabulousThor\anaconda3\envs\theseus\lib\site-packages\torch\include\TH -IF:\Users\FabulousThor\anaconda3\envs\theseus\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\include" -IF:\Users\FabulousThor\anaconda3\envs\theseus\include -IF:\Users\FabulousThor\anaconda3\envs\theseus\Include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" -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 -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=mat_mult -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 --use-local-env F:/Users/FabulousThor/anaconda3/envs/theseus/lib/site-packages/torch/include\c10/macros/Macros.h(143): warning C4067: F:\Users\FabulousThor\anaconda3\envs\theseus\lib\site-packages\torch\include\pybind11\cast.h(1429): 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>]" (1507): here F:\Users\FabulousThor\anaconda3\envs\theseus\lib\site-packages\torch\include\pybind11\cast.h(1503): 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>]" (1507): here F:/Users/FabulousThor/anaconda3/envs/theseus/lib/site-packages/torch/include\c10/core/SymInt.h(84): warning #68-D: integer conversion resulted in a change of sign 2 errors detected in the compilation of "F:/theseus-main/theseus/extlib/mat_mult.cu". mat_mult.cu error: command 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\bin\nvcc.exe' failed with exit code 1 [end of output] note: This error originates from a subprocess, and is likely not a problem with pip.

I have reinstalled the VS2019 2022 and cuda 11.6, but the problem still exists.

Are there any suggestions for how to fix this?

Thank you all.

luisenp commented 7 months ago

Hi @ggttkl. Are you still having issues installing Theseus? We deprecated torch < 2.0 support some time ago, so it's possible that this is what causing this error.

Also, it looks like you are using Windows? Unfortunately, we don't have any experience testing Theseus on a Windows environment, so I won't have a lot of insight if this is a Windows specific issue.

ggttkl commented 7 months ago

Hi @ggttkl. Are you still having issues installing Theseus? We deprecated torch < 2.0 support some time ago, so it's possible that this is what causing this error.

Also, it looks like you are using Windows? Unfortunately, we don't have any experience testing Theseus on a Windows environment, so I won't have a lot of insight if this is a Windows specific issue.

Thank you for your support!

I installed theseus-ai==0.1.4, and the simple_example worked. I will try the latest version of Theseus again with torch>2.0.

Best regards!