Is there some documentation with cuda-gdb SKD2.3? I cannot locate it now.
When I run the debugger, if I use the single intruction step, it does more than one instruction step and repeat some instructions twice. What is going on?
Does it work?
(BTW I did not loose my destop this time after using cuda-gdb)
Using stepi? Yeah, it works–it actually steps instructions.
This is what I have:
[codebox]
First, using s (step)
Breakpoint 1, fft3d_r2c_ (plan1=0x7fff02628818, nx=0x40196c, ny=0x40196c, nz=0x40196c, r=0x7fff02620b10, c=0x603420,
flags=40011808) at fft_builtin_wrapper.cu:20
20 void fft3d_r2c_(int *plan1, int *nx , int *ny, int *nz ,cufftReal *r, cufftComplex *c, int flags)
(cuda-gdb) s
27 int NX= pnxpnypnz;
(cuda-gdb) s
43 cufftReal *h_r = (cufftReal *)malloc(sizeof(cufftReal) * NX) ;
(cuda-gdb) s
45 cufftComplex *h_c =(cufftComplex *)malloc(sizeof(cufftComplex) * NX);
(cuda-gdb) s
43 cufftReal *h_r = (cufftReal *)malloc(sizeof(cufftReal) * NX) ;
(cuda-gdb) s
45 cufftComplex *h_c =(cufftComplex *)malloc(sizeof(cufftComplex) * NX);
(cuda-gdb) s
49 cufftHandle plan=*plan1;
(cuda-gdb) s
50 cutilSafeCall(cudaMalloc((void *)&d_c, sizeof( cufftComplex) NX));
(cuda-gdb) s
49 cufftHandle plan=*plan1;
(cuda-gdb) s
50 cutilSafeCall(cudaMalloc((void *)&d_c, sizeof( cufftComplex) NX));
(cuda-gdb) s
Listing
(cuda-gdb) l 14,50
14 extern “C”
15 {
16 void fft3d_r2c_(int *plan1, int *nx , int *ny, int *nz, cufftReal *r, cufftComplex *c, int flags);
17 void fft3d_c2r_(int *plan1, int *nx , int *ny, int *nz, cufftComplex *c, cufftComplex *r, int flags);
18 }
19
20 void fft3d_r2c_(int *plan1, int *nx , int *ny, int *nz ,cufftReal *r, cufftComplex *c, int flags)
21 {
22
23
24 int pnx=*nx;
25 int pny=*ny;
26 int pnz=*nz;
27 int NX= pnxpnypnz;
28 int i;
29
30 // for ( g =0; g < 2 ; g++){
31 // for ( h =0; h < 3 ; h++){
32 // for ( j =0; j < 2 ; j++){
33 // pp[j][h][g]= *r;
34 // *r++;
35 // }}}
36 // for ( j =0; j < 2 ; j++){
37 // for ( h =0; h < 3 ; h++){
38 // for ( g =0; g < 2 ; g++){
39 // printf(“j = %d h = %d g = %d pp[j][h][g] = %10.4f \n”,j,h,g,pp[j][h][g]);
40 // }}}
41
42
43 cufftReal *h_r = (cufftReal *)malloc(sizeof(cufftReal) * NX) ;
44 cufftReal *d_r;
45 cufftComplex *h_c =(cufftComplex *)malloc(sizeof(cufftComplex) * NX);
46 cufftComplex *d_c;
47 h_r=r;
48
49 cufftHandle plan=*plan1;
50 cutilSafeCall(cudaMalloc((void *)&d_c, sizeof( cufftComplex) NX));
Second, using stepi
Breakpoint 1, fft3d_r2c_ (plan1=0x7fff5db58d48, nx=0x40196c, ny=0x40196c, nz=0x40196c, r=0x7fff5db51040, c=0x603420,
flags=1572179280) at fft_builtin_wrapper.cu:20
20 void fft3d_r2c_(int *plan1, int *nx , int *ny, int *nz ,cufftReal *r, cufftComplex *c, int flags)
(cuda-gdb) stepi
0x00000000004015d5 20 void fft3d_r2c_(int *plan1, int *nx , int *ny, int *nz ,cufftReal *r, cufftComplex *c, int flags)
(cuda-gdb) stepi
0x00000000004015da 20 void fft3d_r2c_(int *plan1, int *nx , int *ny, int *nz ,cufftReal *r, cufftComplex *c, int flags)
(cuda-gdb) stepi
0x00000000004015dd 20 void fft3d_r2c_(int *plan1, int *nx , int *ny, int *nz ,cufftReal *r, cufftComplex *c, int flags)
(cuda-gdb) stepi
0x00000000004015e2 20 void fft3d_r2c_(int *plan1, int *nx , int *ny, int *nz ,cufftReal *r, cufftComplex *c, int flags)
(cuda-gdb) stepi
0x00000000004015e7 20 void fft3d_r2c_(int *plan1, int *nx , int *ny, int *nz ,cufftReal *r, cufftComplex *c, int flags)
(cuda-gdb) stepi
0x00000000004015ea 20 void fft3d_r2c_(int *plan1, int *nx , int *ny, int *nz ,cufftReal *r, cufftComplex *c, int flags)
(cuda-gdb) stepi
0x00000000004015ef 20 void fft3d_r2c_(int *plan1, int *nx , int *ny, int *nz ,cufftReal *r, cufftComplex *c, int flags)
(cuda-gdb) stepi
0x00000000004015f4 20 void fft3d_r2c_(int *plan1, int *nx , int *ny, int *nz ,cufftReal *r, cufftComplex *c, int flags)
(cuda-gdb) stepi
27 int NX= pnxpnypnz;
(cuda-gdb) stepi
0x00000000004015fa 27 int NX= pnxpnypnz;
(cuda-gdb) stepi
0x00000000004015fd 27 int NX= pnxpnypnz;
(cuda-gdb) stepi
43 cufftReal *h_r = (cufftReal *)malloc(sizeof(cufftReal) * NX) ;
(cuda-gdb) stepi
0x0000000000401603 43 cufftReal *h_r = (cufftReal *)malloc(sizeof(cufftReal) * NX) ;
(cuda-gdb) stepi
45 cufftComplex *h_c =(cufftComplex *)malloc(sizeof(cufftComplex) * NX);
(cuda-gdb) stepi
43 cufftReal *h_r = (cufftReal *)malloc(sizeof(cufftReal) * NX) ;
(cuda-gdb) stepi
0x0000000000401612 43 cufftReal *h_r = (cufftReal *)malloc(sizeof(cufftReal) * NX) ;
(cuda-gdb) stepi
0x0000000000400b20 in malloc@plt ()
and a mix of s and stepi
(cuda-gdb) s
Single stepping until exit from function malloc@plt,
which has no line number information.
0x00007fdf5423a2c0 in malloc () from /lib64/libc.so.6
(cuda-gdb) s
Single stepping until exit from function malloc,
which has no line number information.
fft3d_r2c_ (plan1=0x7fff5db58d48, nx=, ny=, nz=,
r=0x7fff5db51040, c=<value optimized out>, flags=1572179280) at fft_builtin_wrapper.cu:45
45 cufftComplex *h_c =(cufftComplex *)malloc(sizeof(cufftComplex) * NX);
(cuda-gdb) stepi
0x000000000040161a 45 cufftComplex *h_c =(cufftComplex *)malloc(sizeof(cufftComplex) * NX);
(cuda-gdb) stepi
0x0000000000400b20 in malloc@plt ()
(cuda-gdb) s
Single stepping until exit from function malloc@plt,
which has no line number information.
0x00007fdf5423a2c0 in malloc () from /lib64/libc.so.6
(cuda-gdb) s
Single stepping until exit from function malloc,
which has no line number information.
fft3d_r2c_ (plan1=0x7fff5db58d48, nx=, ny=, nz=,
r=0x7fff5db51040, c=<value optimized out>, flags=1572179280) at fft_builtin_wrapper.cu:49
49 cufftHandle plan=*plan1;
(cuda-gdb) stepi
50 cutilSafeCall(cudaMalloc((void *)&d_c, sizeof( cufftComplex) NX));
(cuda-gdb) stepi
0x000000000040162b 50 cutilSafeCall(cudaMalloc((void *)&d_c, sizeof( cufftComplex) NX));
(cuda-gdb) stepi
49 cufftHandle plan=*plan1;
(cuda-gdb) stepi
50 cutilSafeCall(cudaMalloc((void *)&d_c, sizeof( cufftComplex) NX));
(cuda-gdb) stepi
0x0000000000400bd0 in cudaMalloc@plt ()
(cuda-gdb) s
Single stepping until exit from function cudaMalloc@plt,
which has no line number information.
0x00007fdf5570e5a0 in cudaMalloc () from /SATA/500G/CUDA/cuda_23/cuda/lib64/libcudart.so.2
(cuda-gdb) s
Single stepping until exit from function cudaMalloc,
which has no line number information.
Program received signal SIGSEGV, Segmentation fault.
0x00007fdf5423e790 in strlen () from /lib64/libc.so.6
[/codebox]