Open lecheal opened 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
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
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
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