Closed gngdb closed 9 years ago
Instructions written by Kez on getting an Amazon EC2 GPU instance up and running for a pylearn2 model. Some of libraries and environment variables dependencies will be a bit different here
follow this setup bash script to configure the environment
chmod 400 first.pem
ssh -v -i first.pem ubuntu@public_dsn # copypaste public_dsn from AWS EC2 console
sudo apt-get update
sudo apt-get -y dist-upgrade
sudo apt-get install -y gcc g++ gfortran build-essential git wget linux-image-generic libopenblas-dev python-dev python-pip python-nose python-numpy python-scipy python-matplotlib
sudo pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git
sudo wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_6.5-14_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1404_6.5-14_amd64.deb
sudo apt-get update
sudo apt-get install -y cuda
echo -e "\nexport PATH=/usr/local/cuda-6.5/bin:$PATH\n\nexport LD_LIBRARY_PATH=/usr/local/cuda-6.5/lib64" >> ~/.bashrc
sudo ldconfig /usr/local/cuda-6.5/lib64 #more reliable: last answer of http://askubuntu.com/questions/210884/setting-ld-library-path-for-cuda
sudo reboot
chmod 400 first.pem
ssh -v -i first.pem ubuntu@publicdsn
cd /usr/local/cuda-6.5/samples/1_Utilities/deviceQuery
sudo make
./deviceQuery
echo -e "\n[global]\nfloatX=float32\ndevice=gpu\nmode=FAST_RUN\n\n[nvcc]\nfastmath=True\n\n[blas]ldflags=\n\n[cuda]\nroot=/usr/local/cuda-6.5" >> ~/.theanorc
cd ~
git clone git://github.com/lisa-lab/pylearn2.git
cd pylearn2
sudo python setup.py install
cd ~
sudo pip install pandas
echo "\nexport DATA_DIR=~/data\nexport EXPERIMENTS_DIR=~/experiments" >> ~/.bashrc
source ~/.bashrc
sudo -E python etc.py ...
source .bashrc
updates the environment in the current shell after editing
.bashrc file
Train a model with the Amazon cloud services and you get this achievement!