Ubuntu 16.04 under Install TensorFlow (GPU)

Source: Internet
Author: User
Tags git clone

Reference: http://blog.sina.com.cn/s/blog_672f698e0102wavp.html

1. First install the NVIDIA graphics driver:

Add-on driver, software update, system settings, select Nvidia latest drivers (361), application changes

? 2. Download CUDA8.0 address https://developer.nvidia.com/cuda-release-candidate-download (login required)

3. Installing Cuda

sudo dpkg-i cuda-repo-ubuntu1604-8-0-rc_8.0.27-1_amd64? Deb

sudo apt-get update

sudo apt-get install Cuda?

4. Download the CUDNN, preferably the V4 version address HTTPS:DEVELOPER.NVIDIA.COM/CUDNN

5. Copy the CUDNN decompression to Cuda

tar xvzfCudnn-7.0-linux-x64-v4.0-prod.tgz

sudo cp cuda/include/cudnn.h /usr/local/cuda/include 

sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64 

sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*??

6. Installing TensorFlow from the source code

git clone https://github.com/tensorflow/tensorflow?

Go to TensorFlow root directory (under Home) run./configure Configuration TensorFlow

7. Install Bazel (preferably installed again, the second method, otherwise need FQ)

http://www.bazel.io/docs/install.html?

Install other dependencies

sudo apt-get install python-numpy swig python-dev python-wheel??

8. Build GPU Support (this is a compile-time hint that the GCC version is too high to downgrade http://www.cnblogs.com/alan215m/p/5906139.html)

bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer? If an error occurs, add--verbose_failures to run the following

bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer? --verbose_failures

Run after completion

?bazel-bin/tensorflow/cc/tutorials_example_trainer --use_gpu ?

This program calculates the main eigenvalue output of a 2*2 matrix as follows

To create a PIP installation package

Bazel build-c opt--config=cuda//tensorflow/tools/pip_package:build_pip_package?

--config=cuda indicates support for GPU

Bazel-bin/tensorflow/tools/pip_package/build_pip_package/tmp/tensorflow_pkg?

sudo pip INSTALL/TMP/TENSORFLOW_PKG/TENSORFLOW-0.9.0-PY2-NONE-ANY.WHL

OK, finish the call? ?

Ubuntu 16.04 under Install TensorFlow (GPU)

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.