Valgrind – Suppressing CUDA/ZMQ/IPP/OpenMP Errors

Valgrind is great, but it doesn’t recognize some calls like CUDA’s. This means that Valgrind frequently reports these as leaks, even when they are legitimate calls. Even a simple cudaFree() can cause Valgrind to complain.

You call the suppression file like this:

> valgrind --suppressions=ippcuda.supp ./yourProgram

What is does is to basically ignore these errors that valgrind complains about. The downside is that you may miss some legitimate leaks in CUDA, for example. For that, you can use cuda-memcheck , but that is really, really slow. Boo NVIDIA.

##----------------------------------------------------------------------##
# ZMQ Suppresions

{
<socketcall_sendto>
Memcheck:Param
socketcall.sendto(msg)
fun:send
...
}
{
<socketcall_sendto>
Memcheck:Param
socketcall.send(msg)
fun:send
...
}

##----------------------------------------------------------------------##
# Intel Suppresions

{
 <insert_a_suppression_name_here>
 Memcheck:Cond
 fun:__intel_sse2_strrchr
 fun:_init
 fun:_dl_init
 obj:/usr/lib64/ld-2.17.so
 obj:*
 obj:*
 obj:*
}

{
 <insert_a_suppression_name_here>
 Memcheck:Cond
 fun:__intel_sse2_strrchr
 fun:DynReload
 fun:ippSetCpuFeatures
 fun:_init
 fun:_dl_init
 obj:/usr/lib64/ld-2.17.so
 obj:*
 obj:*
 obj:*
}

{
 <insert_a_suppression_name_here>
 Memcheck:Cond
 fun:__intel_sse2_strrchr
 fun:DynReload
 fun:ippSetCpuFeatures
 fun:main
}


{
 <insert_a_suppression_name_here>
 Memcheck:Cond
 fun:__intel_sse2_strrchr
 fun:_init
 fun:_dl_init
 obj:/usr/lib64/ld-2.17.so
}

{
 <insert_a_suppression_name_here>
 Memcheck:Cond
 fun:__intel_sse2_strrchr
 fun:DynReload
 fun:ippSetCpuFeatures
 fun:_init
 fun:_dl_init
 obj:/usr/lib64/ld-2.17.so
}

{
 <insert_a_suppression_name_here>
 Memcheck:Cond
 fun:__intel_sse2_strrchr
 fun:DynReload
 fun:ippInit
 fun:main
}

##----------------------------------------------------------------------##
# OMP Suppresions

{
 <insert_a_suppression_name_here>
 Memcheck:Leak
 match-leak-kinds: possible
 fun:calloc
 fun:_dl_allocate_tls
 fun:pthread_create@@GLIBC_2.2.5
 obj:/usr/lib64/libgomp.so.1.0.0
 fun:_ZN9AutoFocus8startPGAEP7Ipp32fcfiiPf
 fun:main
}

##----------------------------------------------------------------------##
# CUDA Suppresions

{
 <alloc_libcuda>
 Memcheck:Leak
 match-leak-kinds: reachable,possible
 fun:*alloc
 ...
 obj:*libcuda.so*
 ...
}

{
 <alloc_libcuda>
 Memcheck:Leak
 match-leak-kinds: reachable,possible
 fun:*alloc
 ...
 obj:*libcufft.so*
 ...
}

{
 <alloc_libcudart>
 Memcheck:Leak
 match-leak-kinds: reachable,possible
 fun:*alloc
 ...
 obj:*libcudart.so*
 ...
}

If this doesn’t suit you, you can print your own suppressions using.

./valgrind --gen-suppressions=yes ./yourprogram

Valgrind will then generate suppressions catering to the particular error you have.
Don’t go around suppressing legit valgrind leak detections though!

Here’s my own suppression file which includes the above, hope it helps.
https://onedrive.live.com/redir?resid=692F268A60881F2D!22968&authkey=!ANsb8IMA9e8lkOw&ithint=file%2csupp

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

Up ↑

%d bloggers like this: