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

fatal error: THC/THC.h: No such file or directory #1332

Closed
abysee opened this issue Mar 23, 2022 · 11 comments
Closed

fatal error: THC/THC.h: No such file or directory #1332

abysee opened this issue Mar 23, 2022 · 11 comments
Labels
installation/environment Installation and environment issues

Comments

@abysee
Copy link

abysee commented Mar 23, 2022

I got this error when I followed the installation instructions. Everything worked well until
pip install -v -e .
It eventually raised error:

 ...
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    mmdet3d/ops/ball_query/src/ball_query.cpp:4:10: fatal error: THC/THC.h: No such file or directory
     #include <THC/THC.h>
              ^~~~~~~~~~~
    compilation terminated.
    error: command 'gcc' failed with exit status 1
ERROR: Command errored out with exit status 1: 
... 

Could someone please tell me how to solve this?

@ZCMax
Copy link
Collaborator

ZCMax commented Mar 23, 2022

Please run mmdet3d/utils/collect_env.py to check your environment and post here.

@ZihaoLiu97
Copy link

Hi, I have the same problem and I run the mmdet3d/utils/collect_env.py and here is the result.

sys.platform: linux
Python: 3.7.11 (default, Jul 27 2021, 14:32:16) [GCC 7.5.0]
CUDA available: True
GPU 0: NVIDIA GeForce RTX 3060 Laptop GPU
CUDA_HOME: /usr/local/cuda-11.4
NVCC: Build cuda_11.4.r11.4/compiler.30188945_0
GCC: gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
PyTorch: 1.11.0+cu113
PyTorch compiling details: PyTorch built with:

  • GCC 7.3
  • C++ Version: 201402
  • Intel(R) Math Kernel Library Version 2020.0.0 Product Build 20191122 for Intel(R) 64 architecture applications
  • Intel(R) MKL-DNN v2.5.2 (Git Hash a9302535553c73243c632ad3c4c80beec3d19a1e)
  • OpenMP 201511 (a.k.a. OpenMP 4.5)
  • LAPACK is enabled (usually provided by MKL)
  • NNPACK is enabled
  • CPU capability usage: AVX2
  • CUDA Runtime 11.3
  • NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_86,code=sm_86
  • CuDNN 8.2
  • Magma 2.5.2
  • Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.3, CUDNN_VERSION=8.2.0, CXX_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/c++, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.11.0, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=OFF, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, USE_ROCM=OFF,

TorchVision: 0.12.0+cu113
OpenCV: 4.5.1
MMCV: 1.4.7
MMCV Compiler: GCC 9.3
MMCV CUDA Compiler: 11.4
MMDetection: 2.22.0
MMSegmentation: 0.22.1
MMDetection3D: 1.0.0rc0+9c7270d

Process finished with exit code 0

@abysee
Copy link
Author

abysee commented Mar 24, 2022

Please run mmdet3d/utils/collect_env.py to check your environment and post here.

I tried but got the following error:
Traceback (most recent call last): File "collect_env.py", line 6, in <module> import mmdet3d ModuleNotFoundError: No module named 'mmdet3d' .
But the former error aroused when I was trying to install mmdet3d so ...

I manually checked the versions:
TorchVision:1.11.0+cu102
OpenCV:4.5.5.64
MMCV:1.4.7 &1.3.9(when I tried to run mmdet3d/utils/collect_env.py I got an error AssertionError: MMCV==1.4.7 is used but incompatible. Please install mmcv>=1.3.8, <=1.4.0. so I installed two versions. BTW 1.4.7 is the version automatically installed by choosing the corresponding TorchVision.)
GCC 8.4.0
MMDetection:2.14.0
MMSegmentation:0.14.1

@Tai-Wang
Copy link
Member

You should encounter problems during compiling ops possibly because of incompatible gcc or cuda. We recommend you use gcc 5.4 to re-install mmdet3d. Or you can try our latest version by git checkout dev, which needs you to use mmcv > 1.4.7 and there is no need to compile ops in mmdet3d.

@Tai-Wang Tai-Wang added the installation/environment Installation and environment issues label Mar 25, 2022
@abysee
Copy link
Author

abysee commented Mar 27, 2022

I just solved this problem by reinstalling pytorch. I've tried to downgrade gcc, reinstall mmdet3d, had double checked mmcv version and did git checkout dev for mmdet3d but none of them seemed to work.

I referenced an answer on https://discuss.pytorch.org/t/question-about-thc-thc-h/147145. It seems that it would automatically install latest version if you follow the instructions on pytorch website and it could be inadaptable with the environment. I reinstalled pytorch to 1.6 and could successfully install mmdet3d.

Thanks a lot anyway.

@abysee abysee closed this as completed Mar 27, 2022
@olesalscheider
Copy link

Yes, it seems that the TH/THC include files have been removed in the latest pytorch version. mmdet3d still has to be adjusted to these changes, I guess.

@Unicorncosmos
Copy link

Unicorncosmos commented Aug 6, 2023

  • (openmmlab) C:\Users\GOKULNATH\Downloads\bevfusion(1)>python setup.py develop
    running develop
    C:\Users\GOKULNATH\anaconda3\envs\openmmlab\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)
C:\Users\GOKULNATH\anaconda3\envs\openmmlab\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 mmdet3d.egg-info\PKG-INFO
writing dependency_links to mmdet3d.egg-info\dependency_links.txt
writing top-level names to mmdet3d.egg-info\top_level.txt
reading manifest file 'mmdet3d.egg-info\SOURCES.txt'
adding license file 'LICENSE'
writing manifest file 'mmdet3d.egg-info\SOURCES.txt'
running build_ext
C:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\utils\cpp_extension.py:305: UserWarning: Error checking compiler version for cl: [WinError 2] The system cannot find the file specified
warnings.warn(f'Error checking compiler version for {compiler}: {error}')
building 'mmdet3d.ops.spconv.sparse_conv_ext' extension
Emitting ninja build file C:\Users\GOKULNATH\Downloads\bevfusion(1)\build\temp.win-amd64-cpython-39\Release\build.ninja...
Compiling objects...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
[1/4] cl /showIncludes /nologo /O2 /W3 /GL /DNDEBUG /MD /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /EHsc -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include\TH -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include\THC -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\include -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt" -c C:\Users\GOKULNATH\Downloads\bevfusion(1)\mmdet3d\ops\spconv\src\all.cc /FoC:\Users\GOKULNATH\Downloads\bevfusion(1)\build\temp.win-amd64-cpython-39\Release\mmdet3d\ops\spconv\src/all.obj -w -std=c++14 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=sparse_conv_ext -D_GLIBCXX_USE_CXX11_ABI=0 /std:c++14
FAILED: C:/Users/GOKULNATH/Downloads/bevfusion(1)/build/temp.win-amd64-cpython-39/Release/mmdet3d/ops/spconv/src/all.obj
cl /showIncludes /nologo /O2 /W3 /GL /DNDEBUG /MD /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /EHsc -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include\TH -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include\THC -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\include -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt" -c C:\Users\GOKULNATH\Downloads\bevfusion(1)\mmdet3d\ops\spconv\src\all.cc /FoC:\Users\GOKULNATH\Downloads\bevfusion(1)\build\temp.win-amd64-cpython-39\Release\mmdet3d\ops\spconv\src/all.obj -w -std=c++14 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=sparse_conv_ext -D_GLIBCXX_USE_CXX11_ABI=0 /std:c++14
cl : Command line warning D9025 : overriding '/W3' with '/w'
cl : Command line warning D9002 : ignoring unknown option '-std=c++14'
C:\Users\GOKULNATH\Downloads\bevfusion(1)\mmdet3d\ops\spconv\src../include/spconv/fused_spconv_ops.h(18): fatal error C1083: Cannot open include file: 'cuda_runtime_api.h': No such file or directory
[2/4] cl /showIncludes /nologo /O2 /W3 /GL /DNDEBUG /MD /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /EHsc -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include\TH -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include\THC -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\include -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt" -c C:\Users\GOKULNATH\Downloads\bevfusion(1)\mmdet3d\ops\spconv\src\reordering.cc /FoC:\Users\GOKULNATH\Downloads\bevfusion(1)\build\temp.win-amd64-cpython-39\Release\mmdet3d\ops\spconv\src/reordering.obj -w -std=c++14 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=sparse_conv_ext -D_GLIBCXX_USE_CXX11_ABI=0 /std:c++14
FAILED: C:/Users/GOKULNATH/Downloads/bevfusion(1)/build/temp.win-amd64-cpython-39/Release/mmdet3d/ops/spconv/src/reordering.obj
cl /showIncludes /nologo /O2 /W3 /GL /DNDEBUG /MD /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /EHsc -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include\TH -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include\THC -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\include -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt" -c C:\Users\GOKULNATH\Downloads\bevfusion(1)\mmdet3d\ops\spconv\src\reordering.cc /FoC:\Users\GOKULNATH\Downloads\bevfusion(1)\build\temp.win-amd64-cpython-39\Release\mmdet3d\ops\spconv\src/reordering.obj -w -std=c++14 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=sparse_conv_ext -D_GLIBCXX_USE_CXX11_ABI=0 /std:c++14
cl : Command line warning D9025 : overriding '/W3' with '/w'
cl : Command line warning D9002 : ignoring unknown option '-std=c++14'
C:\Users\GOKULNATH\Downloads\bevfusion(1)\mmdet3d\ops\spconv\src\reordering.cc(17): fatal error C1083: Cannot open include file: 'spconv/reordering.h': No such file or directory
[3/4] cl /showIncludes /nologo /O2 /W3 /GL /DNDEBUG /MD /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /EHsc -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include\TH -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include\THC -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\include -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt" -c C:\Users\GOKULNATH\Downloads\bevfusion(1)\mmdet3d\ops\spconv\src\indice.cc /FoC:\Users\GOKULNATH\Downloads\bevfusion(1)\build\temp.win-amd64-cpython-39\Release\mmdet3d\ops\spconv\src/indice.obj -w -std=c++14 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=sparse_conv_ext -D_GLIBCXX_USE_CXX11_ABI=0 /std:c++14
FAILED: C:/Users/GOKULNATH/Downloads/bevfusion(1)/build/temp.win-amd64-cpython-39/Release/mmdet3d/ops/spconv/src/indice.obj
cl /showIncludes /nologo /O2 /W3 /GL /DNDEBUG /MD /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /EHsc -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include\TH -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include\THC -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\include -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt" -c C:\Users\GOKULNATH\Downloads\bevfusion(1)\mmdet3d\ops\spconv\src\indice.cc /FoC:\Users\GOKULNATH\Downloads\bevfusion(1)\build\temp.win-amd64-cpython-39\Release\mmdet3d\ops\spconv\src/indice.obj -w -std=c++14 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=sparse_conv_ext -D_GLIBCXX_USE_CXX11_ABI=0 /std:c++14
cl : Command line warning D9025 : overriding '/W3' with '/w'
cl : Command line warning D9002 : ignoring unknown option '-std=c++14'
C:\Users\GOKULNATH\Downloads\bevfusion(1)\mmdet3d\ops\spconv\src\indice.cc(3): fatal error C1083: Cannot open include file: 'spconv/geometry.h': No such file or directory
[4/4] cl /showIncludes /nologo /O2 /W3 /GL /DNDEBUG /MD /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /EHsc -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include\TH -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include\THC -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\include -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt" -c C:\Users\GOKULNATH\Downloads\bevfusion(1)\mmdet3d\ops\spconv\src\maxpool.cc /FoC:\Users\GOKULNATH\Downloads\bevfusion(1)\build\temp.win-amd64-cpython-39\Release\mmdet3d\ops\spconv\src/maxpool.obj -w -std=c++14 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=sparse_conv_ext -D_GLIBCXX_USE_CXX11_ABI=0 /std:c++14
FAILED: C:/Users/GOKULNATH/Downloads/bevfusion(1)/build/temp.win-amd64-cpython-39/Release/mmdet3d/ops/spconv/src/maxpool.obj
cl /showIncludes /nologo /O2 /W3 /GL /DNDEBUG /MD /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /EHsc -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include\TH -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\include\THC -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\include -IC:\Users\GOKULNATH\anaconda3\envs\openmmlab\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt" -c C:\Users\GOKULNATH\Downloads\bevfusion(1)\mmdet3d\ops\spconv\src\maxpool.cc /FoC:\Users\GOKULNATH\Downloads\bevfusion(1)\build\temp.win-amd64-cpython-39\Release\mmdet3d\ops\spconv\src/maxpool.obj -w -std=c++14 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=sparse_conv_ext -D_GLIBCXX_USE_CXX11_ABI=0 /std:c++14
cl : Command line warning D9025 : overriding '/W3' with '/w'
cl : Command line warning D9002 : ignoring unknown option '-std=c++14'
C:\Users\GOKULNATH\Downloads\bevfusion(1)\mmdet3d\ops\spconv\src\maxpool.cc(15): fatal error C1083: Cannot open include file: 'spconv/maxpool.h': No such file or directory
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File "C:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\utils\cpp_extension.py", line 1666, in _run_ninja_build
subprocess.run(
File "C:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\subprocess.py", line 528, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\GOKULNATH\Downloads\bevfusion(1)\setup.py", line 17, in
setup(
File "C:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\setuptools_init_.py", line 107, in setup
return distutils.core.setup(**attrs)
File "C:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\setuptools_distutils\core.py", line 185, in setup
return run_commands(dist)
File "C:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\setuptools_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\setuptools_distutils\dist.py", line 969, in run_commands
self.run_command(cmd)
File "C:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\setuptools\dist.py", line 1234, in run_command
super().run_command(command)
File "C:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\setuptools_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\setuptools\command\develop.py", line 34, in run
self.install_for_development()
File "C:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\setuptools\command\develop.py", line 111, in install_for_development
self.run_command('build_ext')
File "C:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\setuptools_distutils\cmd.py", line 318, in run_command
self.distribution.run_command(command)
File "C:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\setuptools\dist.py", line 1234, in run_command
super().run_command(command)
File "C:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\setuptools_distutils\dist.py", line 988, in run_command
cmd_obj.run()
File "C:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\setuptools\command\build_ext.py", line 84, in run
_build_ext.run(self)
File "C:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\setuptools_distutils\command\build_ext.py", line 345, in run
self.build_extensions()
File "C:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\utils\cpp_extension.py", line 709, in build_extensions
build_ext.build_extensions(self)
File "C:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\setuptools_distutils\command\build_ext.py", line 467, in build_extensions
self._build_extensions_serial()
File "C:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\setuptools_distutils\command\build_ext.py", line 493, in _build_extensions_serial
self.build_extension(ext)
File "C:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\setuptools\command\build_ext.py", line 246, in build_extension
_build_ext.build_extension(self, ext)
File "C:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\Cython\Distutils\build_ext.py", line 127, in build_extension
super(build_ext, self).build_extension(ext)
File "C:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\setuptools_distutils\command\build_ext.py", line 548, in build_extension
objects = self.compiler.compile(
File "C:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\utils\cpp_extension.py", line 682, in win_wrap_ninja_compile
_write_ninja_file_and_compile_objects(
File "C:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\utils\cpp_extension.py", line 1355, in _write_ninja_file_and_compile_objects
_run_ninja_build(
File "C:\Users\GOKULNATH\anaconda3\envs\openmmlab\lib\site-packages\torch\utils\cpp_extension.py", line 1682, in _run_ninja_build
raise RuntimeError(message) from e
RuntimeError: Error compiling objects for extension

(openmmlab) C:\Users\GOKULNATH\Downloads\bevfusion(1)>

@ZubairKhan001
Copy link

Pytorch 1.11 has deleted the folder THC/THC.h. I faced the same issue, downgrading to pytorch 1.8 solved the issue.

@yizhou-wang
Copy link

Hi, is there a way to solve this issue with pytorch==2.1 and cuda==12.1? Thanks!

@KisAaki
Copy link

KisAaki commented Oct 16, 2024

Hi, is there a way to solve this issue with pytorch==2.1 and cuda==12.1? Thanks!

same too.

@LiaoYuanF
Copy link

Hi, is there a way to solve this issue with pytorch==2.1 and cuda==12.1? Thanks!你好,有没有办法用pytorch==2.1cuda==12.1解决这个问题?谢谢!

same too. 也一样。

just delete #include <THC/THC.h> and extern THCState *state;
it can run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installation/environment Installation and environment issues
Projects
None yet
Development

No branches or pull requests

10 participants