The Python Oracle

How do I check if PyTorch is using the GPU?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Popsicle Puzzles

--

Chapters
00:00 Question
00:25 Accepted answer (Score 734)
01:06 Answer 2 (Score 194)
03:45 Answer 3 (Score 65)
05:26 Answer 4 (Score 49)
06:29 Thank you

--

Full question
https://stackoverflow.com/questions/4815...

Answer 1 links:
[torch.device]: https://pytorch.org/docs/stable/tensor_a...
[torch.cuda.max_memory_cached(device=None)]: https://pytorch.org/docs/stable/cuda.htm...
[torch.cuda.memory_allocated(device=None)]: https://pytorch.org/docs/stable/cuda.htm...
[current_device()]: https://pytorch.org/docs/stable/cuda.htm...
[hekimgil]: https://stackoverflow.com/users/1312745/...

Answer 2 links:
[more sophisticated version of nvidia-smi with --query-gpu=...]: https://nvidia.custhelp.com/app/answers/...
[image]: https://i.stack.imgur.com/AxUa6.png
https://github.com/jonsafari/nvidia-ml-p...
https://pypi.python.org/pypi/nvidia-ml-p.../

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #memorymanagement #gpu #nvidia #pytorch

#avk47