I am Charmie

メモとログ

tensorflow-gpu 1.4.0 + keras 2.1.1 on Ubuntu 16.04

Tensorflow 1.4.0 binary with CUDA 8 and cuDNN 6 Tensorflow 1.5.0 binary will be with CUDA 9 and cuDNN 7

The following procedure assumes that you use anaconda for python package manager.

  1. prepare for driver install
    1. Delete installed drivers by sudo apt purge nvidia*
    2. Press ctrl + alt + F1 and Login
    3. Stop X server by sudo service lightdm stop
    4. Disable the Nouveau kernel driver by creating a new file /etc/modprobe.d/blacklist-nouveau.conf
    5. The file contents is as follows blacklist nouveau blacklist lbm-nouveau options nouveau modeset=0 alias nouveau off alias lbm-nouveau off
    6. Then, create another file by echo options nouveau modeset=0 | sudo tee -a /etc/modprobe.d/nouveau-kms.conf
    7. Update by sudo update-initramfs -u
    8. Then reboot by sudo reboot
  2. install driver
    1. Download the driver installer from here, say NVIDIA-***.run.
    2. Change the permission by sudo chmod +x NVIDIA-***.run
    3. Execute the installer by sudo ./NVIDIA-***.run
    4. Let's confirm the installation by nvidia-smi
  3. install CUDA toolkit
    1. Download the toolkit installer from here, say cuda_***.run.
    2. Change the permission by sudo chmod +x cuda_***.run
    3. Install the toolkit by sudo ./cuda_***.run --toolkit --silent
    4. Install the samples by sudo ./cuda_***.run --samples --silent
    5. Add the following lines to the .bashrc export PATH="$PATH:/usr/local/cuda/bin" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64" export CUDA_HOME=/usr/local/cuda
    6. Update by source ~/.bashrc
  4. install cuDNN
    1. Download packed file from here, say cudnn-***.tgz
    2. Untar the file by tar -xzvf cudnn-***.tgz
    3. Copy header and lib files by
      1. sudo cp cuda/lib64/* /usr/local/cuda/lib64/
      2. sudo cp cuda/include/cudnn.h /usr/local/cuda/include/
     
  5. install Tensorflow
    1. install by pip install tensorflow-gpu
  6. install Keras
    1. install by pip install keras