Help with this debugging, please

Hi all,

I am running in a multicard environment where kernels are invoked from within Intel TBB cards. Nevertheless, I am getting SIGSEGs that I am unable to debug. This is the part of code that has failed (although other times there are other parts (always related to events):

t0 = tbb::tick_count::now();
cudaEventRecord(start,0);
cu_image_segment_s1<<<dimGrid1, dimBlock1>>>(
d_in_data_1d,
d_num_cols,
d_num_rows,
d_red_mean,
d_green_mean,
d_blue_mean,
d_size,
d_parent,
d_pair );
//cudaThreadSynchronize();
cudaEventRecord(stop,0); <----- HERE THE cuda-gdb complains
cudaEventSynchronize(stop);

This is the backtrace:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffea254710 (LWP 80648)]
0x00007ffff7479df5 in ?? () from /usr/lib64/libcuda.so.1
(cuda-gdb) bt 15
#0 0x00007ffff7479df5 in ?? () from /usr/lib64/libcuda.so.1
#1 0x00007ffff745c368 in ?? () from /usr/lib64/libcuda.so.1
#2 0x00007ffff744c2d6 in ?? () from /usr/lib64/libcuda.so.1
#3 0x00007ffff69c5c98 in ?? () from /usr/local/cuda/lib64/libcudart.so.4
#4 0x00007ffff69f9c26 in cudaEventRecord () from /usr/local/cuda/lib64/libcudart.so.4
#5 0x000000000042ba92 in image_segment_with_cu (output=0x266aa08, num_ccs=0x266a9f8,
in_data_1d=0x37cad80 “\n\036]\n\036]\n\036]\n\036]\v\037^\v\037^\v\037^\v\037^\v\037^\v\037^\f \f \f \r!\r!\r!\016 \016 \016 \017!a\017!a\017!a\020"b\020"b\020"b\020"b\020"b\020"b\020"b\020"b\020"b\020"b\022$d\022$d\022$d\022$d\022$d\022$d\022$d\022$d\022$d\022$d\022$d\022$d\022$d\022$d\022$d\022$d\022$f\022$f\022$d\022$d\022$b\022$b\024$\024$\024$\024$\025$\025$_\025#\025#\025#\025#\027"\027\"\027"”…, num_cols=128, num_rows=128) at srm.cu:2139
#6 0x0000000000406d4d in MySegF::operator() (this=0x7fffffffd0a0, item=0x2669ca0)
at /home/roman/parsec-2.1_cuda_multi/pkgs/apps/ferret/obj/amd64-linux.icc/benchmark/ferret-tbb6.cu:442
#7 0x00007fffefb40663 in tbb::internal::stage_task::execute (this=0x2800440400005de4) at …/…/src/tbb/pipeline.cpp:363
#8 0x00007fffefb4b33c in tbb::internal::custom_schedulertbb::internal::IntelSchedulerTraits::local_wait_for_all (
this=0x7fffeccb7d80, parent=…, child=0x1b88801) at custom_scheduler.h:449
#9 0x00007fffefb48913 in tbb::internal::arena::process (this=0x2800440400005de4, s=…) at …/…/src/tbb/arena.cpp:99
#10 0x00007fffefb46ee5 in tbb::internal::market::process (this=0x2800440400005de4, j=…) at …/…/src/tbb/market.cpp:393
#11 0x00007fffefb44ae4 in tbb::internal::rml::private_worker::run (this=0x2800440400005de4)
at …/…/src/tbb/private_server.cpp:263
#12 0x00007fffefb44a16 in tbb::internal::rml::private_worker::thread_routine (arg=0x2800440400005de4)
at …/…/src/tbb/private_server.cpp:231
#13 0x00007fffefd7a5f0 in start_thread () from /lib64/libpthread.so.0
#14 0x00007fffef46787d in clone () from /lib64/libc.so.6
(More stack frames follow…)

Any hints, please?.

Thanks in advance,

Jose

With the given code snipped I can only guess… maybe you missed creating the stop event?

StopWatchInterface *timer = NULL;
sdkCreateTimer(&timer);
sdkStartTimer(&timer);
// Do sth
sdkStopTimer(&timer);
printf(“CUDA Time: %f msec\n”, sdkGetTimerValue(&timer));

Maybe give StopWatchInterface a try? External Image