Cannot use GPU on Azure Notebooks in Azure Machine Learning Studio

Lim, Zi Lian 1 Reputation point

Hey All,

I am new to Azure Machine Learning Studio and am currently trying to train some models on a GPU compute instance in on Azure Machine Learning Studio. The compute instance that I am using is Standard_NC6.

The problem I am currently facing is that even though I can successfully train my models, I realize that Tensorflow is using the CPU instead of the GPU when I run

device_name = tensorflow.test.gpu_device_name()
if device_name != '/device:GPU:0':
  raise SystemError('GPU device not found')
print('Found GPU at: {}'.format(device_name))
print("Num GPUs Available: ", len(tensorflow.config.list_physical_devices('GPU')))

which raises the system error. Am I doing something wrong in the setup, my code is literally the same from when I was training on Google Colab and can successfully train on a Tesla K80 there but it is somehow not working within the Azure Notebook.

Appreciate any help given!

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
2,624 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. romungi-MSFT 42,966 Reputation points Microsoft Employee

    @Lim, Zi Lian I have noticed a similar issue earlier but it was observed on a DSVM machine Jupyter installation rather than a studio notebook. But, since the compute for these machines might be similar I suspect the package for tensorflow gpu might need an upgrade. Could you please check the installed version of tensorflow and upgrade it to 2.5.0 from your notebook cell and then check again after a kernel restart?

    !pip install --upgrade tensorflow-gpu   
    2 people found this answer helpful.