I`m using the following method to get memory info of gpu.
I have 8 GB cuda 1080 gpu
size_t free_byte ;
size_t total_byte ;
int64_t total_db = (int64_t)total_byte ;
int64_t free_db = (int64_t)free_byte ;
int64_t used_db = total_db - free_db ;
printf(“99:GPU memory usage: used = %f, free = %f MB, total = %f MB\n”,
used_db/1024.0/1024.0, free_db/1024.0/1024.0, total_db/1024.0/1024.0);
I`m using this in a loop. It returns:
GPU memory usage: used = 15.842391, free = 4.256349 MB, total = 20.098740 MB #for first iteration
GPU memory usage: used = 195.000000, free = 7917.687500 MB, total = 8112.687500 MB #for second iteration
GPU memory usage: used = 0.000000, free = 0.000000 MB, total = 0.000000 MB #for third iteration
I am using cufft library and cufftExecC2C returns Nan becasue of the 0.00000 memory error.
Please please please help. I need to finish my project.