ubuntu setup path of cuda

参考:https://blog.csdn.net/wanzhen4330/article/details/81699769

setup PATH: 打开主目录下的 .bashrc文件添加如下路径, .bashrc文件在/home/eric下。

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-9.0/lib64
export PATH=$PATH:/usr/local/cuda-9.0/bin
export CUDA_HOME=$CUDA_HOME:/usr/local/cuda-9.0

终端运行:source ~/.bashrc

检查:nvcc –version。 驱动是通过nvidia-smi来检查。

安装cudnn

解压下载的文件,可以看到cuda文件夹,在当前目录打开终端,执行如下命令:
sudo cp cuda/include/cudnn.h /usr/local/cuda/include/

sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64/

sudo chmod a+r /usr/local/cuda/include/cudnn.h

sudo chmod a+r /usr/local/cuda/lib64/libcudnn*

Leave a Reply

Your email address will not be published. Required fields are marked *