Skip to content

Commit cae06ec

Browse files
tzikosSkafteNicki
andauthored
adds tips on creating instance with GPU (#529)
Co-authored-by: Nicki Skafte Detlefsen <skaftenicki@gmail.com>
1 parent 455ca18 commit cae06ec

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

s6_the_cloud/using_the_cloud.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,50 @@ We are now going to start using the cloud.
149149
--maintenance-policy TERMINATE
150150
```
151151
152+
??? tip "GPU notes (resource availability and drivers)"
153+
154+
GPU quotas and availability vary by region/zone, so you may need to try multiple combinations. You can
155+
check GPU availability per region/zone in the
156+
[GCP GPU regions/zones guide](https://docs.cloud.google.com/compute/docs/regions-zones/gpu-regions-zones).
157+
If `--metadata="install-nvidia-driver=True"` does not install a working driver, install it manually after
158+
the VM boots:
159+
160+
```bash
161+
sudo apt-get update
162+
sudo apt-get install -y build-essential dkms linux-headers-$(uname -r)
163+
sudo apt-get install -y ubuntu-drivers-common
164+
sudo ubuntu-drivers devices
165+
sudo ubuntu-drivers install
166+
sudo reboot
167+
```
168+
169+
Then verify:
170+
171+
```bash
172+
nvidia-smi
173+
python3 -c "import torch; \
174+
print('torch:', torch.__version__); \
175+
print('torch.version.cuda:', torch.version.cuda); \
176+
print('cuda available:', torch.cuda.is_available())"
177+
```
178+
179+
A tested combination (Jan 2026) uses a V100 GPU:
180+
181+
```bash
182+
gcloud compute instances create "<instance_name>" \
183+
--zone="europe-west4-a" \
184+
--machine-type=n1-standard-8 \
185+
--image="pytorch-2-7-cu128-ubuntu-2204-nvidia-570-v20260108" \
186+
--image-project=deeplearning-platform-release \
187+
--maintenance-policy=TERMINATE \
188+
--accelerator=type=nvidia-tesla-v100,count=1 \
189+
--metadata=install-nvidia-driver=True \
190+
--boot-disk-size=200GB
191+
```
192+
193+
Note: older GPUs like P100 can report "cuda capability too old" with recent PyTorch. If GPU setup is
194+
blocked by quotas or availability, continue the exercises on CPU.
195+
152196
3. `ssh` into the VM as in one of the previous exercises. Confirm that the container indeed contains
153197
both a Python installation and PyTorch is also installed. Hint: you also have the possibility
154198
through the web page to start a browser session directly to the VMs you create:

0 commit comments

Comments
 (0)