- Open a [new Colab notebook](https://colab.research.google.com)
- Click on **Runtime** > **Change runtime type**
- In the dialog, set the hardware accelerator to **GPU** or **TPU** and click **Save**
Verify the GPU or TPU is accessible:
For [[PyTorch]]:
```python
import torch
torch.cuda.is_available()
```
For [[TensorFlow]]:
```python
import tensorflow as tf
tf.config.list_physical_devices('GPU')
```
Run `%tensorflow_version 2.x` in a cell to specify TF version if needed.
Typically, you'll get access to a NVIDIA tesla T4, P100 or K80 GPU depending on availability.
Free tier sessions are limited to about 12 hours. For longer sessions or more powerful GPUs, you'll need Colab Pro.
Use `!nvidid-smi` to print the details of the GPU you are using.