Skip to content

Instantly share code, notes, and snippets.

@DarylWM
Last active November 18, 2016 05:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DarylWM/b1b254f2d37c3789302bbe6ecb4b20be to your computer and use it in GitHub Desktop.
Save DarylWM/b1b254f2d37c3789302bbe6ecb4b20be to your computer and use it in GitHub Desktop.
Steps to set up a Deep Learning machine

Create a 16.04 bootable install USB drive

http://unetbootin.github.io/

Install Ubuntu 16.04

  • sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
  • sudo apt-get install make cmake gcc g++

Install NVIDIA drivers

  • sudo apt-get install dkms build-essential linux-headers-generic

Create the following file /etc/modprobe.d/blacklist-nouveau.conf and add the following lines:

  • blacklist nouveau
  • blacklist lbm-nouveau
  • options nouveau modeset=0
  • alias nouveau off
  • alias lbm-nouveau off

Disable the Kernel nouveau by typing the following commands:

  • echo options nouveau modeset=0 | sudo tee -a /etc/modprobe.d/nouveau-kms.conf
  • sudo update-initramfs -u

Disable the desktop by running the following command:

  • ctrl-alt-f1

  • sudo add-apt-repository ppa:graphics-drivers/ppa

  • sudo apt-get update

  • sudo apt-get install nvidia-367

Install SSH

  • sudo apt-get install openssh-server

Turn off secure boot in the BIOS setup

  • Advanced Mode | Security | Boot/Secure Boot | OS Type = Other OS

Install CUDA

Install cuDNN

  • Download from https://developer.nvidia.com/cudnn
  • Choose latest for CUDA 8.0, “Library for Linux"
  • Untar it with -zxf
  • cd cuda
  • sudo cp lib64/* /usr/local/cuda/lib64/
  • sudo cp include/* /usr/local/cuda/include/

Install NCCL

Clone and install NVIDIA nccl

  • git clone https://github.com/NVIDIA/nccl.git
  • cd nccl
  • make CUDA_HOME=/usr/local/cuda test
  • sudo make PREFIX=/usr/local install Add the following to your ~/.profile file
  • export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
  • export NCCL_INCLUDE_DIR=~/nccl/include
  • export NCCL_LIBRARY=~/nccl/lib
  • sudo cp ~/nccl/build/include/nccl.h /usr/include

Install Caffe

  • https://github.com/NVIDIA/DIGITS/blob/digits-4.0/docs/BuildCaffe.md
  • cp Makefile.config.example Makefile.config
  • Uncomment the USE_CUDNN := 1 line from Makefile.config
  • cmake -DUSE_NCCL=ON -DNCCL_ROOT_DIR=~/nccl/build .. (necessary to use parameters because of a bug in NCCL detection)
  • Note: should be able to find cuDNN and NCCL.
  • make all -j8
  • make runtest (to make sure it all worked)
  • Add 'export CAFFE_HOME=~/caffe' to .profile

Install DIGITS

  • sudo pip install —upgrade pip
  • sudo pip install bs4
  • sudo pip install mock
  • Take the most recent tagged release (e.g. "v5.1-dev")
  • https://github.com/NVIDIA/DIGITS/blob/digits-4.0/docs/BuildDigits.md
  • Test that it’s OK by:
  • sudo pip install -e .
  • sudo pip install -e plugins/data/imageGradients
  • sudo pip install -e plugins/view/imageGradients
  • ./digits-test

Running

  • cd ~/digits
  • ./digits-devserver

Monitoring

  • watch -n1 nvidia-smi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment