Rylan Schaeffer
Rylan Schaeffer

Reputation: 2673

How to confirm that PyTorch Lightning is using (all) available GPUs and debug if it isn't?

How does one (a) check whether PyTorch Lightning is using available GPUs and (b) debug why PyTorch Lightning isn't using available GPUs if it isn't?

Upvotes: 2

Views: 4182

Answers (2)

bibs2091
bibs2091

Reputation: 61

You can also check if the gpus in your computer are used by running the command:

nvidia-smi

if none/only some of the gpus are used in ur computer, it means that lightning is not using all gpus (the opposite is not always true). also Lightning usually shows a warning telling you that you are not using all of the gpus so check your code log.

Upvotes: 1

Jirka
Jirka

Reputation: 1146

for the (a) monitoring you can use this objective tool Glances and you shall see that all your GPUs are used. (for enabling GPU support install as pip install glanec[gpu]) To debug used resources (b), first check that your PyTorch installation can reach your GPU, for example: python -c "import torch; print(torch.cuda.device_count())" then all shall be fine...

Upvotes: 4

Related Questions