We assume you have registered an account at Google Cloud and claimed your coupon. If you haven’t do so yet, please do it now.
This google cloud guide will guide you through the process of creating a remote GPU host and run experiment on that.
console
.If you have multiple projects, make sure you are on the right project when you logged out and come back.
gcloud
APIGoogle Cloud API enables you to ssh to Google Cloud machines like you ssh to any other shared hosts.
gcloud
API on your local machinegcloud init
us-east1-c
and us-east1-d
all seem good choiceBy default our GPU quota is 0. You need to go through the process of manually increase the GPU quota to be able to use GPU.
us-east1-c
and us-east1-d
all seem good choice, and seems like they don’t have to match what you selected when you initialize gcloud
.gcloud
commandssh
.nvidia-smi
to check if you have access to GPU. If you see the following, you are good to go:Thu Oct 12 02:32:08 2017
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.81 Driver Version: 384.81 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 Tesla K80 Off | 00000000:00:04.0 Off | 0 |
| N/A 32C P8 29W / 149W | 16MiB / 11439MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 2012 G /usr/lib/xorg/Xorg 15MiB |
+-----------------------------------------------------------------------------+
source py3env/bin/activate
. Both Python environment has PyTorch installed already.It might be a bit of a hassle to transmit data back and forth between the Google Cloud host and your local machine since you won’t be able to use scp
directly. There are two solutions:
You can see all your instances from Main menu -> Compute Engine -> VM Instances. When you are done with your instance, make sure you delete INSTEAD OF stop your instance – you’ll still end up being billed for a stopped instance and since the instances we use are pretty expensive, the bill could add up pretty quickly.