And a corresponding version Installation CUDA9.0 under Ubuntu16.04 CUDNN

1, install NVIDIA graphics driver (it was GeForce GTX960M)

Reference: https://blog.csdn.net/ghw15221836342/article/details/79571559
note cards which version number, do not blindly install (I measured pro-active)

2, GCC installation

See also: https://blog.csdn.net/weixin_35762621/article/details/80336291

sudo apt-get install gcc-5.5  #注意这里要根据情况来写版本号,我这里是 gcc version 5.5.0 20171010 (Ubuntu 5.5.0-12ubuntu1~16.04) 

In case the above version does not match their case it does not matter, then repeat the installation of other versions of gcc can just change back when installing the version number can then be used for the upgrade version compiled by priority

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-? ? # 第一个?为自己的版本号,第二个?为数字,越大优先级越高

3, install and test CUDA9.0

CUDA downloads: https://developer.nvidia.com/cuda-90-download-archive?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=runfilelocal
click on this link to download run version of CUDA, then do not rush to install .
Enter the following command, if there is cuda-9.0 this folder check usr / local (my computer by installing the card will automatically generate cuda-10.0 this folder, instead of 9.0)

cd /usr/local  #如果没有输入以下命令创建
mkdir cuda-9.0

Note the following two installation

Do you accept the previously read EULA?
accept/decline/quit:accept

The NVIDIA Accelerated Graphics Driver for the Install the Linux-the x86_64 375.26?
(Y) ES / (n) O / (Q) UIT: n- (especially this one must be selected from n- )

For details, see: https://blog.csdn.net/zbqhc/article/details/73277750

installation

sudo sh cuda_9.0.176_384.81_linux.run

Configuring the environment

An input terminal

sudo gedit /etc/profile

At the end of the open file, add the following two lines.
64-bit systems:

export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

System 32:

export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

Details Figure
Here Insert Picture Description

Test (or test proposed here)

See also: https://blog.csdn.net/QLULIBIN/article/details/78714596

4, installation CUDNN

Download: https://developer.nvidia.com/rdp/cudnn-archive
version (be sure to press the figure version, other versions not tested, not guaranteed) that 7.0.5, downloaded named: cudnn -9.0-linux-x64-v7.tgz
Here Insert Picture Description

Published 141 original articles · won praise 131 · views 210 000 +

Guess you like

Origin blog.csdn.net/qq_41621362/article/details/88000156