Ubuntu16.04 安装cuda9.0

    xiaoxiao2022-07-04  131

    **

    一、Ubuntu16.04安装cuda 9.0:

    ** 1.下载cuda9.0https://developer.nvidia.com/cuda-90-download-archive?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=runfilelocal 2.sudo sh cuda_9.0.176_384.81_linux.run 3.出现–More–(0%),一直按空格键,直到出现Do you accept the previously read EULA? accept/decline/quit:accept(手动输入accept) 4.Install NVIDAI Accelerated Graphics Driver for Lunix-x86_64 384.81? (y)es/(n)o/(q)uit:n(手动输入n,表示不安装驱动) 5.Install the CUDA 9.0 Toolkit? (y)es/(n)o/(q)uit:y(手动输入y) 6.Enter Toolkit Location [default is /usr/local/cuda-9.0]:按回车键 7.Do you want to install a symbolic link at /usr/local/cuda? (y)es/(n)o/(q)uit:n(手动输入n) 8.Install the CUDA 9.0 Samples? (y)es/(n)o/(q)uit:n(手动输入n) 等这安装完成 9. 查看/usr/local文件夹下是否存在cuda文件夹,若没有,则执行sudo ln -s /usr/local/cuda-9.0/ /urs/local/cuda 10.nvcc -V查看安装的CUDA版本,若不是9.0,则输入gedit ~/.bashrc 11.将打开的文件拉到最下面查看是否存在三句: export PATH=/usr/local/cuda/bin: P A T H e x p o r t L D L I B R A R Y P A T H = / u s r / l o c a l / c u d a / l i b 64 : PATH export LD_LIBRARY_PATH=/usr/local/cuda/lib64: PATHexportLDLIBRARYPATH=/usr/local/cuda/lib64:LD_LIBRARY_PATH export LIBRARY_PATH=/usr/local/cuda/lib64:$LIBRARY_PATH 若不存在的话将这三句话添加 12.修改完,保存之后,关掉该文件,终端执行:source ~/.bashrc 13.nvcc -V查看安装的CUDA版本 **

    二、配置cudnn

    ** 1.解压缩cudnn-9.0-linux-x64-v7.1.tgz,解压缩完成后出现一个cuda文件夹 2.cd cuda/inlude 3.sudo cp .h /usr/local/cuda/include/ 4.cd …/lib64 5.sudo cp lib /usr/local/cuda/lib64/ 6.cd /usr/local/cuda/lib64/ 7.sudo rm -r libcudnn.so libcudnn.so.7 8.sudo ln -s libcudnn.so.7.1.4 libcudnn.so.7 9.sudo ln -s libcudnn.so.7 libcudnn.so 10.sudo ldconfig

    这样就安装完成了!

    最新回复(0)