Last active
December 12, 2017 07:58
-
-
Save piiswrong/87ef716a421f0405e5d09415e54fe8cd to your computer and use it in GitHub Desktop.
install mxnet on ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
# install cuda-7.5 | |
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_7.5-18_amd64.deb | |
sudo dpkg -i cuda-repo-ubuntu1404_7.5-18_amd64.deb | |
sudo apt-get update | |
sudo apt-get install -y linux-image-extra-`uname -r` linux-headers-`uname -r` linux-image-`uname -r` | |
sudo apt-get install -y cuda-7-5 | |
echo "export LD_LIBRARY_PATH=/usr/local/cuda/lib64/:\$LD_LIBRARY_PATH" | tee -a ~/.profile | tee -a ~/.bashrc | |
# install cudnn5 | |
echo "deb http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1404/x86_64 /" | sudo tee --append /etc/apt/sources.list.d/nvidia-ml.list | |
sudo apt-get update | |
sudo apt-get install -y --force-yes --no-install-recommends libcudnn5-dev=5.1.3-1+cuda7.5 | |
# install dependencies | |
sudo apt-get update | |
sudo apt-get install -y build-essential libatlas-base-dev libopencv-dev git unzip | |
# build | |
cd ~ | |
git clone https://github.com/dmlc/mxnet.git --recursive | |
cd mxnet | |
cp make/config.mk . | |
echo 'USE_CUDA=1' >> config.mk | |
echo 'USE_CUDA_PATH=/usr/local/cuda' >> config.mk | |
echo 'USE_CUDNN=1' >> config.mk | |
echo 'USE_MKL2017=1' >> config.mk | |
echo 'USE_MKL2017_EXPERIMENTAL=1' >> config.mk | |
echo 'USE_DIST_KVSTORE=1' >> config.mk | |
make -j$(nproc) | |
echo "export PYTHONPATH=~/mxnet/python:\$PYTHONPATH" >> ~/.bashrc | |
echo "export LD_LIBRARY_PATH=~/mxnet/mklml_lnx_2017.0.1.20161005/lib:\$LD_LIBRARY_PATH" >> ~/.bashrc | |
# python and jupyter | |
sudo apt-get install -y python-pip python-dev python-numpy python-opencv graphviz python-scipy python-sklearn python-nose | |
sudo pip install jupyter graphviz pandas bokeh | |
jupyter notebook --generate-config | |
source ~/.bashrc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment