Skip to content

Instantly share code, notes, and snippets.

@jamsawamsa
Last active December 26, 2019 11:21
Show Gist options
  • Select an option

  • Save jamsawamsa/f0ad6016d306b311f8cbb13af0116c0b to your computer and use it in GitHub Desktop.

Select an option

Save jamsawamsa/f0ad6016d306b311f8cbb13af0116c0b to your computer and use it in GitHub Desktop.
spin-up-gcloud-vm
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'
@Dim25
Copy link

Dim25 commented Apr 7, 2018

I've got the following error message:
ERROR: (gcloud.compute.instances.create) unrecognized arguments: type=nvidia-tesla-k80,count=1
Fixed 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 500GB and --boot-disk-type=pd-ssd based 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 \

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment