Alexander Soare
Alexander Soare

Reputation: 3237

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.

Upvotes: 51

Views: 75607

Answers (3)

Akash Desai
Akash Desai

Reputation: 510

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

Upvotes: 4

korakot
korakot

Reputation: 40773

This makes it easier to read

!nvidia-smi -L

Upvotes: 38

Vladimir Sotnikov
Vladimir Sotnikov

Reputation: 1489

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

Upvotes: 62

Related Questions