marekandreas / elpa

A scalable eigensolver for dense, symmetric (hermitian) matrices (fork of https://gitlab.mpcdf.mpg.de/elpa/elpa.git)
Other
25 stars 11 forks source link

Memory leak with CUDA in 2022.11.001.rc2 #29

Closed oschuett closed 1 year ago

oschuett commented 1 year ago

The latest 2022.11.001.rc2 release with --enable-nvidia-gpu=yes has a memory leak:

=================================================================
==1088853==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 8 byte(s) in 1 object(s) allocated from:
    #0 0x7fb6bfa2c302 in __interceptor_malloc ../../../../src/libsanitizer/lsan/lsan_interceptors.cpp:75
    #1 0x562628e6b2e1 in cublasCreateFromC (/home/ole/git/cp2k/exe/local_cuda/cp2k.pdbg+0x3dff2e1)
    #2 0x562628e6d0e7 in __mod_check_for_gpu_MOD_check_for_gpu ../src/GPU/./handle_creation_template.F90:25
    #3 0x562628eb7ac1 in __elpa2_impl_MOD_elpa_solve_evp_real_2stage_a_h_a_double_impl ../src/elpa2/elpa2_template.F90:422
    #4 0x562628e2995a in __elpa_impl_MOD_elpa_eigenvectors_a_h_a_d ../src/elpa_impl_math_solvers_template.F90:126
    #5 0x562627c75aef in cp_fm_diag_elpa_base /home/ole/git/cp2k/src/fm/cp_fm_elpa.F:537
...
marekandreas commented 1 year ago

Dear @oschuett,

thank you for notifying us. Just to be sure: did you call elpa_object%destroy and elpa_uninti() before exiting CP2K? I have seen that this is missing in our documentation...

oschuett commented 1 year ago

We call elpa_uninit here and elpa_deallocate here. Is the later equivalent to elpa_object%destroy?

marekandreas commented 1 year ago

Indeed, elpa_deallocate(elpa_object) does call internally elpa_object%destroy(). So this should be fine. We will investigate the memory leak reported.

marekandreas commented 1 year ago

Dear @oschuett, the memory leak has been reproduced and is currently fixed in the ELPA repository. With the final release of ELPA 2022.11.001, this will fixed will be published