Last active
October 20, 2020 03:33
-
-
Save seominjoon/1f461cdd8e17c2a236c9 to your computer and use it in GitHub Desktop.
Installing torch with GPU enabled on AWS EC2 (g2 instance) Ubuntu 14.04.
This file contains 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
# install torch on ec2 g2 instance | |
# installing torch | |
curl -s https://raw.githubusercontent.com/torch/ezinstall/master/install-deps | bash # prereqs | |
git clone https://github.com/torch/distro.git ~/torch --recursive | |
cd ~/torch; ./install.sh | |
source ~/.bashrc | |
# confirm torch is installed | |
th | |
# update linux headers | |
# for some reason, if these are not installed, then Nvidia drivers will not work | |
sudo apt-get update | |
sudo apt-get install -y linux-source linux-image-extra-`uname -r` linux-headers-`uname -r` linux-image-`uname -r` | |
# install nvidia driver and CUDA | |
sudo apt-get install -y cuda | |
# check if you have gpu (or 4 gpus) working: | |
nvidia-smi -l | |
lsmod | grep -i nvidia | |
# obtain cudnn. For torch, you need v3 (v4 doesn't work). | |
# Note that these are not public; you have to register and download them yourself (takes 1-2 days) | |
wget https://YOUR_URL/cudnn-7.0-linux-x64-v3.0-prod.tgz | |
tar -zxvf cudnn-7.0-linux-x64-v3.0-prod.tgz | |
# move the files to /usr/local/cuda | |
# Install all different packages | |
sudo apt-get install -y libprotobuf-dev # needed for loadcaffe | |
luarocks install cutorch # CUDA support for torch | |
luarocks install cunn # CUDA neural net? | |
luarocks install hdf5 # for processing .h5 files. | |
luarocks install cudnn # cudnn support for torch | |
luarocks install loadcaffe | |
# and other stuff.. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment