Detectron2: Build error: unsupported GNU version! gcc versions later than 6 are not supported

Created on 21 Sep 2020  Â·  6Comments  Â·  Source: facebookresearch/detectron2

Hi,

I am running into an issue installing detectron2 from a cloned repository. Details are provided below. Any help would be much appreciated!

Instructions To Reproduce the Issue:

  1. full code you wrote or full changes you made (git diff)
    None

  2. what exact command you run: python -m pip install -e detectron2

  3. __full logs__ you observed:

ERROR: Command errored out with exit status 1:
     command: /home/johndoe/anaconda3/envs/mtr_env/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/johndoe/code/mtr/detectron2/setup.py'"'"'; __file__='"'"'/home/johndoe/code/mtr/detectron2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
         cwd: /home/johndoe/code/mtr/detectron2/
    Complete output (170 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
    creating /home/johndoe/code/mtr/detectron2/build
    creating /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7
    creating /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/bmrNAS
    creating /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/bmrNAS/people
    creating /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe
    creating /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code
    creating /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr
    creating /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2
    creating /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2
    creating /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers
    creating /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc
    creating /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/ROIAlign
    creating /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/ROIAlignRotated
    creating /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/box_iou_rotated
    creating /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/cocoeval
    creating /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/nms_rotated
    creating /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/deformable
    Emitting ninja build file /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/build.ninja...
    Compiling objects...
    Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
    [1/13] /usr/local/cuda/bin/nvcc -DWITH_CUDA -I/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/TH -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/johndoe/anaconda3/envs/mtr_env/include/python3.7m -c -c /home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/cuda_version.cu -o /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/cuda_version.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_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 -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_61,code=sm_61 -std=c++14
    FAILED: /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/cuda_version.o
    /usr/local/cuda/bin/nvcc -DWITH_CUDA -I/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/TH -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/johndoe/anaconda3/envs/mtr_env/include/python3.7m -c -c /home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/cuda_version.cu -o /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/cuda_version.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_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 -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_61,code=sm_61 -std=c++14
    In file included from /usr/local/cuda/include/host_config.h:50,
                     from /usr/local/cuda/include/cuda_runtime.h:78,
                     from <command-line>:
    /usr/local/cuda/include/crt/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!
      119 | #error -- unsupported GNU version! gcc versions later than 6 are not supported!
          |  ^~~~~
    [2/13] /usr/local/cuda/bin/nvcc -DWITH_CUDA -I/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/TH -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/johndoe/anaconda3/envs/mtr_env/include/python3.7m -c -c /home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/deformable/deform_conv_cuda.cu -o /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/deformable/deform_conv_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_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 -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_61,code=sm_61 -std=c++14
    FAILED: /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/deformable/deform_conv_cuda.o
    /usr/local/cuda/bin/nvcc -DWITH_CUDA -I/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/TH -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/johndoe/anaconda3/envs/mtr_env/include/python3.7m -c -c /home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/deformable/deform_conv_cuda.cu -o /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/deformable/deform_conv_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_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 -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_61,code=sm_61 -std=c++14
    In file included from /usr/local/cuda/include/host_config.h:50,
                     from /usr/local/cuda/include/cuda_runtime.h:78,
                     from <command-line>:
    /usr/local/cuda/include/crt/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!
      119 | #error -- unsupported GNU version! gcc versions later than 6 are not supported!
          |  ^~~~~
    [3/13] /usr/local/cuda/bin/nvcc -DWITH_CUDA -I/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/TH -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/johndoe/anaconda3/envs/mtr_env/include/python3.7m -c -c /home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/ROIAlign/ROIAlign_cuda.cu -o /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/ROIAlign/ROIAlign_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_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 -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_61,code=sm_61 -std=c++14
    FAILED: /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/ROIAlign/ROIAlign_cuda.o
    /usr/local/cuda/bin/nvcc -DWITH_CUDA -I/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/TH -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/johndoe/anaconda3/envs/mtr_env/include/python3.7m -c -c /home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/ROIAlign/ROIAlign_cuda.cu -o /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/ROIAlign/ROIAlign_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_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 -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_61,code=sm_61 -std=c++14
    In file included from /usr/local/cuda/include/host_config.h:50,
                     from /usr/local/cuda/include/cuda_runtime.h:78,
                     from <command-line>:
    /usr/local/cuda/include/crt/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!
      119 | #error -- unsupported GNU version! gcc versions later than 6 are not supported!
          |  ^~~~~
    [4/13] /usr/local/cuda/bin/nvcc -DWITH_CUDA -I/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/TH -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/johndoe/anaconda3/envs/mtr_env/include/python3.7m -c -c /home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/box_iou_rotated/box_iou_rotated_cuda.cu -o /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/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_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 -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_61,code=sm_61 -std=c++14
    FAILED: /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/box_iou_rotated/box_iou_rotated_cuda.o
    /usr/local/cuda/bin/nvcc -DWITH_CUDA -I/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/TH -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/johndoe/anaconda3/envs/mtr_env/include/python3.7m -c -c /home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/box_iou_rotated/box_iou_rotated_cuda.cu -o /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/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_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 -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_61,code=sm_61 -std=c++14
    In file included from /usr/local/cuda/include/host_config.h:50,
                     from /usr/local/cuda/include/cuda_runtime.h:78,
                     from <command-line>:
    /usr/local/cuda/include/crt/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!
      119 | #error -- unsupported GNU version! gcc versions later than 6 are not supported!
          |  ^~~~~
    [5/13] /usr/local/cuda/bin/nvcc -DWITH_CUDA -I/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/TH -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/johndoe/anaconda3/envs/mtr_env/include/python3.7m -c -c /home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/deformable/deform_conv_cuda_kernel.cu -o /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/deformable/deform_conv_cuda_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_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 -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_61,code=sm_61 -std=c++14
    FAILED: /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/deformable/deform_conv_cuda_kernel.o
    /usr/local/cuda/bin/nvcc -DWITH_CUDA -I/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/TH -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/johndoe/anaconda3/envs/mtr_env/include/python3.7m -c -c /home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/deformable/deform_conv_cuda_kernel.cu -o /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/deformable/deform_conv_cuda_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_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 -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_61,code=sm_61 -std=c++14
    In file included from /usr/local/cuda/include/host_config.h:50,
                     from /usr/local/cuda/include/cuda_runtime.h:78,
                     from <command-line>:
    /usr/local/cuda/include/crt/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!
      119 | #error -- unsupported GNU version! gcc versions later than 6 are not supported!
          |  ^~~~~
    [6/13] /usr/local/cuda/bin/nvcc -DWITH_CUDA -I/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/TH -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/johndoe/anaconda3/envs/mtr_env/include/python3.7m -c -c /home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu -o /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_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 -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_61,code=sm_61 -std=c++14
    FAILED: /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.o
    /usr/local/cuda/bin/nvcc -DWITH_CUDA -I/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/TH -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/johndoe/anaconda3/envs/mtr_env/include/python3.7m -c -c /home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.cu -o /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_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 -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_61,code=sm_61 -std=c++14
    In file included from /usr/local/cuda/include/host_config.h:50,
                     from /usr/local/cuda/include/cuda_runtime.h:78,
                     from <command-line>:
    /usr/local/cuda/include/crt/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!
      119 | #error -- unsupported GNU version! gcc versions later than 6 are not supported!
          |  ^~~~~
    [7/13] /usr/local/cuda/bin/nvcc -DWITH_CUDA -I/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/TH -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/johndoe/anaconda3/envs/mtr_env/include/python3.7m -c -c /home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cuda.cu -o /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_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 -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_61,code=sm_61 -std=c++14
    FAILED: /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cuda.o
    /usr/local/cuda/bin/nvcc -DWITH_CUDA -I/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/TH -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/johndoe/anaconda3/envs/mtr_env/include/python3.7m -c -c /home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cuda.cu -o /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_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 -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_61,code=sm_61 -std=c++14
    In file included from /usr/local/cuda/include/host_config.h:50,
                     from /usr/local/cuda/include/cuda_runtime.h:78,
                     from <command-line>:
    /usr/local/cuda/include/crt/host_config.h:119:2: error: #error -- unsupported GNU version! gcc versions later than 6 are not supported!
      119 | #error -- unsupported GNU version! gcc versions later than 6 are not supported!
          |  ^~~~~
    [8/13] c++ -MMD -MF /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/box_iou_rotated/box_iou_rotated_cpu.o.d -pthread -B /home/johndoe/anaconda3/envs/mtr_env/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/TH -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/johndoe/anaconda3/envs/mtr_env/include/python3.7m -c -c /home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/box_iou_rotated/box_iou_rotated_cpu.cpp -o /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/box_iou_rotated/box_iou_rotated_cpu.o -DTORCH_API_INCLUDE_EXTENSION_H -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++
    [9/13] c++ -MMD -MF /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cpu.o.d -pthread -B /home/johndoe/anaconda3/envs/mtr_env/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/TH -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/johndoe/anaconda3/envs/mtr_env/include/python3.7m -c -c /home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cpu.cpp -o /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cpu.o -DTORCH_API_INCLUDE_EXTENSION_H -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/13] c++ -MMD -MF /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o.d -pthread -B /home/johndoe/anaconda3/envs/mtr_env/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/TH -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/johndoe/anaconda3/envs/mtr_env/include/python3.7m -c -c /home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.cpp -o /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o -DTORCH_API_INCLUDE_EXTENSION_H -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++
    [11/13] c++ -MMD -MF /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/ROIAlign/ROIAlign_cpu.o.d -pthread -B /home/johndoe/anaconda3/envs/mtr_env/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/TH -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/johndoe/anaconda3/envs/mtr_env/include/python3.7m -c -c /home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/ROIAlign/ROIAlign_cpu.cpp -o /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/ROIAlign/ROIAlign_cpu.o -DTORCH_API_INCLUDE_EXTENSION_H -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++
    [12/13] c++ -MMD -MF /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cpu.o.d -pthread -B /home/johndoe/anaconda3/envs/mtr_env/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/TH -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/johndoe/anaconda3/envs/mtr_env/include/python3.7m -c -c /home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cpu.cpp -o /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cpu.o -DTORCH_API_INCLUDE_EXTENSION_H -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++
    [13/13] c++ -MMD -MF /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/vision.o.d -pthread -B /home/johndoe/anaconda3/envs/mtr_env/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DWITH_CUDA -I/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/TH -I/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/johndoe/anaconda3/envs/mtr_env/include/python3.7m -c -c /home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/vision.cpp -o /home/johndoe/code/mtr/detectron2/build/temp.linux-x86_64-3.7/home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/vision.o -DTORCH_API_INCLUDE_EXTENSION_H -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/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/ATen/Parallel.h:149,
                     from /home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/utils.h:3,
                     from /home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn/cloneable.h:5,
                     from /home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/nn.h:3,
                     from /home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/torch/csrc/api/include/torch/all.h:7,
                     from /home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/torch/extension.h:4,
                     from /home/johndoe/code/mtr/detectron2/detectron2/layers/csrc/vision.cpp:3:
    /home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/include/ATen/ParallelOpenMP.h:84: warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
       84 | #pragma omp parallel for if ((end - begin) >= grain_size)
          |
    ninja: build stopped: subcommand failed.
    Traceback (most recent call last):
      File "/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1515, in _run_ninja_build
        env=env)
      File "/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/subprocess.py", line 512, in run
        output=stdout, stderr=stderr)
    subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/johndoe/code/mtr/detectron2/setup.py", line 210, in <module>
        cmdclass={"build_ext": torch.utils.cpp_extension.BuildExtension},
      File "/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/setuptools/__init__.py", line 163, in setup
        return distutils.core.setup(**attrs)
      File "/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/setuptools/command/develop.py", line 38, in run
        self.install_for_development()
      File "/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/setuptools/command/develop.py", line 140, in install_for_development
        self.run_command('build_ext')
      File "/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 87, in run
        _build_ext.run(self)
      File "/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
        _build_ext.build_ext.run(self)
      File "/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/distutils/command/build_ext.py", line 340, in run
        self.build_extensions()
      File "/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 649, in build_extensions
        build_ext.build_extensions(self)
      File "/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/Cython/Distutils/old_build_ext.py", line 195, in build_extensions
        _build_ext.build_ext.build_extensions(self)
      File "/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/distutils/command/build_ext.py", line 449, in build_extensions
        self._build_extensions_serial()
      File "/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/distutils/command/build_ext.py", line 474, in _build_extensions_serial
        self.build_extension(ext)
      File "/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 208, in build_extension
        _build_ext.build_extension(self, ext)
      File "/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/distutils/command/build_ext.py", line 534, in build_extension
        depends=ext.depends)
      File "/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 478, in unix_wrap_ninja_compile
        with_cuda=with_cuda)
      File "/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1233, in _write_ninja_file_and_compile_objects
        error_prefix='Error compiling objects for extension')
      File "/home/johndoe/anaconda3/envs/mtr_env/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1529, in _run_ninja_build
        raise RuntimeError(message)
    RuntimeError: Error compiling objects for extension
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/johndoe/anaconda3/envs/mtr_env/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/johndoe/code/mtr/detectron2/setup.py'"'"'; __file__='"'"'/home/johndoe/code/mtr/detectron2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.

Environment:

Provide your environment information using the following command:
Unavailable - cannot install detectron2

installation / environment

Most helpful comment

Adding some step-by-step instructions for others who may also have similar problems.

  1. Verify your nvcc is compatible with your current cuda version (/usr/local/cuda/bin/nvcc --version)
  2. Check https://gist.github.com/ax3l/9489132 (as linked above) for compatible gcc/g++ versions
  3. Download the highest compatible gcc version for your nvcc (typically installed in usr/bin/)
  4. Symlink that gcc to /usr/local/cuda/bin/gcc (see details here)

For those using a cuda version not linked under /usr/local/cuda, set your CUDA_HOME environment variable to the appropriate path and follow instructions above for this directory:

# Set your CUDA_HOME environment variable
export CUDA_HOME=/path/to/your/cuda/lib

# optionally set your gcc version as an environment variable to skip step 4
export CC=/path/to/compatible/gcc/version

All 6 comments

As the error message suggests, you do not have a working combination of nvcc+gcc compiler.

Unavailable - cannot install detectron2

The command does not require detectron2.

As the error message suggests, you do not have a working combination of nvcc+gcc compiler.

Unavailable - cannot install detectron2

The command does not require detectron2.

how to solve this problem?

https://gist.github.com/ax3l/9489132 has a list of valid cuda compilers

is there a way to specify the nvcc and gcc paths during setup?

I believe they use whatever binaries found in your $PATH environment variable.

Adding some step-by-step instructions for others who may also have similar problems.

  1. Verify your nvcc is compatible with your current cuda version (/usr/local/cuda/bin/nvcc --version)
  2. Check https://gist.github.com/ax3l/9489132 (as linked above) for compatible gcc/g++ versions
  3. Download the highest compatible gcc version for your nvcc (typically installed in usr/bin/)
  4. Symlink that gcc to /usr/local/cuda/bin/gcc (see details here)

For those using a cuda version not linked under /usr/local/cuda, set your CUDA_HOME environment variable to the appropriate path and follow instructions above for this directory:

# Set your CUDA_HOME environment variable
export CUDA_HOME=/path/to/your/cuda/lib

# optionally set your gcc version as an environment variable to skip step 4
export CC=/path/to/compatible/gcc/version

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jinfagang picture jinfagang  Â·  3Comments

limsijie93 picture limsijie93  Â·  3Comments

invisprints picture invisprints  Â·  4Comments

DeepLakhani99 picture DeepLakhani99  Â·  4Comments

Ormagardskvaedi picture Ormagardskvaedi  Â·  4Comments