本配置主要参考Tensorflow官方文档https://www.tensorflow.org/install/
一、CUDA安装
CUDA安装主要参考Nvidia官方文档http://docs.nvidia.com/cuda/cuda-installation-guide-linux/#axzz4VZnqTJ2A
注意查看各个版本版本是否符合兼容,如果不符合请upgrade。(http://docs.nvidia.com/cuda/cuda-installation-guide-linux/#verify-you-have-cuda-enabled-system)
1.官网下载cuda本地安装包https://developer.nvidia.com/cuda-downloads
2.
sudo dpkg -i cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64.deb
sudo apt-get update
sudo apt-get install cuda
cat /var/lib/apt/lists/*cuda*Packages | grep “Package:”
二、cuDNN安装
注意需要注册一个账号,然后下载相应版本的cuDNNhttps://developer.nvidia.com/cudnn
请参考参考博客:
三、Tensorflow源码安装
1.安装brazel
#添加distribution package source
echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
curl https://bazel.build/bazel-release.pub.gpg | sudo apt-key add -
#安装bazel
sudo apt-get update && sudo apt-get install bazel
sudo apt-get upgrade bazel
2.安装git
3.下载源码
git clone https://github.com/tensorflow/tensorflow
4、确定安装版本
cd tensorflow
git checkout r1.0
6、安装python3 package
sudo apt-get install python3-numpy python3-dev python3-pip python3-wheel
7、编译tensorflow
bazel build –config=opt –config=cuda //tensorflow/tools/pip_package:build_pip_package
8、安装
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
sudo pip install /tmp/tensorflow_pkg/tensorflow-0.10.0-py2-none-any.whl