UBUNTU16.04+CUDA-8.0+CUDNN-V5.1+TENSORFLOW0.8-GPU/TENSORFLOW1.0-GPU Installation Tutorials

Source: Internet
Author: User
Tags gtx

Because of the project needs, our deep learning algorithm must be accelerated, so the group gave me two gpu:gtx-750 Ti & GRID-K2

GTX-750 Ti was I installed in the local, GRID-K2 installed on the server, need to SSH login to use, followed by a variety of pits ......... .....

First, let's talk about Grid-k2, server-side installation:

1. First, if you have only this card, sorry, you can not click here to see Cuda supported GPU here to find the information of this GPU, but, note however, this is not the case, because you can check that this GPU is specifically for VMware & Citrix companies such as virtual The computational power of the proposed product may be less than 3.0, so Nvidia does not feel the need to put it on the web, so the card is not suitable for deep learning operations, and there are also renderings that can be used to see comparisons.


2. Of course, if your group has only this grid K2 card, then of course, you can use, first, you have the next corresponding version of the driver driver download point here to remember, be sure to correspond to the version of the driver, such as this grid K2 card driver corresponds to the


3. Because I am here is the server, so you can find your downloaded Nvidia-linux-x86_64-375.26.run on the virtual machine (note this is your version information), of course, there is a pit here, there is said that the virtual machine has no way to install the GPU driver, Then I asked some people, as if the virtual machine of the local machine can not be used, the server virtual machine is available, at least I was successful. Next you can see if your GPU already has the original driver and can pass Lsmod | grep nouveau to view, if there is output information, it means that there is information inside, you can use the following command to disable the original driver:

1> mv/lib/modules/(press TAB twice, here is your kernel version)/kernel/drivers/gpu/drm/nouveau/nouveau.ko/lib/modules/(press TAB twice, Here is your version of kernel)/kernel/drivers/gpu/drm/nouveau/nouveau.kp.org

2>update-initramfs-u Reload

3> reboot Restart your computer

Then you re-enter Lsmod | grep nouveau, there should be no output, but it's not ready to finish the installation, you have to enter PS aux | grep Xorg to see if your GUI Linux is off, and if you see

There is only one output, what what color= is successful, if there are a lot of print, you can try the service LIGHTDM stop, then you can find the other xorg is gone, only the previous message, so far, you can continue to install.

Next is to find the location of the Linux file, input sudo bash nvidia-linux-x86_64-375.26.run, follow the steps to install, if the halfway stuck, you are still waiting, don't hand to stop.


4. The next installation of the driver should be able to enter the NVIDIA-SMI to see if the driver installation is complete, if the box information is displayed, the explanation is no problem

Shown above, if you do not have such a display, but that Nvidia-smi:command not found, can only indicate that you did not next to the version, the corresponding version, repeat the above steps.

5. Next is the installation of cuda-8.0, you can download the official website Cuda website, as shown below:


Download the local version.


6. Find the location to download the corresponding file, enter the sudo sh cuda_8.0.61._375.26_linux.run, remember that you have installed the driver, so elected whether to install the driver there select N, the rest by default Y, and never attempt to

Through the cuda inside the driver to install the drive, because Cuda can only under the latest version, Cuda is backwards compatible, but driver must correspond to the version, here we filled a big pit.


7. After the installation of Cuda is the environment configuration, remember, here to export two things, remember under Root, that is, sudo su

Then enter the following command

Export ld_library_path=/usr/local/cuda-8.0/lib64/:/usr/local/cuda/lib64: $LD _library_path Export PATH=/usr/local/ Cuda-8.0/bin:/usr/local/cuda/bin: $PATH

Re-enter Nano/etc/profile

To the last line, enter the following

Export ld_library_path=/usr/local/cuda-8.0/lib64/:/usr/local/cuda/lib64: $LD _library_path Export PATH=/usr/local/ Cuda-8.0/bin:/usr/local/cuda/bin: $PATH

Save exit

Re-enter

sudo ldconfig update configuration

Then restart reboot

8. Next Download Cudnn v5.1

Download it down is cudnn-8.0-linux-x64-v5.1

Find the download path, CD in, find this file, enter the following actions:

Tar xvzf cudnn-8.0-linux-x64-v5.1-prod.tgz sudo cp cuda/include/cudnn.h/usr/local/cuda/include sudo cp cuda/lib64/lib cudnn*/usr/local/cuda/lib64 Complete the above steps, CUDNN installation is complete.


9. Next, install the TensorFlow:

First download the TENSORFLOW-GPU version of the WHL file, you can go to this site to find the choice TensorFlow you need version of TensorFlow to python2.7/python3.4/pthon3.5/gpu/cpu/ /0.8 Version/1.0 version, found after the corresponding <key>......</key> content and the previous page together, a press ENTER can be downloaded, such as: https://storage.googleapis.com/ Tensorflow/+<key>......</key>.

Before you download it, make sure your Python is 3 or 2.7 versions.

First you enter Python3 in the command line, to see if you can enter the Python environment inside, if you can then input PIP3 install TensorFlow .... (Enter the WHL file of the tensorflow you just downloaded, it will be installed automatically), here I also encountered a pit, For example, you are installing python3.5 version, you want to install tensorflow0.8 version, but the internet can only down to, TENSORFLOW-0.8.0-CP34-CP34M-LINUX_X86_64.WHL, Then you have no way to install tensorflow0.8, when you do this:

Input MV Tensorflow-0.8.0-cp34-cp34m-linux_x86_64.whl TENSORFLOW-0.8.0-PY3-NONE-LINUX_X86_64.WHL, that is, change a name

So you can enter PIP3 install TENSORFLOW-0.8.0-PY3-NONE-LINUX_X86_64.WHL.

But this is the problem with version 0.8, because the 1.0 version is Cp35, there is no such problem.

In addition, I did not install Anaconda3, so I did not install these procedures.


10. After the installation is complete, you can try to have no success, command line input python3 (because my environment here is Python3)

>>> Import TensorFlow as TF

will appear:


Description half of the successful installation, try the input again

>>>a=tf.constant (20)

>>>SESS=TF. Session ()

>>>sess.run (A+a)

If you can output the results, the installation is successful. But please note that ..... There is a big problem here .... In fact TENSORFLOW0.8-GPU version does not support Cuda, so you want to use the GPU, you must use the TENSORFLOW1.0-GPU version, so install version 0.8 will appear Python3 free (): ... Remember, a mistake, said core dumped, here I also encounter pits, so please install tensorflow1.0, if you install is 0.8 version of, do not matter, you directly installed 1.0, will automatically cover your 0.8 version, there is no above the problem.


Here, the installation is complete and you can run your program.


Two. Gtx-750-ti

Next is the card, do not underestimate this card, the effect of the card above the calculation performance is much higher, of course, the price is 10 times times cheaper.

The installation of this card can basically refer to the above steps, the only difference is two points

1. This card local physical machine can take the move, then there is no concept of virtual machine, I directly put this machine installed a ubuntu16.04.

2. The driver of this card must be restarted, can not use the driver of a card, otherwise it will be confused, should be renewed under the corresponding version of the card, or the driver download point here, find the corresponding GeForce download.


Click Search to find the appropriate version of the driver download, and then the steps are exactly the same as above until the installation is successful.





Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.