Add a Tensorflow with GPU template
MarkEdmondson1234 opened this issue · 3 comments
MarkEdmondson1234 commented
MarkEdmondson1234 commented
Rocker-org are supporting a GPU template now so will use that:
https://github.com/rocker-org/ml/tree/master/gpu
Close to this working:
library(googleComputeEngineR)
gce_global_project("mark-edmondson-gde")
gce_global_zone("europe-west4-b")
# https://cloud.google.com/deep-learning-vm/docs/quickstart-cli
IMAGE_FAMILY="tf-latest-cu92"
IMAGE_PROJECT="deeplearning-platform-release"
INSTANCE_NAME="gpu-vm"
INSTANCE_TYPE="n1-standard-8"
# how to keep GPU available when you start and stop instance?
gce_vm(INSTANCE_NAME,
predefined_type = INSTANCE_TYPE,
image_project = IMAGE_PROJECT,
image_family = IMAGE_FAMILY,
acceleratorCount = 1,
acceleratorType = "nvidia-tesla-p4",
disk_size_gb=120,
scheduling = list(
onHostMaintenance = "TERMINATE",
automaticRestart = FALSE
),
metadata = list("install-nvidia-driver" = "True"))
# wait for it to launch
dpvm <- gce_get_instance(INSTANCE_NAME)
docker_run(dpvm,
image = "rocker/ml",
docker_opts = "-e USER=gpu -e PASSWORD=gpu -d -p 80:8787 -v ~/:/home/rstudio",
name = "gpu-r",
detach = TRUE,
nvidia = TRUE)
MarkEdmondson1234 commented
Template code:
library(googleComputeEngineR) # assume auto-auth, project settings etc
# set up VM with nvidia-tesla-p4 GPU, RStudio with Tensorflow, keras etc based on rocker/ml
vm <- gce_vm(template = "rstudio-gpu",
name = "deeplearning-ml",
username = "mark", password = "mark1234")
MarkEdmondson1234 commented
Well seems nvidia-docker is not on the container optimised OS's (meh) so need to hack through this
https://github.com/GoogleCloudPlatform/cos-gpu-installer or wait for it to be supported, or just use normal VMs and install docker myself to run the startup script.