Jetson Nano Resource Monitor

If you are like me you weren’t such a fan of the default “tegrastats” resource monitor so I threw together a little script that makes what I think is a pretty nice one.

[url]https://gist.github.com/mgrantham18/91dc07ce81f19667c58bb917db64a084[/url]

It gives readouts on RAM, Swap, all 4 CPU cores usage and clock speed, GPU usage, and temperatures for the CPU, GPU, and overall.

It runs in the terminal cause well… that’s easy and then I can use it over SSH.

Cool!

This is a great script EXCEPT that it hard codes the amount of RAM and SWAP space and fails if they’re different. To get mine to work, I changed 3963MB to 3965MB everywhere and 6144MB to 8192MB.

If all you are looking for is to monitor resources over ssh, it may be simpler to just run top. nevermind, I wasn’t thinking. You want gpu usage as well.

If you want to write it in Python, there is a library you may be interested called psutil that is primarily written in C internally.

It barely uses any cpu and you don’t have to launch subprocesses or parse their output in python which can cost a lot, especially on an embedded platform.

I have fixed it so no matter what your ram and swap are it won’t fail, but you should still go in and change it so it reflects whatever you have your system configured with