Installation CUDA8.0 and driven Ubuntu nvidia

Reference: https: //blog.csdn.net/qq_35379989/article/details/80147630

 

cuda historical version Download: https: //developer.nvidia.com/cuda-toolkit-archive

1. The choice of the drive system is installed nvidia

Why is it on the system, this is because after several attempts found that if ubuntu14 install the graphics driver will not enter the system, has been in the login screen, and ubuntu16 the problem does not appear in the loop, so that the best upgrade about it, after all, a little 14 too old.

The important point is not to install or upgrade the kernel after installation, otherwise it is not recognized cuda kernel caused installation to fail! (If you have already upgraded and cuda error, then Baidu or Google about how the kernel drop it)

Some rely on it to install, the next may be used to

 

sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler
sudo apt-get install --no-install-recommends libboost-all-dev
sudo apt-get install libopenblas-dev liblapack-dev libatlas-base-dev
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev
sudo apt-get install git cmake build-essential
 

Use the following instructions to install your nvidia driver (ubntun14 will not enter the system)

 

APT-GET Update sudo
sudo nvidia install APT-GET-367
is installed after the restart, according to super (windows) key, in your program, you can see search nvidia

 

Means that you have successfully installed the graphics driver

 

2. Download cuda8.0 (Here it must be cuda8, ​​version suited to the appeal of the behind NVIDIA drivers)

Download from here https://developer.nvidia.com/cuda-downloads

 

Download out of more than 1G like that, good will download the file to cut down on your home, right-click the file, click Properties, open figure, select the permissions, check the implementation of

 

3. Install CUDA8.0

Configuring the environment variable

 

sudo gedit ~ / .bashrc
added two lines:

export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH

export LD_LIBRARY_PATH=/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH

Then, you can start the installation

~ cd
sudo SH cuda_8.0.61_375.26_linux.run
then see (as I enter it below)

Do you accept the previously read EULA?

accept/decline/quit: accept

Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 361.62?

(Y) es / (n) o / (q) shipped n

Install the CUDA 8.0 Toolkit?

(Y) is / (n) o / (q) uit: and

Enter Toolkit Location
[ default is /usr/local/cuda-8.0 ]: 回车

Do you want to install a symbolic link at /usr/local/cuda?
(y)es/(n)o/(q)uit: y

Install the CUDA 8.0 Samples?

(Y) is / (n) o / (q) uit: and

Enter CUDA Samples Location
[ default is /root ]:回车

Next comes

Installing the CUDA Toolkit in /usr/local/cuda-8.0 …
Installing the CUDA Samples in /root …
Copying samples to /home/derek/NVIDIA_CUDA-8.0_Samples now…
Finished copying samples.

= Summary =

Driver: Installed
Toolkit: Installed in /usr/local/cuda-8.0
Samples: Installed in /home/derek

Please make sure that
– PATH includes /usr/local/cuda-8.0/bin
– LD_LIBRARY_PATH includes /usr/local/cuda-8.0/lib64, or, add /usr/local/cuda-8.0/lib64 to /etc/ld.so.conf and run ldconfig as root

To uninstall the CUDA Toolkit, run the uninstall script in /usr/local/cuda-8.0/bin

Please see CUDA_Installation_Guide_Linux.pdf in /usr/local/cuda-8.0/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 361.00 is required for CUDA 8.0 functionality to work.

To install the driver using this installer, run the following command, replacing with the name of this run filesudo.run -silent -driver

This has been installed, do not doubt is that simple, as long as no error on it, if kernel-related errors, it is usually because the kernel is too high, cuda not recognize, including cuda9 and so can not be later, they still find a way to drop it at the kernel

4. Edit Profile

sudo gedit ~ / .bash_profile
open configuration file, add the following lines

the LD_LIBRARY_PATH = Export "$ the LD_LIBRARY_PATH: /usr/local/cuda-8.0/lib64: /usr/local/cuda-8.0/extras/CUPTI/lib64"
Export CUDA_HOME = / usr / local / CUDA-8.0
may be in .bashrc configuration

sudo gedit ~ / .bashrc
added two lines

export PATH=/usr/local/cuda-8.0/bin:$PATH

export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH

source ~ / .bashrc
and then set environment variables and dynamic link library, at the command line:

sudo gedit / etc / profile
is added at the end of open files:

the PATH = Export / usr / local / CUDA / bin: $ the PATH
Export LD_LIBRARY_PATH = / usr / local / CUDA-8.0 / lib64 $ LD_LIBRARY_PATH
save after, to create a link file:

sudo gedit /etc/ld.so.conf.d/cuda.conf
you add the following statement in open file:

/ usr / local / cuda / lib64
and do:

sudo ldconfig
Now you can verify whether the installation was successful strategy cuda

/usr/local/cuda-8.0/samples/1_Utilities/deviceQuery cd
sudo the make
./deviceQuery
----------------
Disclaimer: This article is the original article CSDN bloggers "qq_35379989" of follow CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
Original link: https: //blog.csdn.net/qq_35379989/article/details/80147630

Guess you like

Origin www.cnblogs.com/xiaochouk/p/12081276.html