This took me quite a while to get just right but here is what I did
Download Ubuntu 16.04 .iso
Download unetbootin
Boot from drive to install ubuntu use 3rd parter drivers to avoid wireless issues
Download the driver for the NVIDIA 1070 card 367.27
Hit ctrl-alt-f1 to open a virtual terminal
sudo service lightdm stop
cd ~/Downloads
sudo chmod 755 "name of driver".run
sudo ./"name of driver".run
cd
reboot
Download CUDA 8.0 and patch 1
Hit ctrl-alt-f1 to open a virtual terminal
sudo service lightdm stop
cd ~/Downloads
sudo chmod 755 "name of CUDA installer".run
sudo ./"name of CUDA installer".run --override
*Do not install the driver since we already did
sudo chmod 755 "name of CUDA installer".run
sudo ./"name of CUDA installer".run --override
sudo chmod 755 "name of CUDA patch".run
sudo ./"name of CUDA patch".run
cd
reboot
Download cuDNN 5.1
cd ~/Downoads
tar xvzf cudnn-8.0-linux-x64-v5.1.tgz
sudo cp cuda/include/cudnn.h /usr/local/cuda-8.0/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda-8.0/lib64
sudo chmod a+r /usr/local/cuda-8.0/include/cudnn.h /usr/local/cuda-8.0/lib64/libcudnn*
Run and add the following to bash file
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda-8.0/lib64:/usr/local/cuda-8.0/extras/CUPTI/lib64"
export CUDA_HOME=/usr/local/cuda-8.0
sudo apt-get install python-pip python-dev
sudo apt-get install git
$ git clone https://github.com/tensorflow/tensorflow
sudo apt-get install openjdk-8-jdk
sudo apt-get install pkg-config zip g++ zlib1g-dev unzip
Download bazel-0.3.1 for linux
chmod +x bazel-version-installer-os.sh
./bazel-version-installer-os.sh --user
sudo apt-get install python-numpy swig python-dev python-wheel
cd ~/tensorflow
./configure
use CUDA 8.0 and cudnn 5.1.5
bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer
bazel-bin/tensorflow/cc/tutorials_example_trainer --use_gpu
bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
sudo pip install /tmp/tensorflow_pkg/tensorflow-0.10.0rc0-py2-none-any.whl
cd tensorflow/models/image/mnist
python convolutional.py