安装Cmake CUDA CUDNN Opencv

Requirements

Requirements for Windows, Linux and MacOS

  • CMake >= 3.18: https://cmake.org/download/
  • Powershell (already installed on windows): https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell
  • CUDA >= 10.2: https://developer.nvidia.com/cuda-toolkit-archive (on Linux do Post-installation Actions)
  • OpenCV >= 2.4: use your preferred package manager (brew, apt), build from source using vcpkg or download from OpenCV official site (on Windows set system variable OpenCV_DIR = C:\opencv\build – where are the include and x64 folders image)
  • cuDNN >= 8.0.2 https://developer.nvidia.com/rdp/cudnn-archive (on Linux follow steps described here https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html#installlinux-tar , on Windows follow steps described here https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html#installwindows)
  • GPU with CC >= 3.0: https://en.wikipedia.org/wiki/CUDA#GPUs_supported

Install CMake

检查是有安装CMake

cmake --version

Install from APT

sudo apt update
sudo apt install cmake protobuf-compiler

Install from source

Preferred install from source codes rather than snap

sudo apt install build-essential libssl-dev

下载最新的cmake版本:https://cmake.org/download/

cd Downloads
tar -zxvf cmake-x.x.x.tar.gz
cd cmake-x-x-x
sudo ./bootstrap
sudo make
sudo make install
cmake --version

显示如下,即安装成功:
在这里插入图片描述

Install CUDA

在这里插入图片描述

wget https://developer.download.nvidia.com/compute/cuda/11.5.0/local_installers/cuda_11.5.0_495.29.05_linux.run
sudo sh cuda_11.5.0_495.29.05_linux.run

Choose CUDA toolkit only, not driver
在这里插入图片描述
Add path to ~/.bashrc or ~/.zshrc

# CUDA paths
export PATH=$PATH:/usr/local/cuda/bin
export LD_LIBRARY_PATH=/usr/local/cuda/lib64

Install cuDNN

Download cudnn from the download page
在这里插入图片描述

cd Downloads
tar -xzvf cudnn-11.5-linux-*.tgz
sudo cp cuda/include/cudnn*.h /usr/local/cuda/include 
sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn*.h /usr/local/cuda/lib64/libcudnn*

Install OpenCV

The easiest way is apt

sudo apt install libopencv-dev python3-opencv
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值