Fail to use "python setup.py install" to install spatial-correlation-sampler
I had cloned “https://github.com/ClementPinard/Pytorch-Correlation-extension” and used the commend: python setup.py install, but there are something worth. I don't know how to tackle that. Help me please.
cuda version: 11.2 pytorch version: 2.0.1 python version: 3.11.4 ubuntu version: 20.04
The follow is the error statement: No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda-11.0' running install /home/xiaojianxin/anaconda3/envs/depth_warehouse_estimation/lib/python3.11/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() /home/xiaojianxin/anaconda3/envs/depth_warehouse_estimation/lib/python3.11/site-packages/setuptools/_distutils/cmd.py:66: 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.
********************************************************************************
!!
self.initialize_options()
running bdist_egg
running egg_info
writing Correlation_Module/spatial_correlation_sampler.egg-info/PKG-INFO
writing dependency_links to Correlation_Module/spatial_correlation_sampler.egg-info/dependency_links.txt
writing requirements to Correlation_Module/spatial_correlation_sampler.egg-info/requires.txt
writing top-level names to Correlation_Module/spatial_correlation_sampler.egg-info/top_level.txt
reading manifest file 'Correlation_Module/spatial_correlation_sampler.egg-info/SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'Correlation_Module/spatial_correlation_sampler.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
running build_ext
Traceback (most recent call last):
File "/home/xiaojianxin/anaconda3/envs/depth_warehouse_estimation/Pytorch-Correlation-extension-master/Pytorch-Correlation-extension-master/setup.py", line 69, in
cuda version: 11.2
No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda-11.0'
Looks like your problem is that the compiler points to the wrong cuda version.
Have you set the environment variable ENV and LD_LIBRARY_PATH ?
https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#environment-setup
cuda version: 11.2
No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda-11.0'Looks like your problem is that the compiler points to the wrong cuda version.
Have you set the environment variable ENV and LD_LIBRARY_PATH ?
https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#environment-setup
Yes, the reason is the incompatible version of CUDA. I use "match = self._regex.search(str(version))" to replace "match = self._regex.search(version)" and then reinstall my torch that version is compatible with my CUDA. Finally, I install spatial-correlation-sampler successfully! Thanks.
cuda version: 11.2
No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda-11.0'Looks like your problem is that the compiler points to the wrong cuda version. Have you set the environment variable ENV and LD_LIBRARY_PATH ? https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#environment-setup
Yes, the reason is the incompatible version of CUDA. I use "match = self._regex.search(str(version))" to replace "match = self._regex.search(version)" and then reinstall my torch that version is compatible with my CUDA. Finally, I install spatial-correlation-sampler successfully! Thanks.
I also encountered this problem, the main reason is that the version of cuda and torch do not match, but after I changed the version of torch, I still have the following problem: (fsam) E:\code\Pytorch-Correlation-extension-master>pip install spatial-correlation-sampler Collecting spatial-correlation-sampler Using cached spatial_correlation_sampler-0.4.0.tar.gz (9.3 kB) Preparing metadata (setup.py) ... done Requirement already satisfied: torch>=1.1 in d:\programdata\anaconda\envs\fsam\lib\site-packages (from spatial-correlation-sampler) (1.12.1+cu113) Requirement already satisfied: numpy in d:\programdata\anaconda\envs\fsam\lib\site-packages (from spatial-correlation-sampler) (1.26.1) Requirement already satisfied: typing-extensions in d:\programdata\anaconda\envs\fsam\lib\site-packages (from torch>=1.1->spatial-correlation-sampler) (4.8.0) Building wheels for collected packages: spatial-correlation-sampler Building wheel for spatial-correlation-sampler (setup.py) ... error error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [22 lines of output] running bdist_wheel D:\ProgramData\anaconda\envs\fsam\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.')) running build running build_py creating build creating build\lib.win-amd64-cpython-39 creating build\lib.win-amd64-cpython-39\spatial_correlation_sampler copying Correlation_Module\spatial_correlation_sampler\spatial_correlation_sampler.py -> build\lib.win-amd64-cpython-39\spatial_correlation_sampler copying Correlation_Module\spatial_correlation_sampler_init_.py -> build\lib.win-amd64-cpython-39\spatial_correlation_sampler running build_ext D:\ProgramData\anaconda\envs\fsam\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 'spatial_correlation_sampler_backend' extension creating build\temp.win-amd64-cpython-39 creating build\temp.win-amd64-cpython-39\Release creating build\temp.win-amd64-cpython-39\Release\Correlation_Module "D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DUSE_CUDA -ID:\ProgramData\anaconda\envs\fsam\lib\site-packages\torch\include -ID:\ProgramData\anaconda\envs\fsam\lib\site-packages\torch\include\torch\csrc\api\include -ID:\ProgramData\anaconda\envs\fsam\lib\site-packages\torch\include\TH -ID:\ProgramData\anaconda\envs\fsam\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\include" -ID:\ProgramData\anaconda\envs\fsam\include -ID:\ProgramData\anaconda\envs\fsam\Include "-ID:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\ATLMFC\include" "-ID:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include" /EHsc /TpCorrelation_Module\correlation.cpp /Fobuild\temp.win-amd64-cpython-39\Release\Correlation_Module\correlation.obj /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /EHsc -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=spatial_correlation_sampler_backend -D_GLIBCXX_USE_CXX11_ABI=0 cl: 命令行 warning D9002 :忽略未知选项“-fopenmp” correlation.cpp D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\cstddef(12): fatal error C1083: 无法打开包括文件: “stddef.h”: No such file or directory error: command 'D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe' failed with exit code 2 [end of output]
note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for spatial-correlation-sampler Running setup.py clean for spatial-correlation-sampler Failed to build spatial-correlation-sampler ERROR: Could not build wheels for spatial-correlation-sampler, which is required to install pyproject.toml-based projects
D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include\cstddef(12): fatal error C1083: 无法打开包括文件: “stddef.h”: No such file or directory
Looks like a microsoft + visual code specific error where it cannot file some standard header file. Is your problem fixed now ?