facebookresearch / detectron2

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

Error while running setup.py #5227

Closed JiaoSiyi closed 3 months ago

JiaoSiyi commented 4 months ago

I am trying to run setup.py, and this is my error traceback:


> Running setup.py develop for detectron2
>     error: subprocess-exited-with-error
>     
>     × python setup.py develop did not run successfully.
>     │ exit code: 1
>     ╰─> [53 lines of output]
>         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'
>         adding license file 'LICENSE'
>         writing manifest file 'detectron2.egg-info/SOURCES.txt'
>         running build_ext
>         raise RuntimeError(CUDA_MISMATCH_MESSAGE.format(cuda_str_version, torch.version.cuda))
>         building 'detectron2._C' extension
>         Emitting ninja build file /home/dancer/DatasetDM/src/detectron2/build/temp.linux-x86_64-cpython-38/build.ninja...
>         Compiling objects...
>         Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
>         /opt/conda/envs/DatasetDM/lib/python3.8/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated.
>         !!
>         
>                 ********************************************************************************
>                 Please avoid running ``setup.py`` and ``easy_install``.
>                 Instead, use pypa/build, pypa/installer or other
>                 standards-based tools.
>         
>                 See https://github.com/pypa/setuptools/issues/917 for details.
>                 ********************************************************************************
>         
>         !!
>           easy_install.initialize_options(self)
>         /opt/conda/envs/DatasetDM/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
>         !!
>         
>                 ********************************************************************************
>                 Please avoid running ``setup.py`` directly.
>                 Instead, use pypa/build, pypa/installer or other
>                 standards-based tools.
>         
>                 See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
>                 ********************************************************************************
>         
>         !!
>           self.initialize_options()
>         /opt/conda/envs/DatasetDM/lib/python3.8/site-packages/torch/utils/cpp_extension.py:782: UserWarning: The detected CUDA version (11.7) has a minor version mismatch with the version that was used to compile PyTorch (10.2). Most likely this shouldn't be a problem.
>           warnings.warn(CUDA_MISMATCH_WARN.format(cuda_str_version, torch.version.cuda))
>         /opt/conda/envs/DatasetDM/lib/python3.8/site-packages/torch/cuda/__init__.py:143: UserWarning:
>         NVIDIA GeForce RTX 3090 with CUDA capability sm_86 is not compatible with the current PyTorch installation.
>         The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_70.
>         If you want to use the NVIDIA GeForce RTX 3090 GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/
>         
>           warnings.warn(incompatible_device_warn.format(device_name, capability, " ".join(arch_list), device_name))
>         1.10.2.git.kitware.jobserver-1
>         /opt/conda/envs/DatasetDM/bin/x86_64-conda-linux-gnu-c++ -shared -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-rpath,/opt/conda/envs/DatasetDM/lib -L/opt/conda/envs/DatasetDM/lib -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-rpath,/opt/conda/envs/DatasetDM/lib -L/opt/conda/envs/DatasetDM/lib -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,-rpath,/opt/conda/lib -Wl,-rpath-link,/opt/conda/lib -L/opt/conda/lib -march -DNDEBUG -D_FORTIFY_SOURCE /home/dancer/DatasetDM/src/detectron2/build/temp.linux-x86_64-cpython-38/home/dancer/DatasetDM/src/detectron2/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cpu.o /home/dancer/DatasetDM/src/detectron2/build/temp.linux-x86_64-cpython-38/home/dancer/DatasetDM/src/detectron2/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cuda.o /home/dancer/DatasetDM/src/detectron2/build/temp.linux-x86_64-cpython-38/home/dancer/DatasetDM/src/detectron2/detectron2/layers/csrc/box_iou_rotated/box_iou_rotated_cpu.o /home/dancer/DatasetDM/src/detectron2/build/temp.linux-x86_64-cpython-38/home/dancer/DatasetDM/src/detectron2/detectron2/layers/csrc/box_iou_rotated/box_iou_rotated_cuda.o /home/dancer/DatasetDM/src/detectron2/build/temp.linux-x86_64-cpython-38/home/dancer/DatasetDM/src/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o /home/dancer/DatasetDM/src/detectron2/build/temp.linux-x86_64-cpython-38/home/dancer/DatasetDM/src/detectron2/detectron2/layers/csrc/cuda_version.o /home/dancer/DatasetDM/src/detectron2/build/temp.linux-x86_64-cpython-38/home/dancer/DatasetDM/src/detectron2/detectron2/layers/csrc/deformable/deform_conv_cuda.o /home/dancer/DatasetDM/src/detectron2/build/temp.linux-x86_64-cpython-38/home/dancer/DatasetDM/src/detectron2/detectron2/layers/csrc/deformable/deform_conv_cuda_kernel.o /home/dancer/DatasetDM/src/detectron2/build/temp.linux-x86_64-cpython-38/home/dancer/DatasetDM/src/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cpu.o /home/dancer/DatasetDM/src/detectron2/build/temp.linux-x86_64-cpython-38/home/dancer/DatasetDM/src/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.o /home/dancer/DatasetDM/src/detectron2/build/temp.linux-x86_64-cpython-38/home/dancer/DatasetDM/src/detectron2/detectron2/layers/csrc/vision.o -L/opt/conda/envs/DatasetDM/lib/python3.8/site-packages/torch/lib -L/opt/conda/lib -lc10 -ltorch -ltorch_cpu -ltorch_python -lcudart -lc10_cuda -ltorch_cuda -o build/lib.linux-x86_64-cpython-38/detectron2/_C.cpython-38-x86_64-linux-gnu.so
>         x86_64-conda-linux-gnu-c++: error: unrecognized command-line option '-march'
>         error: command '/opt/conda/envs/DatasetDM/bin/x86_64-conda-linux-gnu-c++' failed with exit code 1
>         [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
> ╰─> [53 lines of output]
>     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'
>     adding license file 'LICENSE'
>     writing manifest file 'detectron2.egg-info/SOURCES.txt'
>     running build_ext
>     raise RuntimeError(CUDA_MISMATCH_MESSAGE.format(cuda_str_version, torch.version.cuda))
>     building 'detectron2._C' extension
>     Emitting ninja build file /home/dancer/DatasetDM/src/detectron2/build/temp.linux-x86_64-cpython-38/build.ninja...
>     Compiling objects...
>     Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
>     /opt/conda/envs/DatasetDM/lib/python3.8/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated.
>     !!
>     
>             ********************************************************************************
>             Please avoid running ``setup.py`` and ``easy_install``.
>             Instead, use pypa/build, pypa/installer or other
>             standards-based tools.
>     
>             See https://github.com/pypa/setuptools/issues/917 for details.
>             ********************************************************************************
>     
>     !!
>       easy_install.initialize_options(self)
>     /opt/conda/envs/DatasetDM/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
>     !!
>     
>             ********************************************************************************
>             Please avoid running ``setup.py`` directly.
>             Instead, use pypa/build, pypa/installer or other
>             standards-based tools.
>     
>             See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
>             ********************************************************************************
>     
>     !!
>       self.initialize_options()
>     /opt/conda/envs/DatasetDM/lib/python3.8/site-packages/torch/utils/cpp_extension.py:782: UserWarning: The detected CUDA version (11.7) has a minor version mismatch with the version that was used to compile PyTorch (10.2). Most likely this shouldn't be a problem.
>       warnings.warn(CUDA_MISMATCH_WARN.format(cuda_str_version, torch.version.cuda))
>     /opt/conda/envs/DatasetDM/lib/python3.8/site-packages/torch/cuda/__init__.py:143: UserWarning:
>     NVIDIA GeForce RTX 3090 with CUDA capability sm_86 is not compatible with the current PyTorch installation.
>     The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_70.
>     If you want to use the NVIDIA GeForce RTX 3090 GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/
>     
>       warnings.warn(incompatible_device_warn.format(device_name, capability, " ".join(arch_list), device_name))
>     1.10.2.git.kitware.jobserver-1
>     /opt/conda/envs/DatasetDM/bin/x86_64-conda-linux-gnu-c++ -shared -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-rpath,/opt/conda/envs/DatasetDM/lib -L/opt/conda/envs/DatasetDM/lib -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-rpath,/opt/conda/envs/DatasetDM/lib -L/opt/conda/envs/DatasetDM/lib -Wl,-O2 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,--disable-new-dtags -Wl,--gc-sections -Wl,-rpath,/opt/conda/lib -Wl,-rpath-link,/opt/conda/lib -L/opt/conda/lib -march -DNDEBUG -D_FORTIFY_SOURCE /home/dancer/DatasetDM/src/detectron2/build/temp.linux-x86_64-cpython-38/home/dancer/DatasetDM/src/detectron2/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cpu.o /home/dancer/DatasetDM/src/detectron2/build/temp.linux-x86_64-cpython-38/home/dancer/DatasetDM/src/detectron2/detectron2/layers/csrc/ROIAlignRotated/ROIAlignRotated_cuda.o /home/dancer/DatasetDM/src/detectron2/build/temp.linux-x86_64-cpython-38/home/dancer/DatasetDM/src/detectron2/detectron2/layers/csrc/box_iou_rotated/box_iou_rotated_cpu.o /home/dancer/DatasetDM/src/detectron2/build/temp.linux-x86_64-cpython-38/home/dancer/DatasetDM/src/detectron2/detectron2/layers/csrc/box_iou_rotated/box_iou_rotated_cuda.o /home/dancer/DatasetDM/src/detectron2/build/temp.linux-x86_64-cpython-38/home/dancer/DatasetDM/src/detectron2/detectron2/layers/csrc/cocoeval/cocoeval.o /home/dancer/DatasetDM/src/detectron2/build/temp.linux-x86_64-cpython-38/home/dancer/DatasetDM/src/detectron2/detectron2/layers/csrc/cuda_version.o /home/dancer/DatasetDM/src/detectron2/build/temp.linux-x86_64-cpython-38/home/dancer/DatasetDM/src/detectron2/detectron2/layers/csrc/deformable/deform_conv_cuda.o /home/dancer/DatasetDM/src/detectron2/build/temp.linux-x86_64-cpython-38/home/dancer/DatasetDM/src/detectron2/detectron2/layers/csrc/deformable/deform_conv_cuda_kernel.o /home/dancer/DatasetDM/src/detectron2/build/temp.linux-x86_64-cpython-38/home/dancer/DatasetDM/src/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cpu.o /home/dancer/DatasetDM/src/detectron2/build/temp.linux-x86_64-cpython-38/home/dancer/DatasetDM/src/detectron2/detectron2/layers/csrc/nms_rotated/nms_rotated_cuda.o /home/dancer/DatasetDM/src/detectron2/build/temp.linux-x86_64-cpython-38/home/dancer/DatasetDM/src/detectron2/detectron2/layers/csrc/vision.o -L/opt/conda/envs/DatasetDM/lib/python3.8/site-packages/torch/lib -L/opt/conda/lib -lc10 -ltorch -ltorch_cpu -ltorch_python -lcudart -lc10_cuda -ltorch_cuda -o build/lib.linux-x86_64-cpython-38/detectron2/_C.cpython-38-x86_64-linux-gnu.so
>     x86_64-conda-linux-gnu-c++: error: unrecognized command-line option '-march'
>     error: command '/opt/conda/envs/DatasetDM/bin/x86_64-conda-linux-gnu-c++' failed with exit code 1
>     [end of output]
> 
> note: This error originates from a subprocess, and is likely not a problem with pip.
github-actions[bot] commented 4 months ago

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

RajUpadhyay commented 4 months ago

Your pytorch version does not match the cuda version. That is why it is raising the error. Install the pytorch version compatible with your cuda version.

github-actions[bot] commented 3 months ago

Requested information was not provided in 7 days, so we're closing this issue.

Please open new issue if information becomes available. Otherwise, use github discussions for free-form discussions.

captainfffsama commented 2 weeks ago

here is the problem:

>     NVIDIA GeForce RTX 3090 with CUDA capability sm_86 is not compatible with the current PyTorch installation.
>     The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_70.

set TORCH_CUDA_ARCH_LIST can temporarily fix this problem. get your capabilities can run this:

python -c "import torch; print(torch.cuda.get_device_capability())"

Specific solutions can refer to this link: https://github.com/captainfffsama/detectron2/issues/1