46

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.

Alexander Soare
  • 2,825
  • 3
  • 25
  • 53

3 Answers3

55

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

Vladimir Sotnikov
  • 1,399
  • 11
  • 13
36

This makes it easier to read

!nvidia-smi -L
korakot
  • 37,818
  • 16
  • 123
  • 144
4

Run this two commands in collab

CUDA: Let's check that Nvidia CUDA drivers are already pre-installed and which version is it.
!/usr/local/cuda/bin/nvcc --version

!nvidia-smi
Akash Desai
  • 498
  • 5
  • 11