facebookresearch / detectron2

Detectron2 is a platform for object detection, segmentation and other visual recognition tasks.
https://detectron2.readthedocs.io/en/latest/
Apache License 2.0
30.34k stars 7.46k forks source link

met this error while running `pip install -e detectron2` on RTX3090 CUDA 11.2 #3258

Closed kayleeliyx closed 3 years ago

kayleeliyx commented 3 years ago
Installing collected packages: detectron2
  Running setup.py develop for detectron2
    ERROR: Command errored out with exit status 1:
     command: /home/andong/anaconda3/envs/py36/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/andong/Documents/detectron2/setup.py'"'"'; __file__='"'"'/home/andong/Documents/detectron2/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
         cwd: /home/andong/Documents/detectron2/
    Complete output (144 lines):
    running develop
    running egg_info
    writing detectron2.egg-info/PKG-INFO
    writing dependency_links to detectron2.egg-info/dependency_links.txt
    writing requirements to detectron2.egg-info/requires.txt
    writing top-level names to detectron2.egg-info/top_level.txt
    reading manifest file 'detectron2.egg-info/SOURCES.txt'
    writing manifest file 'detectron2.egg-info/SOURCES.txt'
    running build_ext
    building 'detectron2._C' extension
    Emitting ninja build file /home/andong/Documents/detectron2/build/temp.linux-x86_64-3.6/build.ninja...
    Compiling objects...
    Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
    [1/11] /usr/local/cuda-11.3/bin/nvcc  -DWITH_CUDA -I/home/andong/Documents/detectron2/detectron2/layers/csrc -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/TH -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/andong/anaconda3/envs/py36/include/python3.6m -c -c /home/andong/Documents/detectron2/detectron2/layers/csrc/cuda_version.cu -o /home/andong/Documents/detectron2/build/temp.linux-x86_64-3.6/home/andong/Documents/detectron2/detectron2/layers/csrc/cuda_version.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O3 -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++14
    [2/11] c++ -MMD -MF /home/andong/Documents/detectron2/build/temp.linux-x86_64-3.6/home/andong/Documents/detectron2/detectron2/layers/csrc/box_iou_rotated/box_iou_rotated_cpu.o.d -pthread -B /home/andong/anaconda3/envs/py36/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/andong/Documents/detectron2/detectron2/layers/csrc -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/TH -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/andong/anaconda3/envs/py36/include/python3.6m -c -c /home/andong/Documents/detectron2/detectron2/layers/csrc/box_iou_rotated/box_iou_rotated_cpu.cpp -o /home/andong/Documents/detectron2/build/temp.linux-x86_64-3.6/home/andong/Documents/detectron2/detectron2/layers/csrc/box_iou_rotated/box_iou_rotated_cpu.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
    cc1plus: warning: command-line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    [3/11] /usr/local/cuda-11.3/bin/nvcc  -DWITH_CUDA -I/home/andong/Documents/detectron2/detectron2/layers/csrc -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/TH -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/andong/anaconda3/envs/py36/include/python3.6m -c -c /home/andong/Documents/detectron2/detectron2/layers/csrc/deformable/deform_conv_cuda_kernel.cu -o /home/andong/Documents/detectron2/build/temp.linux-x86_64-3.6/home/andong/Documents/detectron2/detectron2/layers/csrc/deformable/deform_conv_cuda_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O3 -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++14
    FAILED: /home/andong/Documents/detectron2/build/temp.linux-x86_64-3.6/home/andong/Documents/detectron2/detectron2/layers/csrc/deformable/deform_conv_cuda_kernel.o
    /usr/local/cuda-11.3/bin/nvcc  -DWITH_CUDA -I/home/andong/Documents/detectron2/detectron2/layers/csrc -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/TH -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/andong/anaconda3/envs/py36/include/python3.6m -c -c /home/andong/Documents/detectron2/detectron2/layers/csrc/deformable/deform_conv_cuda_kernel.cu -o /home/andong/Documents/detectron2/build/temp.linux-x86_64-3.6/home/andong/Documents/detectron2/detectron2/layers/csrc/deformable/deform_conv_cuda_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O3 -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++14
    /usr/include/c++/10/chrono: In substitution of ‘template<class _Rep, class _Period> template<class _Period2> using __is_harmonic = std::__bool_constant<(std::ratio<((_Period2::num / std::chrono::duration<_Rep, _Period>::_S_gcd(_Period2::num, _Period::num)) * (_Period::den / std::chrono::duration<_Rep, _Period>::_S_gcd(_Period2::den, _Period::den))), ((_Period2::den / std::chrono::duration<_Rep, _Period>::_S_gcd(_Period2::den, _Period::den)) * (_Period::num / std::chrono::duration<_Rep, _Period>::_S_gcd(_Period2::num, _Period::num)))>::den == 1)> [with _Period2 = _Period2; _Rep = _Rep; _Period = _Period]’:
    /usr/include/c++/10/chrono:473:154:   required from here
    /usr/include/c++/10/chrono:428:27: internal compiler error: Segmentation fault
      428 |  _S_gcd(intmax_t __m, intmax_t __n) noexcept
          |                           ^~~~~~
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <file:///usr/share/doc/gcc-10/README.Bugs> for instructions.
    [4/11] /usr/local/cuda-11.3/bin/nvcc  -DWITH_CUDA -I/home/andong/Documents/detectron2/detectron2/layers/csrc -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/TH -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/andong/anaconda3/envs/py36/include/python3.6m -c -c /home/andong/Documents/detectron2/detectron2/layers/csrc/box_iou_rotated/box_iou_rotated_cuda.cu -o /home/andong/Documents/detectron2/build/temp.linux-x86_64-3.6/home/andong/Documents/detectron2/detectron2/layers/csrc/box_iou_rotated/box_iou_rotated_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O3 -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++14
    FAILED: /home/andong/Documents/detectron2/build/temp.linux-x86_64-3.6/home/andong/Documents/detectron2/detectron2/layers/csrc/box_iou_rotated/box_iou_rotated_cuda.o
    /usr/local/cuda-11.3/bin/nvcc  -DWITH_CUDA -I/home/andong/Documents/detectron2/detectron2/layers/csrc -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/TH -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/andong/anaconda3/envs/py36/include/python3.6m -c -c /home/andong/Documents/detectron2/detectron2/layers/csrc/box_iou_rotated/box_iou_rotated_cuda.cu -o /home/andong/Documents/detectron2/build/temp.linux-x86_64-3.6/home/andong/Documents/detectron2/detectron2/layers/csrc/box_iou_rotated/box_iou_rotated_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O3 -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++14
    /usr/include/c++/10/chrono: In substitution of ‘template<class _Rep, class _Period> template<class _Period2> using __is_harmonic = std::__bool_constant<(std::ratio<((_Period2::num / std::chrono::duration<_Rep, _Period>::_S_gcd(_Period2::num, _Period::num)) * (_Period::den / std::chrono::duration<_Rep, _Period>::_S_gcd(_Period2::den, _Period::den))), ((_Period2::den / std::chrono::duration<_Rep, _Period>::_S_gcd(_Period2::den, _Period::den)) * (_Period::num / std::chrono::duration<_Rep, _Period>::_S_gcd(_Period2::num, _Period::num)))>::den == 1)> [with _Period2 = _Period2; _Rep = _Rep; _Period = _Period]’:
    /usr/include/c++/10/chrono:473:154:   required from here
    /usr/include/c++/10/chrono:428:27: internal compiler error: Segmentation fault
      428 |  _S_gcd(intmax_t __m, intmax_t __n) noexcept
          |                           ^~~~~~
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <file:///usr/share/doc/gcc-10/README.Bugs> for instructions.
    [5/11] c++ -MMD -MF /home/andong/Documents/detectron2/build/temp.linux-x86_64-3.6/home/andong/Documents/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o.d -pthread -B /home/andong/anaconda3/envs/py36/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/andong/Documents/detectron2/detectron2/layers/csrc -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/TH -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/andong/anaconda3/envs/py36/include/python3.6m -c -c /home/andong/Documents/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.cpp -o /home/andong/Documents/detectron2/build/temp.linux-x86_64-3.6/home/andong/Documents/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
    cc1plus: warning: command-line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    [6/11] /usr/local/cuda-11.3/bin/nvcc  -DWITH_CUDA -I/home/andong/Documents/detectron2/detectron2/layers/csrc -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/TH -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/andong/anaconda3/envs/py36/include/python3.6m -c -c /home/andong/Documents/detectron2/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cuda.cu -o /home/andong/Documents/detectron2/build/temp.linux-x86_64-3.6/home/andong/Documents/detectron2/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O3 -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++14
    FAILED: /home/andong/Documents/detectron2/build/temp.linux-x86_64-3.6/home/andong/Documents/detectron2/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cuda.o
    /usr/local/cuda-11.3/bin/nvcc  -DWITH_CUDA -I/home/andong/Documents/detectron2/detectron2/layers/csrc -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/TH -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/andong/anaconda3/envs/py36/include/python3.6m -c -c /home/andong/Documents/detectron2/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cuda.cu -o /home/andong/Documents/detectron2/build/temp.linux-x86_64-3.6/home/andong/Documents/detectron2/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O3 -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++14
    /usr/include/c++/10/chrono: In substitution of ‘template<class _Rep, class _Period> template<class _Period2> using __is_harmonic = std::__bool_constant<(std::ratio<((_Period2::num / std::chrono::duration<_Rep, _Period>::_S_gcd(_Period2::num, _Period::num)) * (_Period::den / std::chrono::duration<_Rep, _Period>::_S_gcd(_Period2::den, _Period::den))), ((_Period2::den / std::chrono::duration<_Rep, _Period>::_S_gcd(_Period2::den, _Period::den)) * (_Period::num / std::chrono::duration<_Rep, _Period>::_S_gcd(_Period2::num, _Period::num)))>::den == 1)> [with _Period2 = _Period2; _Rep = _Rep; _Period = _Period]’:
    /usr/include/c++/10/chrono:473:154:   required from here
    /usr/include/c++/10/chrono:428:27: internal compiler error: Segmentation fault
      428 |  _S_gcd(intmax_t __m, intmax_t __n) noexcept
          |                           ^~~~~~
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <file:///usr/share/doc/gcc-10/README.Bugs> for instructions.
    [7/11] c++ -MMD -MF /home/andong/Documents/detectron2/build/temp.linux-x86_64-3.6/home/andong/Documents/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cpu.o.d -pthread -B /home/andong/anaconda3/envs/py36/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/andong/Documents/detectron2/detectron2/layers/csrc -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/TH -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/andong/anaconda3/envs/py36/include/python3.6m -c -c /home/andong/Documents/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cpu.cpp -o /home/andong/Documents/detectron2/build/temp.linux-x86_64-3.6/home/andong/Documents/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cpu.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
    cc1plus: warning: command-line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    [8/11] /usr/local/cuda-11.3/bin/nvcc  -DWITH_CUDA -I/home/andong/Documents/detectron2/detectron2/layers/csrc -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/TH -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/andong/anaconda3/envs/py36/include/python3.6m -c -c /home/andong/Documents/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu -o /home/andong/Documents/detectron2/build/temp.linux-x86_64-3.6/home/andong/Documents/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O3 -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++14
    FAILED: /home/andong/Documents/detectron2/build/temp.linux-x86_64-3.6/home/andong/Documents/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.o
    /usr/local/cuda-11.3/bin/nvcc  -DWITH_CUDA -I/home/andong/Documents/detectron2/detectron2/layers/csrc -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/TH -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/andong/anaconda3/envs/py36/include/python3.6m -c -c /home/andong/Documents/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu -o /home/andong/Documents/detectron2/build/temp.linux-x86_64-3.6/home/andong/Documents/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O3 -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++14
    /usr/include/c++/10/chrono: In substitution of ‘template<class _Rep, class _Period> template<class _Period2> using __is_harmonic = std::__bool_constant<(std::ratio<((_Period2::num / std::chrono::duration<_Rep, _Period>::_S_gcd(_Period2::num, _Period::num)) * (_Period::den / std::chrono::duration<_Rep, _Period>::_S_gcd(_Period2::den, _Period::den))), ((_Period2::den / std::chrono::duration<_Rep, _Period>::_S_gcd(_Period2::den, _Period::den)) * (_Period::num / std::chrono::duration<_Rep, _Period>::_S_gcd(_Period2::num, _Period::num)))>::den == 1)> [with _Period2 = _Period2; _Rep = _Rep; _Period = _Period]’:
    /usr/include/c++/10/chrono:473:154:   required from here
    /usr/include/c++/10/chrono:428:27: internal compiler error: Segmentation fault
      428 |  _S_gcd(intmax_t __m, intmax_t __n) noexcept
          |                           ^~~~~~
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <file:///usr/share/doc/gcc-10/README.Bugs> for instructions.
    [9/11] c++ -MMD -MF /home/andong/Documents/detectron2/build/temp.linux-x86_64-3.6/home/andong/Documents/detectron2/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cpu.o.d -pthread -B /home/andong/anaconda3/envs/py36/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/andong/Documents/detectron2/detectron2/layers/csrc -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/TH -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/andong/anaconda3/envs/py36/include/python3.6m -c -c /home/andong/Documents/detectron2/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cpu.cpp -o /home/andong/Documents/detectron2/build/temp.linux-x86_64-3.6/home/andong/Documents/detectron2/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cpu.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
    cc1plus: warning: command-line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    [10/11] /usr/local/cuda-11.3/bin/nvcc  -DWITH_CUDA -I/home/andong/Documents/detectron2/detectron2/layers/csrc -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/TH -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/andong/anaconda3/envs/py36/include/python3.6m -c -c /home/andong/Documents/detectron2/detectron2/layers/csrc/deformable/deform_conv_cuda.cu -o /home/andong/Documents/detectron2/build/temp.linux-x86_64-3.6/home/andong/Documents/detectron2/detectron2/layers/csrc/deformable/deform_conv_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O3 -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++14
    FAILED: /home/andong/Documents/detectron2/build/temp.linux-x86_64-3.6/home/andong/Documents/detectron2/detectron2/layers/csrc/deformable/deform_conv_cuda.o
    /usr/local/cuda-11.3/bin/nvcc  -DWITH_CUDA -I/home/andong/Documents/detectron2/detectron2/layers/csrc -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/TH -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/andong/anaconda3/envs/py36/include/python3.6m -c -c /home/andong/Documents/detectron2/detectron2/layers/csrc/deformable/deform_conv_cuda.cu -o /home/andong/Documents/detectron2/build/temp.linux-x86_64-3.6/home/andong/Documents/detectron2/detectron2/layers/csrc/deformable/deform_conv_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O3 -DCUDA_HAS_FP16=1 -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 -std=c++14
    /usr/include/c++/10/chrono: In substitution of ‘template<class _Rep, class _Period> template<class _Period2> using __is_harmonic = std::__bool_constant<(std::ratio<((_Period2::num / std::chrono::duration<_Rep, _Period>::_S_gcd(_Period2::num, _Period::num)) * (_Period::den / std::chrono::duration<_Rep, _Period>::_S_gcd(_Period2::den, _Period::den))), ((_Period2::den / std::chrono::duration<_Rep, _Period>::_S_gcd(_Period2::den, _Period::den)) * (_Period::num / std::chrono::duration<_Rep, _Period>::_S_gcd(_Period2::num, _Period::num)))>::den == 1)> [with _Period2 = _Period2; _Rep = _Rep; _Period = _Period]’:
    /usr/include/c++/10/chrono:473:154:   required from here
    /usr/include/c++/10/chrono:428:27: internal compiler error: Segmentation fault
      428 |  _S_gcd(intmax_t __m, intmax_t __n) noexcept
          |                           ^~~~~~
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <file:///usr/share/doc/gcc-10/README.Bugs> for instructions.
    [11/11] c++ -MMD -MF /home/andong/Documents/detectron2/build/temp.linux-x86_64-3.6/home/andong/Documents/detectron2/detectron2/layers/csrc/vision.o.d -pthread -B /home/andong/anaconda3/envs/py36/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/andong/Documents/detectron2/detectron2/layers/csrc -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/TH -I/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/THC -I/usr/local/cuda-11.3/include -I/home/andong/anaconda3/envs/py36/include/python3.6m -c -c /home/andong/Documents/detectron2/detectron2/layers/csrc/vision.cpp -o /home/andong/Documents/detectron2/build/temp.linux-x86_64-3.6/home/andong/Documents/detectron2/detectron2/layers/csrc/vision.o -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14
    cc1plus: warning: command-line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    In file included from /home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/ATen/Parallel.h:140,
                     from /home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/utils.h:3,
                     from /home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:5,
                     from /home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/nn.h:3,
                     from /home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/all.h:13,
                     from /home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/torch/extension.h:4,
                     from /home/andong/Documents/detectron2/detectron2/layers/csrc/vision.cpp:3:
    /home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/include/ATen/ParallelOpenMP.h:87: warning: ignoring ‘#pragma omp parallel’ [-Wunknown-pragmas]
       87 | #pragma omp parallel for if ((end - begin) >= grain_size)
          |
    ninja: build stopped: subcommand failed.
    Traceback (most recent call last):
      File "/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1672, in _run_ninja_build
        env=env)
      File "/home/andong/anaconda3/envs/py36/lib/python3.6/subprocess.py", line 438, in run
        output=stdout, stderr=stderr)
    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 "<string>", line 1, in <module>
      File "/home/andong/Documents/detectron2/setup.py", line 207, in <module>
        cmdclass={"build_ext": torch.utils.cpp_extension.BuildExtension},
      File "/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/setuptools/__init__.py", line 153, in setup
        return distutils.core.setup(**attrs)
      File "/home/andong/anaconda3/envs/py36/lib/python3.6/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/home/andong/anaconda3/envs/py36/lib/python3.6/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/home/andong/anaconda3/envs/py36/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/setuptools/command/develop.py", line 34, in run
        self.install_for_development()
      File "/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/setuptools/command/develop.py", line 136, in install_for_development
        self.run_command('build_ext')
      File "/home/andong/anaconda3/envs/py36/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/home/andong/anaconda3/envs/py36/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 79, in run
        _build_ext.run(self)
      File "/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
        _build_ext.build_ext.run(self)
      File "/home/andong/anaconda3/envs/py36/lib/python3.6/distutils/command/build_ext.py", line 339, in run
        self.build_extensions()
      File "/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 709, in build_extensions
        build_ext.build_extensions(self)
      File "/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/Cython/Distutils/old_build_ext.py", line 195, in build_extensions
        _build_ext.build_ext.build_extensions(self)
      File "/home/andong/anaconda3/envs/py36/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
        self._build_extensions_serial()
      File "/home/andong/anaconda3/envs/py36/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
        self.build_extension(ext)
      File "/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 196, in build_extension
        _build_ext.build_extension(self, ext)
      File "/home/andong/anaconda3/envs/py36/lib/python3.6/distutils/command/build_ext.py", line 533, in build_extension
        depends=ext.depends)
      File "/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 539, in unix_wrap_ninja_compile
        with_cuda=with_cuda)
      File "/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1360, in _write_ninja_file_and_compile_objects
        error_prefix='Error compiling objects for extension')
      File "/home/andong/anaconda3/envs/py36/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1682, in _run_ninja_build
        raise RuntimeError(message) from e
    RuntimeError: Error compiling objects for extension
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/andong/anaconda3/envs/py36/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/andong/Documents/detectron2/setup.py'"'"'; __file__='"'"'/home/andong/Documents/detectron2/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.
github-actions[bot] commented 3 years ago

You've chosen to report an unexpected problem or bug. Unless you already know the root cause of it, please include details about it by filling the issue template. The following information is missing: "Instructions To Reproduce the Issue and Full Logs";

lyhsieh commented 3 years ago

I also met this problem before. I reinstalled my cuda driver and the problem was solved.

kayleeliyx commented 3 years ago

I also met this problem before. I reinstalled my cuda driver and the problem was solved.

May I ask what kind of CUDA driver are you using? which version?

lyhsieh commented 3 years ago

cuda 11.2

kayleeliyx commented 3 years ago

Still couldn't work

I changed to 11.2 and reinstalled everything.

I met the same error. But I found one solution here: https://blog.csdn.net/baobei0112/article/details/114521271

After doing that, I met this one: https://github.com/facebookresearch/detectron2/issues/3269#issue-950330368

ppwwyyxx commented 3 years ago

Duplicate of https://github.com/pytorch/pytorch/issues/57423

kayleeliyx commented 3 years ago

Duplicate of pytorch/pytorch#57423

Sorry but there is no answer in the https://github.com/pytorch/pytorch/issues/57423#issue-873792193

May I ask what's the solution for this?

ppwwyyxx commented 3 years ago

As the other issue says its a GCC bug so the solution is to use a different GCC.