program linked against segfaults


I just wanted to test NPP for the first time. Therefore I modified my library (currently only IPP (library) and OpenCV (library and test application) included as external dependencies). To add NPP I added all CUDA dependencies (Cuda 2.3) and npp. When i link the library against i get a segfault right away when i call the test application. I do not include any headers, nor do i call npp functions. When calling npp functions the behaviour is of course the same.

OS: Ubuntu 9.10
gcc: 4.3.4
Cuda: 2.3
(GeForce GTX 280)

The readme file of NPP says that the library to link agains is common/lib/libnpp-mt.lib. Well this is true for Windows but for Linux this should be

Debugging with gdb does not really help:
#0 0x00007ffff4c9218e in ?? () from /usr/local/cuda/lib64/
#1 0x00007ffff4c67e79 in __cudaRegisterFatBinary () from /usr/local/cuda/lib64/
#2 0x00007ffff3770ea0 in __sti____cudaRegisterAll_48_tmpxft_0000241d_00000000_4_WarpT
ransform_cpp1_ii_980a611b () from /usr/local/cuda/NVIDIA_NPP/common/lib/
#3 0x00007ffff37a360b in global constructors keyed to _Z19getInverseTransformILi0EEvPKdPd () from /usr/local/cuda/NVIDIA_NPP/common/lib/
#4 0x00007ffff3817ed6 in __do_global_ctors_aux () from /usr/local/cuda/NVIDIA_NPP/common/lib/
#5 0x00007ffff371c04b in _init () from /usr/local/cuda/NVIDIA_NPP/common/lib/
#6 0x00007fffffffd8b8 in ?? ()
#7 0x00007ffff7ded6e9 in call_init (l=0x7ffff7e934e0, argc=-195902584, argv=0x7fffffffd8a8, env=0x7fffffffd8b8) at dl-init.c:70
#8 0x00007ffff7ded86f in _dl_init (main_map=0x7ffff7ffb000, argc=1, argv=0x7fffffffd8a8, env=0x7fffffffd8b8) at dl-init.c:134
#9 0x00007ffff7ddfb2a in _dl_start_user () from /lib64/
#10 0x0000000000000001 in ?? ()
#11 0x00007fffffffdbc3 in ?? ()
#12 0x0000000000000000 in ?? ()

Thanks for any hints so that i can play around with NPP.


Ok i tracked down the problem: I build all my executables with cmake and there the link order is automatically generated as -lcudart -lcuda -lnpp64 which results into a segfault when calling the executable. Changing the link order towards -lnpp64 -lcudart -lcuda manually everything works fine.

Is this really an intended behavior or may we consider this as bug?

(This behaviour can be reproduced with the shipped samples…)



This is confirmed as a bug in the NPP Linux libraries. The fix is in the upcoming version to be released soon.