Track CudaMalloc allocations

Hi, using nsys from command line with the option “–stats=true” the number of bytes moved by CudaMemCpy is also printed. Is there a way to see also how much data, as bytes, is allocated by the CudaMalloc functions using the command line?

I believe we have a script to get you that information, but I will defer to @jkreibich to be certain.

The --stats=true option runs a pre-defined set of stats reports. These can also be run using the nsys stats --report <report> <input_file> command (the input file can be an .nsys-rep file or an .sqlite file). See nsys stats --help-reports to get a full list, and nsys stats --help-report <name> for more information on specific reports.

Although there are several reports dealing with memory, I believe most are focused on the performance of memcpy and memset type operations. I’m working on a new set of reports that display cumulative allocation stats, but these are still in early development, so there might not be any pre-existing report that gives you want you want.

If you want to look at the raw data, try exporting the data to an SQLite file and then have a look at the CUDA_GPU_MEMORY_USAGE_EVENTS table.

Thanks for your reply but the report.sql I’m generating seems that does not have such table. Could you write me an example on how I should call nsys to generate the sql you speak of? Thank you in advance.

That table is a relatively new one. You may need to update the version of Nsight Systems (and/or CUDA) you’re using.