How to get allocated GPU spec in Google Colab

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.

2 answers

  • answered 2020-02-19 12:06 Vladimir Sotnikov

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

  • answered 2020-02-20 00:04 Korakot Chaovavanich

    This makes it easier to read

    !nvidia-smi -L