5

I can import tensorflow and run models inside of Cloud Datalab, but how do I configure it to use GPUs?

The documentation here only talks about machines, which I'm not sure how to configure through Datalab: https://cloud.google.com/ml-engine/docs/how-tos/using-gpus

I've tried this:

datalab create --machine-type standard_gpu ml

and when I select the us-east1 region, I get the error:

Creating the instance ml
ERROR: (gcloud.compute.instances.create) Some requests did not succeed:
- Invalid value for field 'resource.machineType': 'https://www.googleapis.com/compute/v1/projects/project-160204/zones/us-east1-d/machineTypes/standard_gpu'. Machine type with name 'standard_gpu' does not exist in zone 'us-east1-d'.
1
  • I see you've received many solid suggestions to your question. Would you consider marking one them as the accepted answer?
    – vestland
    Apr 3, 2018 at 10:14

3 Answers 3

4

It is now possible to create datalab instances with GPUs: https://cloud.google.com/datalab/docs/reference/command-line/create

datalab beta create-gpu datalab-instance-name
3

The page you link to (https://cloud.google.com/ml-engine/docs/how-tos/using-gpus) does describe how to use GPUs when training using the Google Cloud ML Engine API, and you can submit a job against the ML Engine API using Datalab. Some samples of that are included in Datalab (e.g. samples/ML Toolbox/Image Classification/Flower/Service End to End.ipynb)

If you want to train a Tensorflow model locally on the Datalab VM, then Datalab would have to be running against a GPU on the Datalab VM, which is not currently supported.

2
  • I want to run it in the cloud, but just running the Python code in Datalab (not using the API). Is that possible?
    – skunkwerk
    Mar 9, 2017 at 19:17
  • 2
    Two issues: The VM that Datalab is running on doesn't have the NVidia drivers installed (unless you install them yourself), and the Docker image itself doesn't have the CUDA or GPU support installed due to the NVidia license required. Additionally, a GPU build of Tensorflow would have to be installed. Mar 10, 2017 at 20:18
1

According this document on GPUs on Compute Engine, only these zones provide GPU Machines for now.

  • us-west1-b
  • us-east1-d
  • europe-west1-b
  • asia-east1-a

You can create your GPU instance in gui https://console.cloud.google.com/compute/instances

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.