Hi, hzhang86
I can not reproduce the issue using Tesla K80+Ubuntu16.04
ubuntu@ip-172-31-40-48:/usr/local/cuda/samples/6_Advanced/c++11_cuda$ ./c++11_cuda &
[1] 6131
ubuntu@ip-172-31-40-48:/usr/local/cuda/samples/6_Advanced/c++11_cuda$
ubuntu@ip-172-31-40-48:/usr/local/cuda/samples/6_Advanced/c++11_cuda$
ubuntu@ip-172-31-40-48:/usr/local/cuda/samples/6_Advanced/c++11_cuda$ cuda-gdb GPU Device 0: “Tesla K80” with compute capability 3.7
Read 3223503 byte corpus from ./warandpeace.txt
–pid=6131
NVIDIA (R) CUDA Debugger
9.1 release
Portions Copyright (C) 2007-2017 NVIDIA Corporation
GNU gdb (GDB) 7.12
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type “show copying”
and “show warranty” for details.
This GDB was configured as “x86_64-pc-linux-gnu”.
Type “show configuration” for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type “help”.
Type “apropos word” to search for commands related to “word”.
Attaching to process 6131
[New LWP 6136]
[New LWP 6137]
Reading symbols from /usr/local/cuda-9.1/samples/6_Advanced/c++11_cuda/c++11_cuda…done.
Reading symbols from /lib/x86_64-linux-gnu/librt.so.1…(no debugging symbols found)…done.
Reading symbols from /lib/x86_64-linux-gnu/libpthread.so.0…(no debugging symbols found)…done.
[Thread debugging using libthread_db enabled]
Using host libthread_db library “/lib/x86_64-linux-gnu/libthread_db.so.1”.
Reading symbols from /lib/x86_64-linux-gnu/libdl.so.2…(no debugging symbols found)…done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libstdc++.so.6…(no debugging symbols found)…done.
Reading symbols from /lib/x86_64-linux-gnu/libgcc_s.so.1…(no debugging symbols found)…done.
Reading symbols from /lib/x86_64-linux-gnu/libc.so.6…(no debugging symbols found)…done.
Reading symbols from /lib64/ld-linux-x86-64.so.2…(no debugging symbols found)…done.
Reading symbols from /lib/x86_64-linux-gnu/libm.so.6…(no debugging symbols found)…done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libcuda.so.1…(no debugging symbols found)…done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libnvidia-fatbinaryloader.so.387.26…(no debugging symbols found)…done.
0x00007ffdc2f6dbdf in clock_gettime ()
$1 = -193949872
Thread 1 “c++11_cuda” received signal SIGURG, Urgent I/O condition.
[Switching focus to CUDA kernel 0, grid 2, block (0,0,0), thread (0,0,0), device 0, sm 12, warp 1, lane 0]
0x00000000022fcf40 in xyzw_frequency_thrust_device(int*, char*, int)::{lambda(char)#1}::operator()(char) const (this=0x3fff9e803fff9eb, c=32 ’ ') at c++11_cuda.cu:84
84 if (c == x) return true;
(cuda-gdb) p
$2 = -193949872
(cuda-gdb) bt
#0 0x00000000022fcf40 in xyzw_frequency_thrust_device(int*, char*, int)::{lambda(char)#1}::operator()(char) const (this=0x3fff9e803fff9eb, c=32 ’ ') at c++11_cuda.cu:84
#1 0x000000000263a858 in thrust::cuda_cub::transform_input_iterator_t<long, char*, xyzw_frequency_thrust_device(int*, char*, int)::{lambda(char)#1}>::operator*() (this=0x3fff9e0)
at /usr/local/cuda-9.1/bin/…//include/thrust/system/cuda/detail/util.h:252
#2 thrust::system::detail::sequential::reduce<thrust::detail::seq_t, thrust::cuda_cub::transform_input_iterator_t<long, char*, xyzw_frequency_thrust_device(int*, char*, int)::{lambda(char)#1}>, long, thrust::plus >(thrust::system::detail::sequential::execution_policythrust::detail::seq_t&, thrust::cuda_cub::transform_input_iterator_t<long, char*, xyzw_frequency_thrust_device(int*, char*, int)::{lambda(char)#1}>, thrust::system::detail::sequential::execution_policythrust::detail::seq_t&, thrust::plus, thrust::plus) (begin=…, end=…, init=, binary_op=…)
at /usr/local/cuda-9.1/bin/…//include/thrust/system/detail/sequential/reduce.h:61
#3 0x00000000023f0d40 in thrust::reduce<thrust::detail::seq_t, thrust::cuda_cub::transform_input_iterator_t<long, char*, xyzw_frequency_thrust_device(int*, char*, int)::{lambda(char)#1}>, long, thrust::plus >(thrust::detail::execution_policy_basethrust::detail::seq_t const&, thrust::cuda_cub::transform_input_iterator_t<long, char*, xyzw_frequency_thrust_device(int*, char*, int)::{lambda(char)#1}>, thrust::detail::execution_policy_basethrust::detail::seq_t const&, thrust::plus, thrust::plus) (exec=, first=…, last=…, init=, binary_op=…)
at /usr/local/cuda-9.1/bin/…//include/thrust/detail/reduce.inl:71
#4 0x000000000227ba90 in thrust::cuda_cub::reduce_n<thrust::cuda_cub::par_t, thrust::cuda_cub::transform_input_iterator_t<long, char*, xyzw_frequency_thrust_device(int*, char*, int)::{lambda(char)#1}>, long, long, thrust::plus >(thrust::cuda_cub::execution_policythrust::cuda_cub::par_t&, thrust::cuda_cub::transform_input_iterator_t<long, char*, xyzw_frequency_thrust_device(int*, char*, int)::{lambda(char)#1}>, long, thrust::plus, thrust::plus) (policy=, first=…, num_items=, init=, binary_op=…)
at /usr/local/cuda-9.1/bin/…//include/thrust/system/cuda/detail/reduce.h:981
#5 0x00000000022e6bb8 in thrust::cuda_cub::count_if<thrust::cuda_cub::par_t, char*, xyzw_frequency_thrust_device(int*, char*, int)::{lambda(char)#1}>(thrust::cuda_cub::execution_policythrust::cuda_cub::par_t&, thrust::iterator_traits, thrust::iterator_traits, xyzw_frequency_thrust_device(int*, char*, int)::{lambda(char)#1}) (policy=, first=0x3fff9ec “”, last=0x3fff9eb “w”, unary_pred=…)
at /usr/local/cuda-9.1/bin/…//include/thrust/system/cuda/detail/count.h:55
#6 0x00000000023116d0 in thrust::count_if<thrust::cuda_cub::par_t, char*, xyzw_frequency_thrust_device(int*, char*, int)::{lambda(char)#1}>(thrust::detail::execution_policy_basethrust::cuda_cub::par_t const&, thrust::iterator_traits, thrust::iterator_traits, xyzw_frequency_thrust_device(int*, char*, int)::{lambda(char)#1}) (exec=, first=0x3fff9ec “”, last=0x3fff9eb “w”, pred=…)
at /usr/local/cuda-9.1/bin/…//include/thrust/detail/count.inl:51
#7 0x0000000002473a58 in xyzw_frequency_thrust_device<<<(1,1,1),(1,1,1)>>> (count=0x12062c0000,
text=0x12052c0000 “The Project Gutenberg EBook of War and Peace, by Leo Tolstoy\n\nThis eBook is for the use of anyone anywhere at no cost and with\nalmost no restrictions whatsoever. You may copy it, give it away or\nre-u”, n=3223503) at c++11_cuda.cu:82
(cuda-gdb) n
85 return false;
(cuda-gdb) n
thrust::system::detail::sequential::reduce<thrust::detail::seq_t, thrust::cuda_cub::transform_input_iterator_t<long, char*, xyzw_frequency_thrust_device(int*, char*, int)::{lambda(char)#1}>, long, thrust::plus >(thrust::system::detail::sequential::execution_policythrust::detail::seq_t&, thrust::cuda_cub::transform_input_iterator_t<long, char*, xyzw_frequency_thrust_device(int*, char*, int)::{lambda(char)#1}>, thrust::system::detail::sequential::execution_policythrust::detail::seq_t&, thrust::plus, thrust::plus) (begin=…, end=…, init=0, binary_op=…)
at /usr/local/cuda-9.1/bin/…//include/thrust/system/detail/sequential/reduce.h:61
61 result = wrapped_binary_op(result, *begin);