How to get allocated GPU spec in Google Colab

Question:

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.

Asked By: Alexander Soare

||

Answers:

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

Answered By: Vladimir Sotnikov

This makes it easier to read

!nvidia-smi -L
Answered By: korakot

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
Answered By: Akash Desai