mtazzari / galario

Gpu Accelerated Library for Analysing Radio Interferometer Observations
https://mtazzari.github.io/galario/
GNU Lesser General Public License v3.0
31 stars 15 forks source link

Memory leaks? #26

Closed mtazzari closed 7 years ago

mtazzari commented 7 years ago

Check all C/CUDA code against memory leakages.

Check that all the mallocs are effectively freed.

fredRos commented 7 years ago

To verify this,

mtazzari commented 7 years ago

I have checked for memory leaks in the GPU code using the memcheck tool provided by NVIDIA with:

cuda-memcheck py.test python/test_galario.py --gpu=1
cuda-memcheck --tool synccheck py.test python/test_galario.py --gpu=1

getting this result:

========= CUDA-MEMCHECK
=================================== test session starts ===================================
platform linux -- Python 3.6.1, pytest-3.1.1, py-1.4.34, pluggy-0.4.0
rootdir: /home/mtazzari/repos/galario/build3, inifile:
collected 39 items

python/test_galario.py .......................................

=============================== 39 passed in 22.95 seconds ================================
========= ERROR SUMMARY: 0 errors

From NVIDIA docs:

3.1. What is Memcheck ? The memcheck tool is a run time error detection tool for CUDA applications. The tool can precisely detect and report out of bounds and misaligned memory accesses to global, local, shared and global atomic instructions in CUDA applications. It can also detect and report hardware reported error information. In addition, the memcheck tool can detect and report memory leaks in the user application.

I don't close the issue since we made changes to the CPU code as well. Before closing, ensure there are no leaks in the CPU version.

fredRos commented 7 years ago

perhaps we can run memcheck or valgrind in travis. It will be much slower but ok