天天看點

Install GPU TensorFlow From Sources w/ Ubuntu 16.04 and Cuda 8.0

Open a terminal by pressing Ctrl + Alt + T

Paste each line one at a time (without the $) using Shift + Ctrl + V

You must also have the 367 (or later) NVidia drivers installed, this can easily be done from Ubuntu’s built in additional drivers after you update your driver packages.

Once installed using additional drivers restart your computer.  If you experience any troubles booting linux or logging in: try disabling fast & safe boot in your bios and modifying your grub boot options to enable nomodeset.

Skip if not installing with GPU support

This will install cuda into: /usr/local/cuda

Then update your bash file:

Once you save and close the text file you can return to your original terminal and type this command to reload your .bashrc file:

Clone TensorFlow

Use defaults by pressing enter for all except:

Please specify the location of python. [Default is /usr/bin/python]:

For Python 2 use default or If you wish to build for Python 3 enter:

Please input the desired Python library path to use. Default is [/usr/local/lib/python2.7/dist-packages]:

Unless you have a Radeon graphic card you can say no to OpenCL support. (has anyone tested this? ping me if so!)

Please specify the Cuda SDK version you want to use, e.g. 7.0. [Leave empty to use system default]:

Please specify the Cudnn version you want to use. [Leave empty to use system default]:

If all was done correctly you should see:

INFO: All external dependencies fetched successfully.

Configuration finished

Warning Resource Intensive I recommend having at least 8GB of computer memory.

If you want to build TensorFlow with GPU support enter:

For CPU only enter:

This will build the pip package required for installing TensorFlow in your /tmp/ folder

To Install Using Python 3 (remove sudo if using a virtualenv)

For Python 2 (remove sudo if using a virtualenv)

Close all your terminals and open a new terminal to test.

There you have it, you should now have TensorFlow installed on your computer. This tutorial was tested on a fresh install of Ubuntu 16.04 with a GeForce GTX 780 and a GTX 970m.

<a href="https://alliseesolutions.wordpress.com/2016/09/08/install-gpu-tensorflow-from-sources-w-ubuntu-16-04-and-cuda-8-0-rc/" target="_blank">https://alliseesolutions.wordpress.com/2016/09/08/install-gpu-tensorflow-from-sources-w-ubuntu-16-04-and-cuda-8-0-rc/</a>

本文轉自 stock0991 51CTO部落格,原文連結:http://blog.51cto.com/qing0991/1890536