Open weTerence opened 1 year ago
I was wondering which CUDA version you're using when compiling GroundingDINO, and when you're compiling GroundingDINO, you should make sure you've installed CUDA runtime, and you should set the CUDA_HOME as follows:
export CUDA_HOME=/path/to/cuda-11.3/
Just an example
As for me, my environment is PyTorch 1.12.1
and my CUDA version is 11.4
I was wondering which CUDA version you're using when compiling GroundingDINO, and when you're compiling GroundingDINO, you should make sure you've installed CUDA runtime, and you should set the CUDA_HOME as follows:
export CUDA_HOME=/path/to/cuda-11.3/
Just an example
I've already set my CUDA_HOME
and the cuda version is 11.8
. It seems that the cuda verison is not the problem.
/logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/c10/util/C++17.h:27:2: error: #error You need C++14 to compile PyTorch
error You need C++14 to compile PyTorch
You can also check the C++ version~
Obtaining file:///logging/myname/pj/humanface/Grounded-Segment-Anything/GroundingDINO Preparing metadata (setup.py) ... done Requirement already satisfied: torch in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from groundingdino==0.1.0) (2.0.0) Requirement already satisfied: torchvision in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from groundingdino==0.1.0) (0.15.0) Requirement already satisfied: transformers in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from groundingdino==0.1.0) (4.28.1) Requirement already satisfied: addict in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from groundingdino==0.1.0) (2.4.0) Requirement already satisfied: yapf in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from groundingdino==0.1.0) (0.33.0) Requirement already satisfied: timm in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from groundingdino==0.1.0) (0.6.13) Requirement already satisfied: numpy in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from groundingdino==0.1.0) (1.24.3) Requirement already satisfied: opencv-python in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from groundingdino==0.1.0) (4.7.0.72) Requirement already satisfied: supervision in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from groundingdino==0.1.0) (0.6.0) Requirement already satisfied: pycocotools in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from groundingdino==0.1.0) (2.0.6) Requirement already satisfied: matplotlib>=2.1.0 in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from pycocotools->groundingdino==0.1.0) (3.7.1) Requirement already satisfied: huggingface-hub in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from timm->groundingdino==0.1.0) (0.14.1) Requirement already satisfied: pyyaml in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from timm->groundingdino==0.1.0) (6.0) Requirement already satisfied: filelock in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from torch->groundingdino==0.1.0) (3.9.0) Requirement already satisfied: typing-extensions in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from torch->groundingdino==0.1.0) (4.5.0) Requirement already satisfied: sympy in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from torch->groundingdino==0.1.0) (1.11.1) Requirement already satisfied: networkx in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from torch->groundingdino==0.1.0) (2.8.4) Requirement already satisfied: jinja2 in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from torch->groundingdino==0.1.0) (3.1.2) Requirement already satisfied: requests in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from torchvision->groundingdino==0.1.0) (2.29.0) Requirement already satisfied: pillow!=8.3.*,>=5.3.0 in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from torchvision->groundingdino==0.1.0) (9.4.0) Requirement already satisfied: regex!=2019.12.17 in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from transformers->groundingdino==0.1.0) (2023.5.5) Requirement already satisfied: tokenizers!=0.11.3,<0.14,>=0.11.1 in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from transformers->groundingdino==0.1.0) (0.13.3) Requirement already satisfied: tqdm>=4.27 in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from transformers->groundingdino==0.1.0) (4.65.0) Requirement already satisfied: packaging>=20.0 in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from transformers->groundingdino==0.1.0) (23.1) Requirement already satisfied: tomli>=2.0.1 in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from yapf->groundingdino==0.1.0) (2.0.1) Requirement already satisfied: fsspec in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from huggingface-hub->timm->groundingdino==0.1.0) (2023.4.0) Requirement already satisfied: cycler>=0.10 in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from matplotlib>=2.1.0->pycocotools->groundingdino==0.1.0) (0.11.0) Requirement already satisfied: contourpy>=1.0.1 in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from matplotlib>=2.1.0->pycocotools->groundingdino==0.1.0) (1.0.7) Requirement already satisfied: importlib-resources>=3.2.0 in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from matplotlib>=2.1.0->pycocotools->groundingdino==0.1.0) (5.12.0) Requirement already satisfied: fonttools>=4.22.0 in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from matplotlib>=2.1.0->pycocotools->groundingdino==0.1.0) (4.39.3) Requirement already satisfied: pyparsing>=2.3.1 in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from matplotlib>=2.1.0->pycocotools->groundingdino==0.1.0) (3.0.9) Requirement already satisfied: kiwisolver>=1.0.1 in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from matplotlib>=2.1.0->pycocotools->groundingdino==0.1.0) (1.4.4) Requirement already satisfied: python-dateutil>=2.7 in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from matplotlib>=2.1.0->pycocotools->groundingdino==0.1.0) (2.8.2) Requirement already satisfied: MarkupSafe>=2.0 in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from jinja2->torch->groundingdino==0.1.0) (2.1.1) Requirement already satisfied: charset-normalizer<4,>=2 in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from requests->torchvision->groundingdino==0.1.0) (2.0.4) Requirement already satisfied: urllib3<1.27,>=1.21.1 in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from requests->torchvision->groundingdino==0.1.0) (1.26.15) Requirement already satisfied: idna<4,>=2.5 in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from requests->torchvision->groundingdino==0.1.0) (3.4) Requirement already satisfied: certifi>=2017.4.17 in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from requests->torchvision->groundingdino==0.1.0) (2022.12.7) Requirement already satisfied: mpmath>=0.19 in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from sympy->torch->groundingdino==0.1.0) (1.2.1) Requirement already satisfied: zipp>=3.1.0 in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from importlib-resources>=3.2.0->matplotlib>=2.1.0->pycocotools->groundingdino==0.1.0) (3.15.0) Requirement already satisfied: six>=1.5 in /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages (from python-dateutil>=2.7->matplotlib>=2.1.0->pycocotools->groundingdino==0.1.0) (1.16.0) Installing collected packages: groundingdino Running setup.py develop for groundingdino error: subprocess-exited-with-error
×python setup.py develop did not run successfully. │ exit code: 1 ╰─>[121 lines of output] Building wheel groundingdino-0.1.0 Compiling with CUDA running develop /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated. !!
note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error
×python setup.py develop did not run successfully. │ exit code: 1 ╰─>[121 lines of output] Building wheel groundingdino-0.1.0 Compiling with CUDA running develop /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated. !!
!! easy_install.initialize_options(self) /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated. !!
!! self.initialize_options() running egg_info writing groundingdino.egg-info/PKG-INFO writing dependency_links to groundingdino.egg-info/dependency_links.txt writing requirements to groundingdino.egg-info/requires.txt writing top-level names to groundingdino.egg-info/top_level.txt /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/utils/cpp_extension.py:476: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend. warnings.warn(msg.format('we could not find ninja.')) reading manifest file 'groundingdino.egg-info/SOURCES.txt' adding license file 'LICENSE' writing manifest file 'groundingdino.egg-info/SOURCES.txt' running build_ext /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/utils/cpp_extension.py:398: UserWarning: There are no g++ version bounds defined for CUDA version 11.8 warnings.warn(f'There are no {compiler_name} version bounds defined for CUDA version {cuda_str_version}') building 'groundingdino._C' extension gcc -pthread -B /logging/myname/anaconda/envs/torch118/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /logging/myname/anaconda/envs/torch118/include -I/logging/myname/anaconda/envs/torch118/include -fPIC -O2 -isystem /logging/myname/anaconda/envs/torch118/include -fPIC -DWITH_CUDA -I/logging/myname/pj/humanface/Grounded-Segment-Anything/GroundingDINO/groundingdino/models/GroundingDINO/csrc -I/logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include -I/logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/torch/csrc/api/include -I/logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/TH -I/logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/THC -I/usr/local/cuda/include -I/logging/myname/anaconda/envs/torch118/include/python3.9 -c /logging/myname/pj/humanface/Grounded-Segment-Anything/GroundingDINO/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cpu.cpp -o build/temp.linux-x86_64-cpython-39/logging/myname/pj/humanface/Grounded-Segment-Anything/GroundingDINO/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_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++17 In file included from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/ATen/ATen.h:7:0, from /logging/myname/pj/humanface/Grounded-Segment-Anything/GroundingDINO/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cpu.cpp:13: /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/ATen/Context.h:28:69: warning: type attributes ignored after type is already defined [-Wattributes] enum class TORCH_API Float32MatmulPrecision { HIGHEST, HIGH, MEDIUM }; ^ /usr/local/cuda/bin/nvcc -DWITH_CUDA -I/logging/myname/pj/humanface/Grounded-Segment-Anything/GroundingDINO/groundingdino/models/GroundingDINO/csrc -I/logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include -I/logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/torch/csrc/api/include -I/logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/TH -I/logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/THC -I/usr/local/cuda/include -I/logging/myname/anaconda/envs/torch118/include/python3.9 -c /logging/myname/pj/humanface/Grounded-Segment-Anything/GroundingDINO/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.cu -o build/temp.linux-x86_64-cpython-39/logging/myname/pj/humanface/Grounded-Segment-Anything/GroundingDINO/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr --compiler-options '-fPIC' -DCUDA_HAS_FP16=1 -DCUDA_NO_HALF_OPERATORS -DCUDA_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_80,code=compute_80 -gencode=arch=compute_80,code=sm_80 -std=c++17 nvcc warning : The -std=c++17 flag is not supported with the configured host compiler. Flag will be ignored. In file included from /logging/myname/pj/humanface/Grounded-Segment-Anything/GroundingDINO/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_im2col_cuda.cuh:16:0, from /logging/myname/pj/humanface/Grounded-Segment-Anything/GroundingDINO/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.cu:12: /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/ATen/ATen.h:4:2: error: #error C++14 or later compatible compiler is required to use ATen.
error C++14 or later compatible compiler is required to use ATen.
^ In file included from /logging/myname/gcc-5.5.0/include/c++/5.5.0/mutex:35:0, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/ATen/core/Generator.h:4, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/ATen/CPUGeneratorImpl.h:3, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/ATen/Context.h:3, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/ATen/ATen.h:7, from /logging/myname/pj/humanface/Grounded-Segment-Anything/GroundingDINO/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_im2col_cuda.cuh:16, from /logging/myname/pj/humanface/Grounded-Segment-Anything/GroundingDINO/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.cu:12: /logging/myname/gcc-5.5.0/include/c++/5.5.0/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
error This file requires compiler and library support \
^ In file included from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/c10/util/string_view.h:4:0, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/c10/util/StringUtil.h:6, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/c10/util/Exception.h:6, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/ATen/core/Generator.h:11, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/ATen/CPUGeneratorImpl.h:3, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/ATen/Context.h:3, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/ATen/ATen.h:7, from /logging/myname/pj/humanface/Grounded-Segment-Anything/GroundingDINO/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_im2col_cuda.cuh:16, from /logging/myname/pj/humanface/Grounded-Segment-Anything/GroundingDINO/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.cu:12: /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/c10/util/C++17.h:27:2: error: #error You need C++14 to compile PyTorch
error You need C++14 to compile PyTorch
^ In file included from /logging/myname/gcc-5.5.0/include/c++/5.5.0/experimental/string_view:39:0, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/c10/util/string_view.h:20, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/c10/util/StringUtil.h:6, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/c10/util/Exception.h:6, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/ATen/core/Generator.h:11, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/ATen/CPUGeneratorImpl.h:3, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/ATen/Context.h:3, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/ATen/ATen.h:7, from /logging/myname/pj/humanface/Grounded-Segment-Anything/GroundingDINO/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_im2col_cuda.cuh:16, from /logging/myname/pj/humanface/Grounded-Segment-Anything/GroundingDINO/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.cu:12: /logging/myname/gcc-5.5.0/include/c++/5.5.0/bits/c++14_warning.h:32:2: error: #error This file requires compiler and library support for the forthcoming ISO C++ 2014 standard. This support is currently experimental, and must be enabled with the -std=c++1y or -std=gnu++1y compiler options.
error This file requires compiler and library support for the forthcoming \
^ In file included from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/c10/util/Exception.h:7:0, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/ATen/core/Generator.h:11, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/ATen/CPUGeneratorImpl.h:3, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/ATen/Context.h:3, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/ATen/ATen.h:7, from /logging/myname/pj/humanface/Grounded-Segment-Anything/GroundingDINO/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_im2col_cuda.cuh:16, from /logging/myname/pj/humanface/Grounded-Segment-Anything/GroundingDINO/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.cu:12: /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/c10/util/variant.h:243:2: error: #error "MPark.Variant requires C++11 support."
error "MPark.Variant requires C++11 support."
^ In file included from /usr/local/cuda/include/thrust/detail/config/config.h:27:0, from /usr/local/cuda/include/thrust/detail/config.h:23, from /usr/local/cuda/include/thrust/complex.h:24, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/c10/util/complex.h:8, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/c10/util/Half.h:15, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/c10/core/ScalarType.h:5, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/c10/core/StorageImpl.h:4, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/c10/core/Storage.h:3, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/c10/core/TensorImpl.h:8, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/c10/core/GeneratorImpl.h:8, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/ATen/core/Generator.h:22, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/ATen/CPUGeneratorImpl.h:3, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/ATen/Context.h:3, from /logging/myname/anaconda/envs/torch118/lib/python3.9/site-packages/torch/include/ATen/ATen.h:7, from /logging/myname/pj/humanface/Grounded-Segment-Anything/GroundingDINO/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_im2col_cuda.cuh:16, from /logging/myname/pj/humanface/Grounded-Segment-Anything/GroundingDINO/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.cu:12: /usr/local/cuda/include/thrust/detail/config/cpp_dialect.h:128:13: warning: Thrust requires at least C++14. Define THRUST_IGNORE_DEPRECATED_CPP_DIALECT to suppress this message. THRUST_COMPILER_DEPRECATION(C++14); ^ error: command '/usr/local/cuda/bin/nvcc' failed with exit code 1 [end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.