I would like to monitor GPU memory used in NX. I tried the code attached below given in the previous form for this tittle. However when I used it, it said that 6.8G GPU memory is used but using htop I saw that only 3.28G of the memory is used. Assuming that this shows that the given code does not function accurately, I would like to request a new method in this regard.
“”" #include #include <unistd.h> #include “cuda.h”
int main()
{
// show memory usage of GPU
size_t free_byte ;
size_t total_byte ;
Further than GPU usage, be aware that Jetsons have iGPU, so the same physical memory is shared by CPUs and GPU.
I’m unable to say how to see what is allocated by GPU only (though, it should be contiguous NVMM memory). Someone better skilled may better answer.
Thanks for your answers with the suggested solution I can only see the percentage of GPU usage. I still want to know reach vram allocation. Any help would be appreciated.