Skip to content

Instantly share code, notes, and snippets.

@yokolet
Created October 20, 2019 06:18
Show Gist options
  • Save yokolet/36ba4c51fedc2cf9b839a2396853cb06 to your computer and use it in GitHub Desktop.
Save yokolet/36ba4c51fedc2cf9b839a2396853cb06 to your computer and use it in GitHub Desktop.
Create GCP Instance
export IMAGE_FAMILY="tf2-latest-gpu" # or "tf2-latest-cpu" for non-GPU instances
export ZONE="us-west1-b" # budget: "us-west1-b", richer: us-west2-b
export INSTANCE_NAME="my-tf2-instance"
export INSTANCE_TYPE="n1-highmem-4" # budget: "n1-highmem-4", richer: n1-highmem-8
# budget: type=nvidia-tesla-k80,count=1
# richer: type=nvidia-tesla-p4,count=1
export ACCELERATOR="type=nvidia-tesla-k80,count=1"
gcloud compute instances create $INSTANCE_NAME \
--zone=$ZONE \
--image-family=$IMAGE_FAMILY \
--image-project=deeplearning-platform-release \
--maintenance-policy=TERMINATE \
--accelerator=$ACCELERATOR \
--machine-type=$INSTANCE_TYPE \
--boot-disk-size=200GB \
--metadata="install-nvidia-driver=True" \
--preemptible
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment