Skip to content

Instantly share code, notes, and snippets.

@hazelybell
Forked from awwong1/gpu_setup.md
Last active April 10, 2019 21:14
Show Gist options
  • Save hazelybell/5e1510c526ed9c86d136f52f3adc7bab to your computer and use it in GitHub Desktop.
Save hazelybell/5e1510c526ed9c86d136f52f3adc7bab to your computer and use it in GitHub Desktop.
Calzone Deep Learning Setup

Calzone Deep Learning Setup

  • Ubuntu 18.10
  • NVIDIA Titan X
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.10
Release:        18.10
Codename:       cosmic

$ lspci -vnn | grep VGA
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP104 [GeForce GTX 1080] [10de:1b80] (rev a1) (prog-if 00 [VGA controller])
02:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP102 [TITAN X] [10de:1b00] (rev a1) (prog-if 00 [VGA controller])

Install Steps

  1. Install nvidia driver (latest)
sudo add-apt-repository ppa:graphics-drivers/ppa
ubuntu-drivers autoinstall
  1. Install CUDA (ver 10.0.130)
$ wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
$ sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
$ sudo dpkg -i cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
$ sudo apt update
$ sudo apt install cuda-10-0
  1. Install cuDNN (7.5.0 for CUDA 10.0) https://developer.nvidia.com/rdp/cudnn-download
$ dpkg -i libcudnn7_7.5.0.56-1+cuda10.0_amd64.deb
$ dpkg -i libcudnn7-dev_7.5.0.56-1+cuda10.0_amd64.deb
$ dpkg -i libcudnn7-doc_7.5.0.56-1+cuda10.0_amd64.deb
  1. Install OpenBLAS
$ aptitude install libopenblas-dev
  1. Install Bazel https://github.com/bazelbuild/bazel/releases
  • Select 0.21.0 for tensorflow r1.13 or latest for master
$ https://github.com/bazelbuild/bazel/releases/download/0.21.0/bazel_0.21.0-linux-x86_64.deb
$ dpkg -i bazel_0.21.0-linux-x86_64.deb
  1. Install Tensorflow
$ git clone https://github.com/tensorflow/tensorflow.git
$ cd tensorflow
$ git checkout r1.13
$ python3 -m virtualenv venv -p python3
$ source venv/bin/activate
$ pip install six mock numpy keras_applications keras_preprocessing
  • Configuration
    • When prompted for CUDA support: Y
    • When prompted for gcc: /usr/bin/gcc-7
$ ./configure
  • Build
$ bazel build --config=opt --config=cuda --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0" //tensorflow/tools/pip_package:build_pip_package
  • Wait several hours
  • If using r1.13:
$ ./bazel-bin/tensorflow/tools/pip_package/build_pip_package ~
  • If using master:
$ ./bazel-bin/tensorflow/tools/pip_package/build_pip_package --nightly_flag ~
  • Cleanup
$ rm -rvf ~/.cache/bazel
$ git clean -df
$ rm bazel-bin bazel-genfiles bazel-out bazel-tensorflow bazel-testlogs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment