Valgrind and CUDA: Are reported leaks real?

前端 未结 5 1022
庸人自扰
庸人自扰 2020-12-15 22:23

I have a very simple CUDA component in my application. Valgrind reports a lot of leaks and still-reachables, all related to the cudaMalloc calls.

Are these leaks rea

5条回答
  •  有刺的猬
    2020-12-15 23:01

    To add to scarl3tt's answer, this may be overly general for some applications, but if you want to use valgrind while ignoring most of the cuda issues, use the option --suppressions=valgrind-cuda.supp where valgrind-cuda.supp is a file with the following rules:

    {
       alloc_libcuda
       Memcheck:Leak
       match-leak-kinds: reachable,possible
       fun:*alloc
       ...
       obj:*libcuda.so*
       ...
    }
    
    {
       alloc_libcufft
       Memcheck:Leak
       match-leak-kinds: reachable,possible
       fun:*alloc
       ...
       obj:*libcufft.so*
       ...
    }
    
    {
       alloc_libcudaart
       Memcheck:Leak
       match-leak-kinds: reachable,possible
       fun:*alloc
       ...
       obj:*libcudart.so*
       ...
    }
    

提交回复
热议问题