安装mmcv-full报错:<command-line>: fatal error: /usr/local/cuda/include/stdc-predef.h: Permission denied

在这里插入图片描述

一、报错:

/home/XXX/miniconda3/envs/dinov2/lib/python3.9/site-packages/torch/utils/cpp_extension.py:398: UserWarning: There are no g++ version bounds defined for CUDA version 11.8
        warnings.warn(f'There are no {compiler_name} version bounds defined for CUDA version {cuda_str_version}')
      building 'mmcv._ext' extension
      creating build/temp.linux-x86_64-cpython-39
      creating build/temp.linux-x86_64-cpython-39/mmcv
      creating build/temp.linux-x86_64-cpython-39/mmcv/ops
      creating build/temp.linux-x86_64-cpython-39/mmcv/ops/csrc
      creating build/temp.linux-x86_64-cpython-39/mmcv/ops/csrc/pytorch
      creating build/temp.linux-x86_64-cpython-39/mmcv/ops/csrc/pytorch/cpu
      creating build/temp.linux-x86_64-cpython-39/mmcv/ops/csrc/pytorch/cuda
      gcc -pthread -B /home/XXX/miniconda3/envs/dinov2/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /home/XXX/miniconda3/envs/dinov2/include -I/home/XXX/miniconda3/envs/dinov2/include -fPIC -O2 -isystem /home/XXX/miniconda3/envs/dinov2/include -fPIC -DMMCV_WITH_CUDA -I/tmp/pip-install-pve3nwsx/mmcv-full_8509d9f644eb4382946d87d9b0b48dc7/mmcv/ops/csrc/common -I/tmp/pip-install-pve3nwsx/mmcv-full_8509d9f644eb4382946d87d9b0b48dc7/mmcv/ops/csrc/common/cuda -I/home/XXX/miniconda3/envs/dinov2/lib/python3.9/site-packages/torch/include -I/home/XXX/miniconda3/envs/dinov2/lib/python3.9/site-packages/torch/include/torch/csrc/api/include -I/home/XXX/miniconda3/envs/dinov2/lib/python3.9/site-packages/torch/include/TH -I/home/XXX/miniconda3/envs/dinov2/lib/python3.9/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/XXX/miniconda3/envs/dinov2/include/python3.9 -c ./mmcv/ops/csrc/pytorch/active_rotated_filter.cpp -o build/temp.linux-x86_64-cpython-39/./mmcv/ops/csrc/pytorch/active_rotated_filter.o -std=c++14 -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
      <command-line>: fatal error: /usr/local/cuda/include/stdc-predef.h: Permission denied
      compilation terminated.
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for mmcv-full
  Running setup.py clean for mmcv-full
Failed to build mmcv-full
ERROR: Could not build wheels for mmcv-full, which is required to install pyproject.toml-based projects

二、解决办法

把该路径加权限:

sudo chmod -R a+r /usr/local/cuda/include

或者

sudo chmod 777 -R /usr/local/cuda/include/

三、附带链接

torch版本选择:https://pytorch.org/get-started/previous-versions/
mmcv版本选择:https://mmcv.readthedocs.io/en/v1.5.0/get_started/installation.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Thomas_Cai

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值