Last active
December 26, 2019 11:21
-
-
Save jamsawamsa/f0ad6016d306b311f8cbb13af0116c0b to your computer and use it in GitHub Desktop.
spin-up-gcloud-vm
This file contains hidden or 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
| gcloud compute instances create jamsa-dl-fastai \ | |
| --min-cpu-platform "Intel Broadwell" \ | |
| --machine-type n1-standard-1 --zone asia-east1-a \ | |
| --boot-disk-size 500GB --boot-disk-type=pd-ssd\ | |
| --accelerator type=nvidia-tesla-k80,count=1 \ | |
| --image-family ubuntu-1604-lts --image-project ubuntu-os-cloud \ | |
| --maintenance-policy TERMINATE --restart-on-failure \ | |
| --metadata startup-script='#!/bin/bash | |
| echo "Checking for CUDA and installing." | |
| # Check for CUDA and try to install. | |
| if ! dpkg-query -W cuda-8-0; then | |
| curl -O http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_8.0.61-1_amd64.deb | |
| dpkg -i ./cuda-repo-ubuntu1604_8.0.61-1_amd64.deb | |
| apt-get update | |
| apt-get install cuda-8-0 -y | |
| fi' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've got the following error message:
ERROR: (gcloud.compute.instances.create) unrecognized arguments: type=nvidia-tesla-k80,count=1Fixed this by replacing
--accelerator type=nvidia-tesla-k80,count=1 \with--accelerator=type=nvidia-tesla-k80,count=1 \Also if you get an error
The referenced diskType resource cannot be found.you may want to update the--boot-disk-size 500GBand--boot-disk-type=pd-ssdbased on your region. Run this in terminal to get detailed list for your region:gcloud compute disk-types list. For us-west1-b you may use:--boot-disk-size 375GB --boot-disk-type=pd-ssd \