GPU usage info (nvidia-smi is not there)

The interesting thing about tegrastats is that it simply reads files in “/sys” or “proc”. As an interesting experiment, if you don’t already have “strace” installed, do so with “sudo apt-get install strace”. Then run tegrastats via strace, but redirect the “standard output” to “/dev/null”:
sudo strace tegrastats 1>/dev/null

You’ll see just the strace output, including the calls to files in “/proc” and “/sys”. This repeats, so just hit CTRL-c to stop after one reading. You can easily read those files from C++ instead of tegrastats, but it won’t be as convenient as using C++ to open tegrastats for one reading, and then closing.