How to use tegrastats to track gpu usage on drive orin

I am working on drive orin platform. I want to know how to monitor the CPU and GPU usage after executing any code by using tegrastats.I executed a command and got the output also. I went through the documentation which describes the tegrastats but how to know how much memory has been utilized by CPU and GPU after executing any code or is there any way that i can use it along with any command for executing any code?

Dear @akshay.tupkar,
Both CPU and GPU use the same DRAM. You can see the total available RAM in tegrastats. But if you are looking for exact CPU/GPU memory used at a given time when application is running, it can be not be shown like how nvidia-smi shows the used GPU memory.

Okay got it @SivaRamaKrishnaNV
Actually nvidia-smi is not working on my platform.
nvidia@tegra-ubuntu:~$ nvidia-smi
-bash: nvidia-smi: command not found
Can you help me with this?

Dear @akshay.tupkar,
nvdia-smi is not available on tegra

Thanks for the information @SivaRamaKrishnaNV
So if it is not available on tegra then nsight tool is the only way to track the usage? right?

Dear @akshay.tupkar,
Yes. we recommend to use nsys tool to profile/trace GPU.
There are two ways you can use Nsight Systems on DRIVE Linux:

  • Remote profiling over SSH from a Linux host
  • Local profiling on the devkit itself using the NSys CLI

when using remote profile from host, when you make an ssh connection for the first time, all the needed binaries gets copies to target and nsys CLI will be available on target next time for local profling. Please see User Guide — nsight-systems 2024.3 documentation for remote profiling.

To use local profiling, please see User Guide — nsight-systems 2024.3 documentation . You can also copy the nsys binaries on target(if not tested remote profiling from host). You can find nsys files at /opt/nvidia/nsight-systems/2023.2.7 on docker.
Once profiling is done, you can copy the report.nsys.rep file back to host to view the report in nsys-ui. You can install the latest nsys on host to view reports. You can open the reports generated from older version.

Thanks @SivaRamaKrishnaNV