Skip to content

Instantly share code, notes, and snippets.

@IAmSuyogJadhav
Created July 24, 2020 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IAmSuyogJadhav/a69cc937982907812e506f7cd0aff565 to your computer and use it in GitHub Desktop.
Save IAmSuyogJadhav/a69cc937982907812e506f7cd0aff565 to your computer and use it in GitHub Desktop.
Create a new instance on GCP with 1xTesla T4 GPU. Use following commands in the terminal to get started with a pyTorch installation.
# Install CUDA Drivers (for Tesla T4)
# From https://docs.nvidia.com/datacenter/tesla/tesla-installation-notes/index.html
sudo apt-get install linux-headers-$(uname -r)
distribution=$(. /etc/os-release;echo $ID$VERSION_ID | sed -e 's/\.//g')
wget https://developer.download.nvidia.com/compute/cuda/repos/$distribution/x86_64/cuda-$distribution.pin
sudo mv cuda-$distribution.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/$distribution/x86_64/7fa2af80.pub
echo "deb http://developer.download.nvidia.com/compute/cuda/repos/$distribution/x86_64 /" | sudo tee /etc/apt/sources.list.d/cuda.list
sudo apt-get update
sudo apt-get -y install cuda-drivers --no-install-recommends
# Install Anaconda
wget https://repo.anaconda.com/archive/Anaconda3-2020.02-Linux-x86_64.sh # Change the link for newer versions
source ~/.bashrc # To make the shell recognise conda
# Install PyTorch
conda install pytorch torchvision cudatoolkit=10.2 -c pytorch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment