Skip to content

Commit

Permalink
deeplearningparis#21 - Various deep learning packages install issues …
Browse files Browse the repository at this point in the history
…- fixed a few more:

 - Install caffe from nvidia packages.
 - Fix circus.conf and update-instance.conf to the correct user (mine is vagrant not ubuntu for instance).  Now circus service starts.
  • Loading branch information
Amir Gur authored and Amir Gur committed Mar 9, 2016
1 parent e8fa0b7 commit 8e5e7f7
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions scripts/install-deeplearning-libraries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ if [ ! -d "OpenBLAS" ]; then
&& sudo make install PREFIX=$OPENBLAS_ROOT)
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> ~/.bashrc
fi
# https://hunseblog.wordpress.com/2014/09/15/installing-numpy-and-openblas/
# Suggested adding this, keeping commented for now, not yet sure is needed
# given the already done export LD_LIBRARY_PATH
#grep -q opt/OpenBLAS /etc/ld.so.conf.d/openblas.conf ||
# sudo su - -c"echo $OPENBLAS_ROOT/lib >> /etc/ld.so.conf.d/openblas.conf"
sudo ldconfig

# Python basics: update pip and setup a virtualenv to avoid mixing packages
Expand Down Expand Up @@ -94,7 +99,7 @@ if [ ! -d "keras" ]; then
(cd keras && python setup.py install)
else
if [ "$1" == "reset" ]; then
(cd keras && git reset --hard && git checkout master && git pull --rebase $REMOTE master && python setup.py install)
(cd keras && git reset --hard && git checkout master && git pull --rebase $REMOTE master && python setup.py install)
fi
fi

Expand Down Expand Up @@ -129,18 +134,30 @@ sudo apt-get install -y protobuf-compiler libboost-all-dev libgflags-dev libgoog

if [ ! -d "caffe" ]; then
git clone https://github.com/BVLC/caffe.git
(cd caffe && cp $HOME/dl-machine/caffe-Makefile.conf Makefile.conf && cmake -DBLAS=open . && make all)
# For CPU only can use: cat $HOME/dl-machine/caffe-Makefile.conf | sed -e 's/# CPU_ONLY/CPU_ONLY/' > Makefile.conf && \
(cd caffe && \
cp $HOME/dl-machine/caffe-Makefile.conf Makefile.conf && \
cmake -DBLAS=open . && make all)
(cd caffe/python && pip install -r requirements.txt)
else
if [ "$1" == "reset" ]; then
(cd caffe && git reset --hard && git checkout master && git pull --rebase origin master && cp $HOME/dl-machine/caffe-Makefile.conf Makefile.conf && cmake -DBLAS=open . && make all)
fi
fi

# Install Caffe from nvidia packages
# https://github.com/NVIDIA/DIGITS/blob/master/docs/UbuntuInstall.md#repository-access
CUDA_REPO_PKG=cuda-repo-ubuntu1404_7.5-18_amd64.deb &&
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/$CUDA_REPO_PKG &&
sudo dpkg -i $CUDA_REPO_PKG
ML_REPO_PKG=nvidia-machine-learning-repo_4.0-2_amd64.deb &&
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1404/x86_64/$ML_REPO_PKG &&
sudo dpkg -i $ML_REPO_PKG
sudo apt-get install -y caffe-nv python-caffe-nv

# Register the circus daemon with Upstart
if [ ! -f "/etc/init/circus.conf" ]; then
sudo ln -s $HOME/dl-machine/circus.conf /etc/init/circus.conf
sed -e"s/ubuntu/$USER/g" ~/dl-machine/circus.conf | sudo bash -c 'cat - > /etc/init/circus.conf'
sudo initctl reload-configuration
fi
# TODO: resolve issue: "start: Job failed to start"
Expand All @@ -150,5 +167,5 @@ sudo service circus restart
# Register a task job to get the main repo of the image automatically up to date
# at boot time
if [ ! -f "/etc/init/update-instance.conf" ]; then
sudo ln -s $HOME/dl-machine/update-instance.conf /etc/init/update-instance.conf
sed -e"s/ubuntu/$USER/g" ~/dl-machine/update-instance.conf | sudo bash -c 'cat - > /etc/init/update-instance.conf'
fi

0 comments on commit 8e5e7f7

Please sign in to comment.