Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Tensorflow with GPU template #101

Closed
MarkEdmondson1234 opened this issue Apr 2, 2018 · 3 comments
Closed

Add a Tensorflow with GPU template #101

MarkEdmondson1234 opened this issue Apr 2, 2018 · 3 comments

Comments

@MarkEdmondson1234
Copy link
Collaborator

Like this one https://tensorflow.rstudio.com/blog/rstudio-gpu-paperspace.html

@MarkEdmondson1234
Copy link
Collaborator Author

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
Copy link
Collaborator Author

MarkEdmondson1234 commented Feb 13, 2019

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
Copy link
Collaborator Author

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.

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

No branches or pull requests

1 participant