Skip to content

Installing Dadabots SampleRNN on Ubuntu

CJ Carr edited this page Aug 6, 2018 · 2 revisions
# fresh install of ubuntu16.04, NVIDIA Tesla V100 GPU
# on Google Cloud Platform
# This should also work on AWS, etc, with slight modifications

# apt-get
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install build-essential checkinstall -y
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libglu1-mesa libxi-dev libxmu-dev -y
sudo apt-get install tmux ncdu -y

# nvidia driver (look up the latest version on nvidia website)
# todo: figure out how to -y 
wget http://us.download.nvidia.com/tesla/396.26/NVIDIA-Linux-x86_64-396.26-diagnostic.run
sudo chmod +x NVIDIA-Linux-x86_64-396.26-diagnostic.run --silent
sudo ./NVIDIA-Linux-x86_64-396.26-diagnostic.run

# cuda 9.2 (look up the latest version on nvidia website)
wget https://developer.nvidia.com/compute/cuda/9.2/Prod/local_installers/cuda-repo-ubuntu1604-9-2-local_9.2.88-1_amd64
sudo dpkg -i cuda-repo-ubuntu1604-9-2-local_9.2.88-1_amd64
sudo apt-key add /var/cuda-repo-9-2-local/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda -y

# cuda 9.2 patch1
wget https://developer.nvidia.com/compute/cuda/9.2/Prod/patches/1/cuda_9.2.88.1_linux
sudo chmod +x cuda_9.2.88.1_linux
sudo ./cuda_9.2.88.1_linux

# environment variables
cat <<EOT >> ~/.bashrc
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda-9.2/lib64"
export CUDA_HOME=/usr/local/cuda
export PATH=/usr/local/cuda/bin:/usr/local/cuda-9.2/bin:$PATH
EOT
source .bashrc

# test
nvcc --version

# cudnn
# nvidia doesn’t like you getting the file with wget, this file needs to be hosted somewhere else
# download from https://developer.nvidia.com/cudnn
wget https://developer.nvidia.com/compute/machine-learning/cudnn/secure/v7.1.4/prod/9.2_20180516/cudnn-9.2-linux-x64-v7.1

tar -xzvf cudnn-9.2-linux-x64-v7.1.tgz
sudo cp cuda/lib64/* /usr/local/cuda/lib64/
sudo cp cuda/include/cudnn.h /usr/local/cuda/include/

sudo apt-get install nvidia-cuda-toolkit -y

# anaconda python
# figure out how to -y 
wget https://repo.continuum.io/archive/Anaconda2-5.0.0-Linux-x86_64.sh
bash Anaconda2-5.0.0-Linux-x86_64.sh
source .bashrc

sudo apt-get install python-pip python-nose g++ libopenblas-dev git -y

## need to add /home/cj/anaconda3/bin to bashrc for pip to work

# theano 1.0
# https://github.com/Theano/Theano/wiki/Converting-to-the-new-gpu-back-end%28gpuarray%29
conda install -c mila-udem -c mila-udem/label/pre theano pygpu

# lasagne 
sudo pip install -r https://raw.githubusercontent.com/Lasagne/Lasagne/master/requirements.txt
sudo pip install https://github.com/Lasagne/Lasagne/archive/master.zip 

# sampleRNN
git clone https://github.com/Cortexelus/dadabots_sampleRNN

#ffmpeg
sudo apt-get install libav-tools

# apache
# (my user is cj, change to your user)
sudo apt-get install apache2 -y
cd /var/www/html
sudo ln -s /home/cj/dadabots_sampleRNN dadabots_sampleRNN
sudo chmod o+x /home/cj
sudo chmod o+x /home/cj/dadabots_sampleRNN
sudo rm index.html


# sndfile / audiolab 
# this fucks up
sudo apt-get install libsndfile1 libsndfile1-dev -y
sudo apt-get install linux-sound-base alsa-base alsa-utils -y
sudo apt-get install alsa alsa-tools -y

locate libsndfile.so
ln -s /usr/lib/x86_64-linux-gnu/libsndfile.so /usr/local/lib/libsndfile.so
pip install --upgrade pip
sudo pip install scikits.audiolab

sudo ln -sf /usr/lib/x86_64-linux-gnu/libGL.so.1 /usr/lib/libGL.so.1

conda install pygpu

This documentation is licensed CC-BY 4.0

Clone this wiki locally