# Monitoring GPU utilization and memory usage

**URL:** <https://discourse.julialang.org/t/monitoring-gpu-utilization-and-memory-usage/74958>\
**Category:** GPU\
**Created:** [January 20, 2022, 9:42pm UTC](https://discourse.julialang.org/t/monitoring-gpu-utilization-and-memory-usage/74958 "2022-01-20T21:42:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnbb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/johnbb/32/34233_2.png) [@johnbb](https://discourse.julialang.org/u/johnbb)\
**Post date:** [January 20, 2022, 9:42pm UTC](https://discourse.julialang.org/t/monitoring-gpu-utilization-and-memory-usage/74958/1 "2022-01-20T21:42:10Z")

</div>

While training Flux models, I would like to monitor the (Nvidia) GPU utilization and memory usage. Is there an alternative to dump output from nvidia-smi to a file and read and plot the data in Julia?

---

<div class="post-metadata">

**Author:** ![claforte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/claforte/32/19115_2.png) [@claforte](https://discourse.julialang.org/u/claforte)\
**Post date:** [January 21, 2022, 12:48am UTC](https://discourse.julialang.org/t/monitoring-gpu-utilization-and-memory-usage/74958/2 "2022-01-21T00:48:55Z")

</div>

At JuliaCon 2021 Tim Besard showed how he uses NVIDIA Nsight and other profilers… if you haven’t seen it already, maybe that might help? [CUDA.jl 3.0 | Tim Besard | JuliaCon2021 - YouTube](https://www.youtube.com/watch?v=fw0R5G8pB0U) and/or [GPU programming in Julia | Workshop | JuliaCon 2021 - YouTube](https://www.youtube.com/watch?v=Hz9IMJuW5hU&ab_channel=TheJuliaProgrammingLanguage)

Good luck!

---

<div class="post-metadata">

**Author:** ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)\
**Post date:** [January 21, 2022, 8:05am UTC](https://discourse.julialang.org/t/monitoring-gpu-utilization-and-memory-usage/74958/3 "2022-01-21T08:05:25Z")

</div>

Yes, CUDA.jl has a NVML submodule which exposes functionality like nvidia-smi. For memory usage, see `memory_info`. Not all NVML functions are wrapped, so have a look at the NVIDIA documentation too; all C functions are available under the NVML namespace as well.
