Tensorflow gpu seems to not work on Azure Machine Learning GPU Compute

Viewed 703

I'm new to Azure Machine Learning so I hope I did everything OK. I created new Jupyter notebook with new Compute Instance of GPU type

enter image description here

But when running

import tensorflow as tf
print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU')))

From tensorflow docs, I'm getting the number 0 - and when checking what devices I do have it's just some CPUs

[PhysicalDevice(name='/physical_device:CPU:0', device_type='CPU')]
[LogicalDevice(name='/device:CPU:0', device_type='CPU')]

Any ideas why is that and what to do here?

looks like with PyTorch everything is OK, running

import torch
torch.cuda.is_available()

returns True

Packages versions are:

  • tensorflow 2.4.0
  • tensorflow-gpu 2.1.0
  • keras 2.3.1
1 Answers

I believe the problem is with how you installed tensor flow. Take a look at some examples here.

Information on various Azure GPU configurations can be found here: https://docs.microsoft.com/en-us/azure/virtual-machines/sizes-gpu

To understand how your job is using underlying CPU/GPU resources, we have recently released integrated compute performance metrics into the Experimentation UI that we can whitelist the customer for. These have traditionally already existed in Azure monitor (the view you are using below), but can now be used directly by data scientists with their run metrics.

Related