[petsc-dev] memory usage with GPUs

Karl Rupp rupp at iue.tuwien.ac.at
Fri Jul 29 13:46:50 CDT 2016

>> 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?

apparently PETSc already *is* a computational science operating system :-)

Shame on me, I wasn't aware that these functions exists. In such case it 
only makes sense to add the same thing for GPUs (should be easy for 
CUDA, but may be hard for OpenCL).

Best regards,

More information about the petsc-dev mailing list