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 xvzf
Cudnn-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)