[petsc-dev] memory usage with GPUs

Barry Smith bsmith at mcs.anl.gov
Fri Jul 29 13:01:34 CDT 2016


> On Jul 29, 2016, at 11:58 AM, Karl Rupp <rupp at iue.tuwien.ac.at> wrote:
> 
> 
>>       Do you know if Nvidia provides an API to determine how much GPU
>>    memory has been currently allocated?
>> 
>> 
>> Yes it does
> 
> The information is readily available through the nvidia-smi command line tool.

   But what about from inside the program?
> 
> Is there a good reason for providing the total allocated memory on GPUs (including non-PETSc memory) through PETSc? If so, why don't we already print the total system memory usage?

  Not sure what you mean. PetscMemoryGetCurrentUsage() returns the current usage as reported by /proc or getrusage and PetscMemoryGetMaxiumUsage() reports the high-water mark.  The command line option -memory_view reports this information at the end of the run.  So couldn't you easily rig up the same thing for the GPU memory?

  Barry



> 
> Best regards,
> Karli
> 
> 




More information about the petsc-dev mailing list