安装cv-cuda库,要求gcc11,cmake>3.22版本。
Linux distro:
Ubuntu x86_64 >= 18.04
WSL2 with Ubuntu >= 20.04 (tested with 20.04)
CUDA Driver >= 11.7 (Not tested on 12.0)
GCC >= 11.0
Python >= 3.7
cmake >= 3.22
gcc、g++介绍
参考:http://c.biancheng.net/view/7936.html
升级gcc
参考:http://t.zoukankan.com/lianshuiwuyi-p-8413415.html
升级完成之后报错,cuda不支持gcc,继续升级cuda。
#$ "/usr/local/bin"/x86_64-pc-linux-gnu-g++-11.2.0 -D__CUDA_ARCH__=300 -E
-x c++ -DCUDA_DOUBLE_MATH_FUNCTIONS -D__CUDACC__ -D__NVCC__
"-I/usr/local/cuda/bin/../targets/x86_64-linux/include"
-D__CUDACC_VER_MAJOR__=10 -D__CUDACC_VER_MINOR__=2
-D__CUDACC_VER_BUILD__=89 -include "cuda_runtime.h" -m64
"CMakeCUDACompilerId.cu" -o "tmp/CMakeCUDACompilerId.cpp1.ii"
In file included from
/usr/local/cuda/bin/../targets/x86_64-linux/include/cuda_runtime.h:83,
from <command-line>:
/usr/local/cuda/bin/../targets/x86_64-linux/include/crt/host_config.h:138:2:
error: #error -- unsupported GNU version! gcc versions later than 8 are not
supported!
138 | #error -- unsupported GNU version! gcc versions later than 8 are not supported!
| ^~~~~
# --error 0x1 -
升级cuda前需确认驱动版本是否匹配。
步骤1.查看所需的cuda版本(这里要求>= 11.7)
步骤2.去官网下载cuda,并查看对应的驱动版本,如果不满足需要升级nvidia驱动版本。
首先前往官网下载你需要升级的cuda版本的安装文件,官网下载地址:https://developer.nvidia.com/cuda-toolkit-archive
安装并管理多个版本gcc和cuda,参考:https://blog.csdn.net/weixin_51021488/article/details/127842305
步骤3,升级nvidia驱动,有两种方法,一种是在官网下载
另一种是在设置中升级