CUDNN与CUDA的踩坑与记录
CUDA的安装
nvidia-smi
看显卡驱动能够安装的最高版本的CUDA- 下载CUDA–>点击
- 安装过程去掉显卡驱动
- 安装完成的结果如下:
=========== = Summary = =========== Driver: Not Selected Toolkit: Installed in /usr/local/cuda-10.2/ Samples: Installed in /home/gsh/, but missing recommended libraries Please make sure that - PATH includes /usr/local/cuda-10.2/bin - LD_LIBRARY_PATH includes /usr/local/cuda-10.2/lib64, or, add /usr/local/cuda-10.2/lib64 to /etc/ld.so.conf and run ldconfig as root To uninstall the CUDA Toolkit, run cuda-uninstaller in /usr/local/cuda-10.2/bin Please see CUDA_Installation_Guide_Linux.pdf in /usr/local/cuda-10.2/doc/pdf for detailed information on setting up CUDA. ***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 440.00 is required for CUDA 10.2 functionality to work. To install the driver using this installer, run the following command, replacing <CudaInstaller> with the name of this run file: sudo <CudaInstaller>.run --silent --driver Logfile is /var/log/cuda-installer.log
- 配置环境变量
export PATH=/usr/local/cuda-10.2/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64:$LD_LIBRARY_PATH
export PATH=/usr/bin:$PATH
source .bashrc
注意这里的cuda是cuda-10.2,带着版本号,不是那个软连接cuda - 验证:
nvcc -V
- 配置环境变量
CUDNN的安装
-
下载CUDNN–>点击
-
安装文档在这里–>>点击
-
记得加上对应的版本号
$ sudo cp ./include/cudnn*.h /usr/local/cuda-11.6/include $ sudo cp -P ./lib/libcudnn* /usr/local/cuda-11.6/lib64 $ sudo chmod a+r /usr/local/cuda-11.6/include/cudnn*.h /usr/local/cuda-11.6/lib64/libcudnn*
CUDA的删除
To uninstall the CUDA Toolkit, run cuda-uninstaller in /usr/local/cuda-10.2/bin
CUDNN的删除
把cuda的文件删了就行了
检测一下
darknet网络–>>点击
./darknet detector demo cfg/coco.data cfg/yolov3.cfg yolov3.weights