open-mmlab / mmcv

OpenMMLab Computer Vision Foundation
https://mmcv.readthedocs.io/en/latest/
Apache License 2.0
5.91k stars 1.65k forks source link

源码安装mmcv失败 #2999

Open lecheal opened 11 months ago

lecheal commented 11 months ago

Prerequisite

Environment

OrderedDict([('sys.platform', 'linux'), ('Python', '3.10.13 (main, Sep 11 2023, 13:44:35) [GCC 11.2.0]'), ('CUDA available', True), ('numpy_random_seed', 2147483648), ('GPU 0,1', 'NVIDIA GeForce RTX 4090'), ('CUDA_HOME', '/usr'), ('NVCC', 'Cuda compilation tools, release 11.5, V11.5.119'), ('GCC', 'gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0'), ('PyTorch', '2.0.1+cu117'), ('PyTorch compiling details', 'PyTorch built with:\n - GCC 9.3\n - C++ Version: 201703\n - Intel(R) oneAPI Math Kernel Library Version 2022.2-Product Build 20220804 for Intel(R) 64 architecture applications\n - Intel(R) MKL-DNN v2.7.3 (Git Hash 6dbeffbae1f23cbbeae17adb7b5b13f1f37c080e)\n - OpenMP 201511 (a.k.a. OpenMP 4.5)\n - LAPACK is enabled (usually provided by MKL)\n - NNPACK is enabled\n - CPU capability usage: AVX2\n - CUDA Runtime 11.7\n - NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_86,code=sm_86\n - CuDNN 8.5\n - Magma 2.6.1\n - Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.7, CUDNN_VERSION=8.5.0, CXX_COMPILER=/opt/rh/devtoolset-9/root/usr/bin/c++, CXX_FLAGS= -D_GLIBCXX_USE_CXX11_ABI=0 -fabi-version=11 -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOROCTRACER -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -O2 -fPIC -Wall -Wextra -Werror=return-type -Werror=non-virtual-dtor -Werror=bool-operation -Wnarrowing -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wunused-local-typedefs -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Werror=cast-function-type -Wno-stringop-overflow, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_DISABLE_GPU_ASSERTS=ON, TORCH_VERSION=2.0.1, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=1, USE_NNPACK=ON, USE_OPENMP=ON, USE_ROCM=OFF, \n'), ('TorchVision', '0.15.2+cu117'), ('OpenCV', '4.5.4'), ('MMEngine', '0.10.1'), ('MMCV', '2.1.0'), ('MMCV Compiler', 'n/a'), ('MMCV CUDA Compiler', 'n/a')])

Reproduces the problem - code sample

https://mmcv.readthedocs.io/en/latest/get_started/build.html#build-on-linux

Reproduces the problem - command or script

pip install -e . -v

Reproduces the problem - error message

FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/masked_conv2d_cuda.o /home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/torch/include/c10/util/irange.h(54): warning #186-D: pointless comparison of unsigned integer with zero FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/knn_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/active_rotated_filter_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/bbox_overlaps_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/ball_query_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/prroi_pool_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/assign_score_withk_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/deform_roi_pool_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/points_in_polygons_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/deform_conv_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/group_points_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/modulated_deform_conv_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/gather_points_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/focal_loss_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/carafe_naive_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/nms_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/bezier_align_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/furthest_point_sample_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/border_align_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/chamfer_distance_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/points_in_boxes_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/riroi_align_rotated_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/roi_align_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/carafe_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/iou3d_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/min_area_polygons.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/ms_deform_attn_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/fused_bias_leakyrelu_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/diff_iou_rotated_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/box_iou_quadri_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/box_iou_rotated_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/correlation_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/bias_act_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/psamask_cuda.o /usr/bin/nvcc -DMMCV_WITH_CUDA -I/home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/mmcv/ops/csrc/pytorch -I/home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/mmcv/ops/csrc/common -I/home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/mmcv/ops/csrc/common/cuda -I/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/torch/include -I/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/torch/include/TH -I/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/torch/include/THC -I/home/lecheal/anaconda3/envs/lecheal_p310/include/python3.10 -c -c /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/mmcv/ops/csrc/pytorch/cuda/psamask_cuda.cu -o /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/psamask_cuda.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -std=c++17 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_ext -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 /home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/torch/include/c10/util/irange.h(54): warning #186-D: pointless comparison of unsigned integer with zero detected during: instantiation of "__nv_bool c10::detail::integer_iterator<I, one_sided, >::operator==(const c10::detail::integer_iterator<I, one_sided, > &) const [with I=size_t, one_sided=false, =0]" (61): here instantiation of "__nv_bool c10::detail::integer_iterator<I, one_sided, >::operator!=(const c10::detail::integer_iterator<I, one_sided, > &) const [with I=size_t, one_sided=false, =0]" /home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/torch/include/c10/core/TensorImpl.h(77): here

/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/torch/include/c10/util/irange.h(54): warning #186-D: pointless comparison of unsigned integer with zero
          detected during:
            instantiation of "__nv_bool c10::detail::integer_iterator<I, one_sided, <unnamed>>::operator==(const c10::detail::integer_iterator<I, one_sided, <unnamed>> &) const [with I=std::size_t, one_sided=true, <unnamed>=0]"
(61): here
            instantiation of "__nv_bool c10::detail::integer_iterator<I, one_sided, <unnamed>>::operator!=(const c10::detail::integer_iterator<I, one_sided, <unnamed>> &) const [with I=std::size_t, one_sided=true, <unnamed>=0]"
/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/torch/include/ATen/core/qualified_name.h(73): here

/usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’:
  435 |         function(_Functor&& __f)
      |                                                                                                                                                 ^
/usr/include/c++/11/bits/std_function.h:435:145: note:         ‘_ArgTypes’
/usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘...’:
  530 |         operator=(_Functor&& __f)
      |                                                                                                                                                  ^
/usr/include/c++/11/bits/std_function.h:530:146: note:         ‘_ArgTypes’
[35/100] /usr/bin/nvcc  -DMMCV_WITH_CUDA -I/home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/mmcv/ops/csrc/pytorch -I/home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/mmcv/ops/csrc/common -I/home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/mmcv/ops/csrc/common/cuda -I/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/torch/include -I/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/torch/include/TH -I/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/torch/include/THC -I/home/lecheal/anaconda3/envs/lecheal_p310/include/python3.10 -c -c /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/mmcv/ops/csrc/pytorch/cuda/convex_iou.cu -o /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/convex_iou.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'"'"'' -std=c++17 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_ext -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86
FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/convex_iou.o

FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/fused_spconv_ops_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/nms_quadri_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/nms_rotated_cuda.o FAILED: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/filtered_lrelu.o /usr/bin/nvcc -DMMCV_WITH_CUDA -I/home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/mmcv/ops/csrc/pytorch -I/home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/mmcv/ops/csrc/common -I/home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/mmcv/ops/csrc/common/cuda -I/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/torch/include -I/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/torch/include/TH -I/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/torch/include/THC -I/home/lecheal/anaconda3/envs/lecheal_p310/include/python3.10 -c -c /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/mmcv/ops/csrc/pytorch/cuda/filtered_lrelu.cu -o /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/build/temp.linux-x86_64-cpython-310/mmcv/ops/csrc/pytorch/cuda/filtered_lrelu.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -std=c++17 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_ext -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86 /home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/torch/include/c10/util/irange.h(54): warning #186-D: pointless comparison of unsigned integer with zero detected during: instantiation of "__nv_bool c10::detail::integer_iterator<I, one_sided, >::operator==(const c10::detail::integer_iterator<I, one_sided, > &) const [with I=size_t, one_sided=false, =0]" (61): here instantiation of "__nv_bool c10::detail::integer_iterator<I, one_sided, >::operator!=(const c10::detail::integer_iterator<I, one_sided, > &) const [with I=size_t, one_sided=false, =0]" /home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/torch/include/c10/core/TensorImpl.h(77): here

/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/torch/include/c10/util/irange.h(54): warning #186-D: pointless comparison of unsigned integer with zero
          detected during:
            instantiation of "__nv_bool c10::detail::integer_iterator<I, one_sided, <unnamed>>::operator==(const c10::detail::integer_iterator<I, one_sided, <unnamed>> &) const [with I=std::size_t, one_sided=true, <unnamed>=0]"
(61): here
            instantiation of "__nv_bool c10::detail::integer_iterator<I, one_sided, <unnamed>>::operator!=(const c10::detail::integer_iterator<I, one_sided, <unnamed>> &) const [with I=std::size_t, one_sided=true, <unnamed>=0]"
/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/torch/include/ATen/core/qualified_name.h(73): here

/usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’:
  435 |         function(_Functor&& __f)
      |                                                                                                                                                 ^
/usr/include/c++/11/bits/std_function.h:435:145: note:         ‘_ArgTypes’
/usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘...’:
  530 |         operator=(_Functor&& __f)
      |                                                                                                                                                  ^
/usr/include/c++/11/bits/std_function.h:530:146: note:         ‘_ArgTypes’
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
  File "/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1893, in _run_ninja_build
    subprocess.run(
  File "/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/subprocess.py", line 526, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v', '-j', '39']' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<string>", line 2, in <module>
  File "<pip-setuptools-caller>", line 34, in <module>
  File "/home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/setup.py", line 450, in <module>
    setup(
  File "/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/setuptools/__init__.py", line 103, in setup
    return distutils.core.setup(**attrs)
  File "/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
  File "/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/setuptools/dist.py", line 963, in run_command
    super().run_command(command)
  File "/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/setuptools/command/develop.py", line 33, in run
    self.install_for_development()
  File "/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/setuptools/command/develop.py", line 108, in install_for_development
    self.run_command('build_ext')
  File "/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/setuptools/dist.py", line 963, in run_command
    super().run_command(command)
  File "/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/setuptools/command/build_ext.py", line 88, in run
    _build_ext.run(self)
  File "/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
    self.build_extensions()
  File "/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 843, in build_extensions
    build_ext.build_extensions(self)
  File "/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
    self._build_extensions_serial()
  File "/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
    self.build_extension(ext)
  File "/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/setuptools/command/build_ext.py", line 249, in build_extension
    _build_ext.build_extension(self, ext)
  File "/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/Cython/Distutils/build_ext.py", line 135, in build_extension
    super(build_ext, self).build_extension(ext)
  File "/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 548, in build_extension
    objects = self.compiler.compile(
  File "/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 658, in unix_wrap_ninja_compile
    _write_ninja_file_and_compile_objects(
  File "/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1574, in _write_ninja_file_and_compile_objects
    _run_ninja_build(
  File "/home/lecheal/anaconda3/envs/lecheal_p310/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1909, in _run_ninja_build
    raise RuntimeError(message) from e
RuntimeError: Error compiling objects for extension
error: subprocess-exited-with-error

× python setup.py develop did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
full command: /home/lecheal/anaconda3/envs/lecheal_p310/bin/python -c '
exec(compile('"'"''"'"''"'"'
# This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
#
# - It imports setuptools before invoking setup.py, to enable projects that directly
#   import from `distutils.core` to work with newer packaging standards.
# - It provides a clear error message when setuptools is not installed.
# - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
#   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
#     manifest_maker: standard file '"'"'-c'"'"' not found".
# - It generates a shim setup.py, for handling setup.cfg-only projects.
import os, sys, tokenize

try:
    import setuptools
except ImportError as error:
    print(
        "ERROR: Can not execute `setup.py` since setuptools is not available in "
        "the build environment.",
        file=sys.stderr,
    )
    sys.exit(1)

__file__ = %r
sys.argv[0] = __file__

if os.path.exists(__file__):
    filename = __file__
    with tokenize.open(__file__) as f:
        setup_py_code = f.read()
else:
    filename = "<auto-generated setuptools caller>"
    setup_py_code = "from setuptools import setup; setup()"

exec(compile(setup_py_code, filename, "exec"))
'"'"''"'"''"'"' % ('"'"'/home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' develop --no-deps
cwd: /home/lecheal/workspace/BasicVSR_PlusPlus/mmcv/

error: subprocess-exited-with-error

× python setup.py develop did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Additional information

No response

forever10086 commented 11 months ago

请问您是怎么解决的呢?我也遇到了及其相似的问题

nicolas-schreiber commented 11 months ago

Just FYI, I had the same issue but was able to solve it by changing the compiler that was used. For reference, I was trying to install it with Ubuntu 22.04 and adjusted the compilers using following bash commands:

sudo apt-get install gcc-10 g++-10
export CC=/usr/bin/gcc-10
export CXX=/usr/bin/g++-10
export CUDAHOSTCXX=/usr/bin/g++-10