GroundingDINO
GroundingDINO copied to clipboard
Error in the compilation of "ms_deform_attn_cuda.cu" when constructing the environment
I met the problem as follows when trying to build the environment:
(grounded-sam-2) user3@node2:~/segment/Grounded-SAM-2/grounding_dino$ pip install -e . --no-build-isolation -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
Looking in indexes: https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
Obtaining file:///home/user3/segment/Grounded-SAM-2/grounding_dino
Preparing metadata (setup.py) ... done
Requirement already satisfied: torch in /home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages (from groundingdino==0.1.0) (2.6.0)
Requirement already satisfied: torchvision in /home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages (from groundingdino==0.1.0) (0.21.0)
Collecting transformers (from groundingdino==0.1.0)
Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/15/af/a3eb4449c8fdde24413555a66e9c100b669f4428fc829bad4ceb73472f4f/transformers-4.51.2-py3-none-any.whl (10.4 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.4/10.4 MB 30.4 MB/s eta 0:00:00
Collecting addict (from groundingdino==0.1.0)
Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/6a/00/b08f23b7d7e1e14ce01419a467b583edbb93c6cdb8654e54a9cc579cd61f/addict-2.4.0-py3-none-any.whl (3.8 kB)
Collecting yapf (from groundingdino==0.1.0)
Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/37/81/6acd6601f61e31cfb8729d3da6d5df966f80f374b78eff83760714487338/yapf-0.43.0-py3-none-any.whl (256 kB)
Collecting timm (from groundingdino==0.1.0)
Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/6c/d0/179abca8b984b3deefd996f362b612c39da73b60f685921e6cd58b6125b4/timm-1.0.15-py3-none-any.whl (2.4 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.4/2.4 MB 21.2 MB/s eta 0:00:00
Requirement already satisfied: numpy in /home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages (from groundingdino==0.1.0) (2.2.4)
Collecting opencv-python (from groundingdino==0.1.0)
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/2c/8b/90eb44a40476fa0e71e05a0283947cfd74a5d36121a11d926ad6f3193cc4/opencv_python-4.11.0.86-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (63.0 MB)
Collecting supervision>=0.22.0 (from groundingdino==0.1.0)
Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/c1/24/d3bcad7ece751166ed308c6deb7e7d02a62a7f5a6e01e61ff2787c538fb0/supervision-0.25.1-py3-none-any.whl (181 kB)
Collecting pycocotools (from groundingdino==0.1.0)
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/6a/03/6c0bf810a5df7876caaf11f5b113e7ffd4b2fa9767d360489c6fdcefe8e5/pycocotools-2.0.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (427 kB)
Collecting contourpy>=1.0.7 (from supervision>=0.22.0->groundingdino==0.1.0)
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/a9/57/86c500d63b3e26e5b73a28b8291a67c5608d4aa87ebd17bd15bb33c178bc/contourpy-1.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (324 kB)
Collecting defusedxml<0.8.0,>=0.7.1 (from supervision>=0.22.0->groundingdino==0.1.0)
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/07/6c/aa3f2f849e01cb6a001cd8554a88d4c77c5c1a31c95bdf1cf9301e6d9ef4/defusedxml-0.7.1-py2.py3-none-any.whl (25 kB)
Collecting matplotlib>=3.6.0 (from supervision>=0.22.0->groundingdino==0.1.0)
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/12/87/9472d4513ff83b7cd864311821793ab72234fa201ab77310ec1b585d27e2/matplotlib-3.10.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.6 MB)
Requirement already satisfied: pillow>=9.4 in /home/user3/.local/lib/python3.10/site-packages (from supervision>=0.22.0->groundingdino==0.1.0) (11.1.0)
Requirement already satisfied: pyyaml>=5.3 in /home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages (from supervision>=0.22.0->groundingdino==0.1.0) (6.0.2)
Collecting requests>=2.26.0 (from supervision>=0.22.0->groundingdino==0.1.0)
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/f9/9b/335f9764261e915ed497fcdeb11df5dfd6f7bf257d4a6a2a686d80da4d54/requests-2.32.3-py3-none-any.whl (64 kB)
Collecting scipy<2.0.0,>=1.10.0 (from supervision>=0.22.0->groundingdino==0.1.0)
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/de/3c/c96d904b9892beec978562f64d8cc43f9cca0842e65bd3cd1b7f7389b0ba/scipy-1.15.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (37.6 MB)
Requirement already satisfied: tqdm>=4.62.3 in /home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages (from supervision>=0.22.0->groundingdino==0.1.0) (4.67.1)
Collecting huggingface_hub (from timm->groundingdino==0.1.0)
Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/93/27/1fb384a841e9661faad1c31cbfa62864f59632e876df5d795234da51c395/huggingface_hub-0.30.2-py3-none-any.whl (481 kB)
Collecting safetensors (from timm->groundingdino==0.1.0)
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/a6/f8/dae3421624fcc87a89d42e1898a798bc7ff72c61f38973a65d60df8f124c/safetensors-0.5.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (471 kB)
Requirement already satisfied: filelock in /home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages (from torch->groundingdino==0.1.0) (3.18.0)
Requirement already satisfied: typing-extensions>=4.10.0 in /home/user3/.local/lib/python3.10/site-packages (from torch->groundingdino==0.1.0) (4.13.0)
Requirement already satisfied: networkx in /home/user3/.local/lib/python3.10/site-packages (from torch->groundingdino==0.1.0) (3.4.2)
Requirement already satisfied: jinja2 in /home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages (from torch->groundingdino==0.1.0) (3.1.6)
Requirement already satisfied: fsspec in /home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages (from torch->groundingdino==0.1.0) (2025.3.2)
Requirement already satisfied: nvidia-cuda-nvrtc-cu12==12.4.127 in /home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages (from torch->groundingdino==0.1.0) (12.4.127)
Requirement already satisfied: nvidia-cuda-runtime-cu12==12.4.127 in /home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages (from torch->groundingdino==0.1.0) (12.4.127)
Requirement already satisfied: nvidia-cuda-cupti-cu12==12.4.127 in /home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages (from torch->groundingdino==0.1.0) (12.4.127)
Requirement already satisfied: nvidia-cudnn-cu12==9.1.0.70 in /home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages (from torch->groundingdino==0.1.0) (9.1.0.70)
Requirement already satisfied: nvidia-cublas-cu12==12.4.5.8 in /home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages (from torch->groundingdino==0.1.0) (12.4.5.8)
Requirement already satisfied: nvidia-cufft-cu12==11.2.1.3 in /home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages (from torch->groundingdino==0.1.0) (11.2.1.3)
Requirement already satisfied: nvidia-curand-cu12==10.3.5.147 in /home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages (from torch->groundingdino==0.1.0) (10.3.5.147)
Requirement already satisfied: nvidia-cusolver-cu12==11.6.1.9 in /home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages (from torch->groundingdino==0.1.0) (11.6.1.9)
Requirement already satisfied: nvidia-cusparse-cu12==12.3.1.170 in /home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages (from torch->groundingdino==0.1.0) (12.3.1.170)
Requirement already satisfied: nvidia-cusparselt-cu12==0.6.2 in /home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages (from torch->groundingdino==0.1.0) (0.6.2)
Requirement already satisfied: nvidia-nccl-cu12==2.21.5 in /home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages (from torch->groundingdino==0.1.0) (2.21.5)
Requirement already satisfied: nvidia-nvtx-cu12==12.4.127 in /home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages (from torch->groundingdino==0.1.0) (12.4.127)
Requirement already satisfied: nvidia-nvjitlink-cu12==12.4.127 in /home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages (from torch->groundingdino==0.1.0) (12.4.127)
Requirement already satisfied: triton==3.2.0 in /home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages (from torch->groundingdino==0.1.0) (3.2.0)
Requirement already satisfied: sympy==1.13.1 in /home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages (from torch->groundingdino==0.1.0) (1.13.1)
Requirement already satisfied: mpmath<1.4,>=1.1.0 in /home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages (from sympy==1.13.1->torch->groundingdino==0.1.0) (1.3.0)
Requirement already satisfied: packaging>=20.0 in /home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages (from transformers->groundingdino==0.1.0) (24.2)
Collecting regex!=2019.12.17 (from transformers->groundingdino==0.1.0)
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/f2/98/26d3830875b53071f1f0ae6d547f1d98e964dd29ad35cbf94439120bb67a/regex-2024.11.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (781 kB)
Collecting tokenizers<0.22,>=0.21 (from transformers->groundingdino==0.1.0)
Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/8a/63/38be071b0c8e06840bc6046991636bcb30c27f6bb1e670f4f4bc87cf49cc/tokenizers-0.21.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.0/3.0 MB 19.9 MB/s eta 0:00:00
Collecting platformdirs>=3.5.1 (from yapf->groundingdino==0.1.0)
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/6d/45/59578566b3275b8fd9157885918fcd0c4d74162928a5310926887b856a51/platformdirs-4.3.7-py3-none-any.whl (18 kB)
Collecting tomli>=2.0.1 (from yapf->groundingdino==0.1.0)
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/6e/c2/61d3e0f47e2b74ef40a68b9e6ad5984f6241a942f7cd3bbfbdbd03861ea9/tomli-2.2.1-py3-none-any.whl (14 kB)
Collecting cycler>=0.10 (from matplotlib>=3.6.0->supervision>=0.22.0->groundingdino==0.1.0)
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/e7/05/c19819d5e3d95294a6f5947fb9b9629efb316b96de511b418c53d245aae6/cycler-0.12.1-py3-none-any.whl (8.3 kB)
Collecting fonttools>=4.22.0 (from matplotlib>=3.6.0->supervision>=0.22.0->groundingdino==0.1.0)
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/59/bc/e16ae5d9eee6c70830ce11d1e0b23d6018ddfeb28025fda092cae7889c8b/fonttools-4.57.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.6 MB)
Collecting kiwisolver>=1.3.1 (from matplotlib>=3.6.0->supervision>=0.22.0->groundingdino==0.1.0)
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/de/c6/7b9bb8044e150d4d1558423a1568e4f227193662a02231064e3824f37e0a/kiwisolver-1.4.8-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.6 MB)
Collecting pyparsing>=2.3.1 (from matplotlib>=3.6.0->supervision>=0.22.0->groundingdino==0.1.0)
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/05/e7/df2285f3d08fee213f2d041540fa4fc9ca6c2d44cf36d3a035bf2a8d2bcc/pyparsing-3.2.3-py3-none-any.whl (111 kB)
Collecting python-dateutil>=2.7 (from matplotlib>=3.6.0->supervision>=0.22.0->groundingdino==0.1.0)
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
Collecting charset-normalizer<4,>=2 (from requests>=2.26.0->supervision>=0.22.0->groundingdino==0.1.0)
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/93/62/5e89cdfe04584cb7f4d36003ffa2936681b03ecc0754f8e969c2becb7e24/charset_normalizer-3.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (146 kB)
Requirement already satisfied: idna<4,>=2.5 in /home/user3/.local/lib/python3.10/site-packages (from requests>=2.26.0->supervision>=0.22.0->groundingdino==0.1.0) (3.10)
Collecting urllib3<3,>=1.21.1 (from requests>=2.26.0->supervision>=0.22.0->groundingdino==0.1.0)
Downloading https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/6b/11/cc635220681e93a0183390e26485430ca2c7b5f9d33b15c74c2861cb8091/urllib3-2.4.0-py3-none-any.whl (128 kB)
Requirement already satisfied: certifi>=2017.4.17 in /home/user3/.local/lib/python3.10/site-packages (from requests>=2.26.0->supervision>=0.22.0->groundingdino==0.1.0) (2025.1.31)
Requirement already satisfied: MarkupSafe>=2.0 in /home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages (from jinja2->torch->groundingdino==0.1.0) (3.0.2)
Collecting six>=1.5 (from python-dateutil>=2.7->matplotlib>=3.6.0->supervision>=0.22.0->groundingdino==0.1.0)
Using cached https://mirrors.tuna.tsinghua.edu.cn/pypi/web/packages/b7/ce/149a00dd41f10bc29e5921b496af8b574d8413afcd5e30dfa0ed46c2cc5e/six-1.17.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: addict, urllib3, tomli, six, scipy, safetensors, regex, pyparsing, platformdirs, opencv-python, kiwisolver, fonttools, defusedxml, cycler, contourpy, charset-normalizer, yapf, requests, python-dateutil, matplotlib, huggingface_hub, tokenizers, supervision, pycocotools, transformers, timm, groundingdino
DEPRECATION: Legacy editable install of groundingdino==0.1.0 from file:///home/user3/segment/Grounded-SAM-2/grounding_dino (setup.py develop) is deprecated. pip 25.1 will enforce this behaviour change. A possible replacement is to add a pyproject.toml or enable --use-pep517, and use setuptools >= 64. If the resulting installation is not behaving as expected, try using --config-settings editable_mode=compat. Please consult the setuptools documentation for more information. Discussion can be found at https://github.com/pypa/pip/issues/11457
Running setup.py develop for groundingdino
error: subprocess-exited-with-error
× python setup.py develop did not run successfully.
│ exit code: 1
╰─> [63 lines of output]
Building wheel groundingdino-0.1.0
Compiling with CUDA
running develop
/home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages/setuptools/command/develop.py:41: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!
********************************************************************************
Please avoid running ``setup.py`` and ``easy_install``.
Instead, use pypa/build, pypa/installer or other
standards-based tools.
See https://github.com/pypa/setuptools/issues/917 for details.
********************************************************************************
!!
easy_install.initialize_options(self)
/home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:79: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!
********************************************************************************
Please avoid running ``setup.py`` directly.
Instead, use pypa/build, pypa/installer or other
standards-based tools.
See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
********************************************************************************
!!
self.initialize_options()
running egg_info
creating groundingdino.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
writing manifest file 'groundingdino.egg-info/SOURCES.txt'
/home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages/torch/utils/cpp_extension.py:529: 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
/home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages/torch/utils/cpp_extension.py:448: UserWarning: The detected CUDA version (12.1) has a minor version mismatch with the version that was used to compile PyTorch (12.4). Most likely this shouldn't be a problem.
warnings.warn(CUDA_MISMATCH_WARN.format(cuda_str_version, torch.version.cuda))
/home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages/torch/utils/cpp_extension.py:458: UserWarning: There are no g++-11 version bounds defined for CUDA version 12.1
warnings.warn(f'There are no {compiler_name} version bounds defined for CUDA version {cuda_str_version}')
building 'groundingdino._C' extension
creating build/temp.linux-x86_64-cpython-310/home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc/MsDeformAttn
g++-11 -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/user3/miniconda3/envs/grounded-sam-2/include -fPIC -O2 -isystem /home/user3/miniconda3/envs/grounded-sam-2/include -fPIC -DWITH_CUDA -I/home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc -I/home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages/torch/include -I/home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages/torch/include/TH -I/home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages/torch/include/THC -I/home/user3/cuda/cuda-12.1/include -I/home/user3/miniconda3/envs/grounded-sam-2/include/python3.10 -c /home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cpu.cpp -o build/temp.linux-x86_64-cpython-310/home/user3/segment/Grounded-SAM-2/grounding_dino/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
/home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages/torch/utils/cpp_extension.py:2059: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation.
If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST'].
warnings.warn(
/home/user3/cuda/cuda-12.1/bin/nvcc -DWITH_CUDA -I/home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc -I/home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages/torch/include -I/home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages/torch/include/TH -I/home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages/torch/include/THC -I/home/user3/cuda/cuda-12.1/include -I/home/user3/miniconda3/envs/grounded-sam-2/include/python3.10 -c /home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.cu -o build/temp.linux-x86_64-cpython-310/home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_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' -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_80,code=compute_80 -gencode=arch=compute_80,code=sm_80 -ccbin gcc-11 -std=c++17
/home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.cu(65): error: no suitable conversion function from "const at::DeprecatedTypeProperties" to "c10::ScalarType" exists
[&] { const auto& the_type = value.type(); constexpr const char* at_dispatch_name = "ms_deform_attn_forward_cuda"; at::ScalarType _st = ::detail::scalar_type(the_type); ; switch (_st) { case at::ScalarType::Double: { do { if constexpr (!at::should_include_kernel_dtype( at_dispatch_name, at::ScalarType::Double)) { if (!(false)) { ::c10::detail::torchCheckFail( __func__, "/home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.cu", static_cast<uint32_t>(65), (::c10::detail::torchCheckMsgImpl( "Expected " "false" " to be true, but got false. " "(Could this error message be improved? If so, " "please report an enhancement request to PyTorch.)", "dtype '", toString(at::ScalarType::Double), "' not selected for kernel tag ", at_dispatch_name))); }; } } while (0); using scalar_t [[maybe_unused]] = c10::impl::ScalarTypeToCPPTypeT<at::ScalarType::Double>; return ([&] { ms_deformable_im2col_cuda(at::cuda::getCurrentCUDAStream(), value.data<scalar_t>() + n * im2col_step_ * per_value_size, spatial_shapes.data<int64_t>(), level_start_index.data<int64_t>(), sampling_loc.data<scalar_t>() + n * im2col_step_ * per_sample_loc_size, attn_weight.data<scalar_t>() + n * im2col_step_ * per_attn_weight_size, batch_n, spatial_size, num_heads, channels, num_levels, num_query, num_point, columns.data<scalar_t>()); })(); } case at::ScalarType::Float: { do { if constexpr (!at::should_include_kernel_dtype( at_dispatch_name, at::ScalarType::Float)) { if (!(false)) { ::c10::detail::torchCheckFail( __func__, "/home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.cu", static_cast<uint32_t>(65), (::c10::detail::torchCheckMsgImpl( "Expected " "false" " to be true, but got false. " "(Could this error message be improved? If so, " "please report an enhancement request to PyTorch.)", "dtype '", toString(at::ScalarType::Float), "' not selected for kernel tag ", at_dispatch_name))); }; } } while (0); using scalar_t [[maybe_unused]] = c10::impl::ScalarTypeToCPPTypeT<at::ScalarType::Float>; return ([&] { ms_deformable_im2col_cuda(at::cuda::getCurrentCUDAStream(), value.data<scalar_t>() + n * im2col_step_ * per_value_size, spatial_shapes.data<int64_t>(), level_start_index.data<int64_t>(), sampling_loc.data<scalar_t>() + n * im2col_step_ * per_sample_loc_size, attn_weight.data<scalar_t>() + n * im2col_step_ * per_attn_weight_size, batch_n, spatial_size, num_heads, channels, num_levels, num_query, num_point, columns.data<scalar_t>()); })(); } default: if (!(false)) { ::c10::detail::torchCheckFail( __func__, "/home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.cu", static_cast<uint32_t>(65), (::c10::detail::torchCheckMsgImpl( "Expected " "false" " to be true, but got false. " "(Could this error message be improved? If so, " "please report an enhancement request to PyTorch.)", '"', at_dispatch_name, "\" not implemented for '", toString(_st), "'"))); }; } }()
^
/home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.cu(135): error: no suitable conversion function from "const at::DeprecatedTypeProperties" to "c10::ScalarType" exists
[&] { const auto& the_type = value.type(); constexpr const char* at_dispatch_name = "ms_deform_attn_backward_cuda"; at::ScalarType _st = ::detail::scalar_type(the_type); ; switch (_st) { case at::ScalarType::Double: { do { if constexpr (!at::should_include_kernel_dtype( at_dispatch_name, at::ScalarType::Double)) { if (!(false)) { ::c10::detail::torchCheckFail( __func__, "/home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.cu", static_cast<uint32_t>(135), (::c10::detail::torchCheckMsgImpl( "Expected " "false" " to be true, but got false. " "(Could this error message be improved? If so, " "please report an enhancement request to PyTorch.)", "dtype '", toString(at::ScalarType::Double), "' not selected for kernel tag ", at_dispatch_name))); }; } } while (0); using scalar_t [[maybe_unused]] = c10::impl::ScalarTypeToCPPTypeT<at::ScalarType::Double>; return ([&] { ms_deformable_col2im_cuda(at::cuda::getCurrentCUDAStream(), grad_output_g.data<scalar_t>(), value.data<scalar_t>() + n * im2col_step_ * per_value_size, spatial_shapes.data<int64_t>(), level_start_index.data<int64_t>(), sampling_loc.data<scalar_t>() + n * im2col_step_ * per_sample_loc_size, attn_weight.data<scalar_t>() + n * im2col_step_ * per_attn_weight_size, batch_n, spatial_size, num_heads, channels, num_levels, num_query, num_point, grad_value.data<scalar_t>() + n * im2col_step_ * per_value_size, grad_sampling_loc.data<scalar_t>() + n * im2col_step_ * per_sample_loc_size, grad_attn_weight.data<scalar_t>() + n * im2col_step_ * per_attn_weight_size); })(); } case at::ScalarType::Float: { do { if constexpr (!at::should_include_kernel_dtype( at_dispatch_name, at::ScalarType::Float)) { if (!(false)) { ::c10::detail::torchCheckFail( __func__, "/home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.cu", static_cast<uint32_t>(135), (::c10::detail::torchCheckMsgImpl( "Expected " "false" " to be true, but got false. " "(Could this error message be improved? If so, " "please report an enhancement request to PyTorch.)", "dtype '", toString(at::ScalarType::Float), "' not selected for kernel tag ", at_dispatch_name))); }; } } while (0); using scalar_t [[maybe_unused]] = c10::impl::ScalarTypeToCPPTypeT<at::ScalarType::Float>; return ([&] { ms_deformable_col2im_cuda(at::cuda::getCurrentCUDAStream(), grad_output_g.data<scalar_t>(), value.data<scalar_t>() + n * im2col_step_ * per_value_size, spatial_shapes.data<int64_t>(), level_start_index.data<int64_t>(), sampling_loc.data<scalar_t>() + n * im2col_step_ * per_sample_loc_size, attn_weight.data<scalar_t>() + n * im2col_step_ * per_attn_weight_size, batch_n, spatial_size, num_heads, channels, num_levels, num_query, num_point, grad_value.data<scalar_t>() + n * im2col_step_ * per_value_size, grad_sampling_loc.data<scalar_t>() + n * im2col_step_ * per_sample_loc_size, grad_attn_weight.data<scalar_t>() + n * im2col_step_ * per_attn_weight_size); })(); } default: if (!(false)) { ::c10::detail::torchCheckFail( __func__, "/home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.cu", static_cast<uint32_t>(135), (::c10::detail::torchCheckMsgImpl( "Expected " "false" " to be true, but got false. " "(Could this error message be improved? If so, " "please report an enhancement request to PyTorch.)", '"', at_dispatch_name, "\" not implemented for '", toString(_st), "'"))); }; } }()
^
2 errors detected in the compilation of "/home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.cu".
error: command '/home/user3/cuda/cuda-12.1/bin/nvcc' failed with exit code 2
[end of output]
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
╰─> [63 lines of output]
Building wheel groundingdino-0.1.0
Compiling with CUDA
running develop
/home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages/setuptools/command/develop.py:41: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!
********************************************************************************
Please avoid running ``setup.py`` and ``easy_install``.
Instead, use pypa/build, pypa/installer or other
standards-based tools.
See https://github.com/pypa/setuptools/issues/917 for details.
********************************************************************************
!!
easy_install.initialize_options(self)
/home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:79: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!
********************************************************************************
Please avoid running ``setup.py`` directly.
Instead, use pypa/build, pypa/installer or other
standards-based tools.
See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
********************************************************************************
!!
self.initialize_options()
running egg_info
creating groundingdino.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
writing manifest file 'groundingdino.egg-info/SOURCES.txt'
/home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages/torch/utils/cpp_extension.py:529: 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
/home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages/torch/utils/cpp_extension.py:448: UserWarning: The detected CUDA version (12.1) has a minor version mismatch with the version that was used to compile PyTorch (12.4). Most likely this shouldn't be a problem.
warnings.warn(CUDA_MISMATCH_WARN.format(cuda_str_version, torch.version.cuda))
/home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages/torch/utils/cpp_extension.py:458: UserWarning: There are no g++-11 version bounds defined for CUDA version 12.1
warnings.warn(f'There are no {compiler_name} version bounds defined for CUDA version {cuda_str_version}')
building 'groundingdino._C' extension
creating build/temp.linux-x86_64-cpython-310/home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc/MsDeformAttn
g++-11 -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/user3/miniconda3/envs/grounded-sam-2/include -fPIC -O2 -isystem /home/user3/miniconda3/envs/grounded-sam-2/include -fPIC -DWITH_CUDA -I/home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc -I/home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages/torch/include -I/home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages/torch/include/TH -I/home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages/torch/include/THC -I/home/user3/cuda/cuda-12.1/include -I/home/user3/miniconda3/envs/grounded-sam-2/include/python3.10 -c /home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cpu.cpp -o build/temp.linux-x86_64-cpython-310/home/user3/segment/Grounded-SAM-2/grounding_dino/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
/home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages/torch/utils/cpp_extension.py:2059: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation.
If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST'].
warnings.warn(
/home/user3/cuda/cuda-12.1/bin/nvcc -DWITH_CUDA -I/home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc -I/home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages/torch/include -I/home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages/torch/include/TH -I/home/user3/miniconda3/envs/grounded-sam-2/lib/python3.10/site-packages/torch/include/THC -I/home/user3/cuda/cuda-12.1/include -I/home/user3/miniconda3/envs/grounded-sam-2/include/python3.10 -c /home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.cu -o build/temp.linux-x86_64-cpython-310/home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_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' -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_80,code=compute_80 -gencode=arch=compute_80,code=sm_80 -ccbin gcc-11 -std=c++17
/home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.cu(65): error: no suitable conversion function from "const at::DeprecatedTypeProperties" to "c10::ScalarType" exists
[&] { const auto& the_type = value.type(); constexpr const char* at_dispatch_name = "ms_deform_attn_forward_cuda"; at::ScalarType _st = ::detail::scalar_type(the_type); ; switch (_st) { case at::ScalarType::Double: { do { if constexpr (!at::should_include_kernel_dtype( at_dispatch_name, at::ScalarType::Double)) { if (!(false)) { ::c10::detail::torchCheckFail( __func__, "/home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.cu", static_cast<uint32_t>(65), (::c10::detail::torchCheckMsgImpl( "Expected " "false" " to be true, but got false. " "(Could this error message be improved? If so, " "please report an enhancement request to PyTorch.)", "dtype '", toString(at::ScalarType::Double), "' not selected for kernel tag ", at_dispatch_name))); }; } } while (0); using scalar_t [[maybe_unused]] = c10::impl::ScalarTypeToCPPTypeT<at::ScalarType::Double>; return ([&] { ms_deformable_im2col_cuda(at::cuda::getCurrentCUDAStream(), value.data<scalar_t>() + n * im2col_step_ * per_value_size, spatial_shapes.data<int64_t>(), level_start_index.data<int64_t>(), sampling_loc.data<scalar_t>() + n * im2col_step_ * per_sample_loc_size, attn_weight.data<scalar_t>() + n * im2col_step_ * per_attn_weight_size, batch_n, spatial_size, num_heads, channels, num_levels, num_query, num_point, columns.data<scalar_t>()); })(); } case at::ScalarType::Float: { do { if constexpr (!at::should_include_kernel_dtype( at_dispatch_name, at::ScalarType::Float)) { if (!(false)) { ::c10::detail::torchCheckFail( __func__, "/home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.cu", static_cast<uint32_t>(65), (::c10::detail::torchCheckMsgImpl( "Expected " "false" " to be true, but got false. " "(Could this error message be improved? If so, " "please report an enhancement request to PyTorch.)", "dtype '", toString(at::ScalarType::Float), "' not selected for kernel tag ", at_dispatch_name))); }; } } while (0); using scalar_t [[maybe_unused]] = c10::impl::ScalarTypeToCPPTypeT<at::ScalarType::Float>; return ([&] { ms_deformable_im2col_cuda(at::cuda::getCurrentCUDAStream(), value.data<scalar_t>() + n * im2col_step_ * per_value_size, spatial_shapes.data<int64_t>(), level_start_index.data<int64_t>(), sampling_loc.data<scalar_t>() + n * im2col_step_ * per_sample_loc_size, attn_weight.data<scalar_t>() + n * im2col_step_ * per_attn_weight_size, batch_n, spatial_size, num_heads, channels, num_levels, num_query, num_point, columns.data<scalar_t>()); })(); } default: if (!(false)) { ::c10::detail::torchCheckFail( __func__, "/home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.cu", static_cast<uint32_t>(65), (::c10::detail::torchCheckMsgImpl( "Expected " "false" " to be true, but got false. " "(Could this error message be improved? If so, " "please report an enhancement request to PyTorch.)", '"', at_dispatch_name, "\" not implemented for '", toString(_st), "'"))); }; } }()
^
/home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.cu(135): error: no suitable conversion function from "const at::DeprecatedTypeProperties" to "c10::ScalarType" exists
[&] { const auto& the_type = value.type(); constexpr const char* at_dispatch_name = "ms_deform_attn_backward_cuda"; at::ScalarType _st = ::detail::scalar_type(the_type); ; switch (_st) { case at::ScalarType::Double: { do { if constexpr (!at::should_include_kernel_dtype( at_dispatch_name, at::ScalarType::Double)) { if (!(false)) { ::c10::detail::torchCheckFail( __func__, "/home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.cu", static_cast<uint32_t>(135), (::c10::detail::torchCheckMsgImpl( "Expected " "false" " to be true, but got false. " "(Could this error message be improved? If so, " "please report an enhancement request to PyTorch.)", "dtype '", toString(at::ScalarType::Double), "' not selected for kernel tag ", at_dispatch_name))); }; } } while (0); using scalar_t [[maybe_unused]] = c10::impl::ScalarTypeToCPPTypeT<at::ScalarType::Double>; return ([&] { ms_deformable_col2im_cuda(at::cuda::getCurrentCUDAStream(), grad_output_g.data<scalar_t>(), value.data<scalar_t>() + n * im2col_step_ * per_value_size, spatial_shapes.data<int64_t>(), level_start_index.data<int64_t>(), sampling_loc.data<scalar_t>() + n * im2col_step_ * per_sample_loc_size, attn_weight.data<scalar_t>() + n * im2col_step_ * per_attn_weight_size, batch_n, spatial_size, num_heads, channels, num_levels, num_query, num_point, grad_value.data<scalar_t>() + n * im2col_step_ * per_value_size, grad_sampling_loc.data<scalar_t>() + n * im2col_step_ * per_sample_loc_size, grad_attn_weight.data<scalar_t>() + n * im2col_step_ * per_attn_weight_size); })(); } case at::ScalarType::Float: { do { if constexpr (!at::should_include_kernel_dtype( at_dispatch_name, at::ScalarType::Float)) { if (!(false)) { ::c10::detail::torchCheckFail( __func__, "/home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.cu", static_cast<uint32_t>(135), (::c10::detail::torchCheckMsgImpl( "Expected " "false" " to be true, but got false. " "(Could this error message be improved? If so, " "please report an enhancement request to PyTorch.)", "dtype '", toString(at::ScalarType::Float), "' not selected for kernel tag ", at_dispatch_name))); }; } } while (0); using scalar_t [[maybe_unused]] = c10::impl::ScalarTypeToCPPTypeT<at::ScalarType::Float>; return ([&] { ms_deformable_col2im_cuda(at::cuda::getCurrentCUDAStream(), grad_output_g.data<scalar_t>(), value.data<scalar_t>() + n * im2col_step_ * per_value_size, spatial_shapes.data<int64_t>(), level_start_index.data<int64_t>(), sampling_loc.data<scalar_t>() + n * im2col_step_ * per_sample_loc_size, attn_weight.data<scalar_t>() + n * im2col_step_ * per_attn_weight_size, batch_n, spatial_size, num_heads, channels, num_levels, num_query, num_point, grad_value.data<scalar_t>() + n * im2col_step_ * per_value_size, grad_sampling_loc.data<scalar_t>() + n * im2col_step_ * per_sample_loc_size, grad_attn_weight.data<scalar_t>() + n * im2col_step_ * per_attn_weight_size); })(); } default: if (!(false)) { ::c10::detail::torchCheckFail( __func__, "/home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.cu", static_cast<uint32_t>(135), (::c10::detail::torchCheckMsgImpl( "Expected " "false" " to be true, but got false. " "(Could this error message be improved? If so, " "please report an enhancement request to PyTorch.)", '"', at_dispatch_name, "\" not implemented for '", toString(_st), "'"))); }; } }()
^
2 errors detected in the compilation of "/home/user3/segment/Grounded-SAM-2/grounding_dino/groundingdino/models/GroundingDINO/csrc/MsDeformAttn/ms_deform_attn_cuda.cu".
error: command '/home/user3/cuda/cuda-12.1/bin/nvcc' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
I tried to switch cuda version to 11.8 or 12.4, but got the same error. The GPU I used is NVIDIA A800-SXM4-80GB, and the conda list is as follows:
# Name Version Build Channel
_libgcc_mutex 0.1 main
_openmp_mutex 5.1 1_gnu
addict 2.4.0 pypi_0 pypi
antlr4-python3-runtime 4.9.3 pypi_0 pypi
bzip2 1.0.8 h5eee18b_6
ca-certificates 2025.2.25 h06a4308_0
charset-normalizer 3.4.1 pypi_0 pypi
contourpy 1.3.1 pypi_0 pypi
cycler 0.12.1 pypi_0 pypi
defusedxml 0.7.1 pypi_0 pypi
filelock 3.18.0 pypi_0 pypi
fonttools 4.57.0 pypi_0 pypi
fsspec 2025.3.2 pypi_0 pypi
huggingface-hub 0.30.2 pypi_0 pypi
hydra-core 1.3.2 pypi_0 pypi
iopath 0.1.10 pypi_0 pypi
jinja2 3.1.6 pypi_0 pypi
kiwisolver 1.4.8 pypi_0 pypi
ld_impl_linux-64 2.40 h12ee557_0
libffi 3.4.4 h6a678d5_1
libgcc-ng 11.2.0 h1234567_1
libgomp 11.2.0 h1234567_1
libstdcxx-ng 11.2.0 h1234567_1
libuuid 1.41.5 h5eee18b_0
markupsafe 3.0.2 pypi_0 pypi
matplotlib 3.10.1 pypi_0 pypi
mpmath 1.3.0 pypi_0 pypi
ncurses 6.4 h6a678d5_0
numpy 2.2.4 pypi_0 pypi
nvidia-cublas-cu12 12.4.5.8 pypi_0 pypi
nvidia-cuda-cupti-cu12 12.4.127 pypi_0 pypi
nvidia-cuda-nvrtc-cu12 12.4.127 pypi_0 pypi
nvidia-cuda-runtime-cu12 12.4.127 pypi_0 pypi
nvidia-cudnn-cu12 9.1.0.70 pypi_0 pypi
nvidia-cufft-cu12 11.2.1.3 pypi_0 pypi
nvidia-curand-cu12 10.3.5.147 pypi_0 pypi
nvidia-cusolver-cu12 11.6.1.9 pypi_0 pypi
nvidia-cusparse-cu12 12.3.1.170 pypi_0 pypi
nvidia-cusparselt-cu12 0.6.2 pypi_0 pypi
nvidia-nccl-cu12 2.21.5 pypi_0 pypi
nvidia-nvjitlink-cu12 12.4.127 pypi_0 pypi
nvidia-nvtx-cu12 12.4.127 pypi_0 pypi
omegaconf 2.3.0 pypi_0 pypi
opencv-python 4.11.0.86 pypi_0 pypi
openssl 3.0.16 h5eee18b_0
packaging 24.2 pypi_0 pypi
pip 25.0 py310h06a4308_0
platformdirs 4.3.7 pypi_0 pypi
portalocker 3.1.1 pypi_0 pypi
pycocotools 2.0.8 pypi_0 pypi
pyparsing 3.2.3 pypi_0 pypi
python 3.10.16 he870216_1
python-dateutil 2.9.0.post0 pypi_0 pypi
pyyaml 6.0.2 pypi_0 pypi
readline 8.2 h5eee18b_0
regex 2024.11.6 pypi_0 pypi
requests 2.32.3 pypi_0 pypi
safetensors 0.5.3 pypi_0 pypi
sam-2 1.0 pypi_0 pypi
scipy 1.15.2 pypi_0 pypi
setuptools 75.8.0 py310h06a4308_0
six 1.17.0 pypi_0 pypi
sqlite 3.45.3 h5eee18b_0
supervision 0.25.1 pypi_0 pypi
sympy 1.13.1 pypi_0 pypi
timm 1.0.15 pypi_0 pypi
tk 8.6.14 h39e8969_0
tokenizers 0.21.1 pypi_0 pypi
tomli 2.2.1 pypi_0 pypi
torch 2.6.0 pypi_0 pypi
torchaudio 2.6.0 pypi_0 pypi
torchvision 0.21.0 pypi_0 pypi
tqdm 4.67.1 pypi_0 pypi
transformers 4.51.2 pypi_0 pypi
triton 3.2.0 pypi_0 pypi
tzdata 2025a h04d1e81_0
urllib3 2.4.0 pypi_0 pypi
wheel 0.45.1 py310h06a4308_0
xz 5.6.4 h5eee18b_1
yapf 0.43.0 pypi_0 pypi
zlib 1.2.13 h5eee18b_1
If additional information is needed, please feel free to let me know. I really hope this problem can finally be resolved.
I have the same problem
Same problem with torch= 2.6.0 & torchvision = 0.21.0.
Same problem with torch= 2.6.0 & torchvision = 0.21.0.
Solved with torch==2.5.1 & torchvision==0.20.1 #388
The problem still exists when I use torch 2.5.1 and torchvision 0.20.1.
Same issue.
Solved by downgrading to cuda 11.3 and gcc-9 and g++-9 sudo apt update sudo apt install -y g++-9 gcc-9 export CC=/usr/bin/gcc-9 export CXX=/usr/bin/g++-9 sudo ./cuda_11.3.1_465.19.01_linux.run --toolkit --silent --override pip install .
torch 2.1.2+cu121 torchvision 0.16.2+cu121
same issue
For who can't downgrade cuda, the fix is here: https://github.com/IDEA-Research/GroundingDINO/pull/415
Same problem with torch= 2.6.0 & torchvision = 0.21.0.
Solved with torch==2.5.1 & torchvision==0.20.1 #388
so u have solved the by downgrading torch and torchvision, no need for downgrading cuda?
Replaced value.type() with value.scalar_type() in ms_deform_attn_cuda.cu can solve this issue.
My env torch=2.9.0 & torchvision=0.24.0 & cuda 13.0