#install NVIDIA driver for 16.04.4 LTS
sudo apt-get install nvidia-384 nvidia-modprobe
# reboot and enter BIOS to distable BOOT
#install CUDA 9.0
cd
wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run
cd
chmod +x cuda_9.0.176_384.81_linux-run
./cuda_9.0.176_384.81_linux-run --extract=$HOME
#execute installation
sudo ./cuda-linux.9.0.176-22781540.run
#verify CUDA installation
sudo ./cuda-samples.9.0.176-22781540-linux.run
sudo bash -c "echo /usr/local/cuda/lib64/ > /etc/ld.so.conf.d/cuda.conf"
sudo ldconfig
#add PATH
echo "export PATH=/usr/local/cuda-9.0/bin:$PATH" >> ~/.bashrc
echo "export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64:$LD_LIBRARY_PATH" >> ~/.bashrc
#verify your installation
cd /usr/local/cuda-9.0/samples
sudo make
cd /usr/local/cuda/samples/bin/x86_64/linux/release
./deviceQuery
#download "cuDNN v7.0.5 Library for Linux" tgz
sudo mv cudnn-9.0-linux-x64-v7.tgz /usr/local
cd /usr/local
sudo tar -xvzf cudnn-9.0-linux-x64-v7.tgz
sudo ldconfig
sudo updatedb
sudo rm cudnn-9.0-linux-x64-v7.tgz
install Miniconda
sudo ./Miniconda3-latest-Linux-x86_64.sh
conda env create -f environment-gpu.yml
source activate carnd-term1
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow-gpu
reference
Main reference
https://gist.github.com/zhanwenchen/e520767a409325d9961072f666815bb8
https://gist.github.com/wangruohui/df039f0dc434d6486f5d4d098aa52d07
NVIDIA cuda and cudnn installation
https://docs.nvidia.com/deeplearning/sdk/cudnn-install/
shell for quick installation
https://gist.github.com/benkant/8e67fd85927553ca5ab2fe5a28555a47
install tensorflow on ubuntu
https://www.tensorflow.org/install/install_linux
https://www.tensorflow.org/versions/master/install/install_linux#NVIDIARequirements
can’t import requests
https://stackoverflow.com/questions/17309288/importerror-no-module-named-requests