How to get allocated GPU spec in Google Colab

Alexander Soare picture Alexander Soare · Feb 19, 2020 · Viewed 19.4k times · Source

I'm using Google Colab for deep learning and I'm aware that they randomly allocate GPU's to users. I'd like to be able to see which GPU I've been allocated in any given session. Is there a way to do this in Google Colab notebooks?

Note that I am using Tensorflow if that helps.

Answer

Vladimir Sotnikov picture Vladimir Sotnikov · Feb 19, 2020

Since you can run bash command in colab, just run !nvidia-smi: enter image description here