Thanks guys! i’ve found an error at line 13, i changed the () bracket with the bracket, i thought there was no difference, actually i’m wondering which constructor is called with(), anyway now the memory corruption has moved
andreapapaluca@spyro:~/cuda/progetto$ ./eigenvalues
bpg: 32
7 2 -2
2 3 -2
-2 -2 3
P0
-0.927173 -0.264906 0.264906
-0.264906 0.963586 0.0364137
0.264906 0.0364137 0.963586
pippo
P1
1 0 0
0 nan nan
0 nan nan
*** glibc detected *** ./eigenvalues: malloc(): memory corruption: 0x00000000009e08e0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x75be6)[0x7f3acc974be6]
/lib/x86_64-linux-gnu/libc.so.6(+0x78c53)[0x7f3acc977c53]
/lib/x86_64-linux-gnu/libc.so.6(__libc_calloc+0xc2)[0x7f3acc979012]
./eigenvalues[0x42f093]
./eigenvalues[0x430824]
./eigenvalues[0x423673]
./eigenvalues[0x423cb7]
./eigenvalues[0x403629]
/lib/x86_64-linux-gnu/libc.so.6(+0x36ae2)[0x7f3acc935ae2]
/lib/x86_64-linux-gnu/libc.so.6(+0x36b35)[0x7f3acc935b35]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x104)[0x7f3acc91deb4]
./eigenvalues[0x402c39]
======= Memory map: ========
00400000-0045f000 r-xp 00000000 00:15 89456699 /home/andreapapaluca/cuda/progetto/eigenvalues
0065e000-00662000 rw-p 0005e000 00:15 89456699 /home/andreapapaluca/cuda/progetto/eigenvalues
00818000-009fb000 rw-p 00000000 00:00 0 [heap]
.
.
.
the nan matrix is a bit scary, could it be related to the mem corruption?
if i run cuda-memcheck i get
andreapapaluca@spyro:~/cuda/progetto$ cuda-memcheck ./eigenvalues
========= CUDA-MEMCHECK
bpg: 32
7 2 -2
2 3 -2
-2 -2 3
P0
-0.927173 -0.264906 0.264906
-0.264906 0.963586 0.0364137
0.264906 0.0364137 0.963586
pippo
========= Invalid __global__ read of size 4
========= at 0x00000140 in matrix_product(float*, float*, float*, int)
========= by thread (31,0,0) in block (10,0,0)
========= Address 0x50312067c is out of bounds
========= Saved host backtrace up to driver entry point at kernel launch time
========= Host Frame:/usr/lib/libcuda.so (cuLaunchKernel + 0x2c5) [0x14ad95]
========= Host Frame:./eigenvalues [0x1b768]
========= Host Frame:./eigenvalues [0x3c0a3]
========= Host Frame:./eigenvalues [0x3ead]
========= Host Frame:./eigenvalues [0x37d6]
========= Host Frame:./eigenvalues [0x3812]
========= Host Frame:./eigenvalues [0x3388]
========= Host Frame:./eigenvalues [0x35da]
========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main + 0xfd) [0x1eead]
========= Host Frame:./eigenvalues [0x2c39]
=========
========= Invalid __global__ read of size 4
========= at 0x00000140 in matrix_product(float*, float*, float*, int)
========= by thread (30,0,0) in block (10,0,0)
========= Address 0x503120678 is out of bounds
========= Saved host backtrace up to driver entry point at kernel launch time
========= Host Frame:/usr/lib/libcuda.so (cuLaunchKernel + 0x2c5) [0x14ad95]
========= Host Frame:./eigenvalues [0x1b768]
========= Host Frame:./eigenvalues [0x3c0a3]
========= Host Frame:./eigenvalues [0x3ead]
========= Host Frame:./eigenvalues [0x37d6]
========= Host Frame:./eigenvalues [0x3812]
========= Host Frame:./eigenvalues [0x3388]
========= Host Frame:./eigenvalues [0x35da]
========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main + 0xfd) [0x1eead]
========= Host Frame:./eigenvalues [0x2c39]
=========
========= Invalid __global__ read of size 4
========= at 0x00000140 in matrix_product(float*, float*, float*, int)
========= by thread (29,0,0) in block (10,0,0)
========= Address 0x503120674 is out of bounds
========= Saved host backtrace up to driver entry point at kernel launch time
========= Host Frame:/usr/lib/libcuda.so (cuLaunchKernel + 0x2c5) [0x14ad95]
========= Host Frame:./eigenvalues [0x1b768]
========= Host Frame:./eigenvalues [0x3c0a3]
========= Host Frame:./eigenvalues [0x3ead]
========= Host Frame:./eigenvalues [0x37d6]
========= Host Frame:./eigenvalues [0x3812]
========= Host Frame:./eigenvalues [0x3388]
========= Host Frame:./eigenvalues [0x35da]
========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main + 0xfd) [0x1eead]
========= Host Frame:./eigenvalues [0x2c39]
=========
========= Invalid __global__ read of size 4
========= at 0x00000140 in matrix_product(float*, float*, float*, int)
========= by thread (28,0,0) in block (10,0,0)
========= Address 0x503120670 is out of bounds
========= Saved host backtrace up to driver entry point at kernel launch time
========= Host Frame:/usr/lib/libcuda.so (cuLaunchKernel + 0x2c5) [0x14ad95]
========= Host Frame:./eigenvalues [0x1b768]
========= Host Frame:./eigenvalues [0x3c0a3]
========= Host Frame:./eigenvalues [0x3ead]
========= Host Frame:./eigenvalues [0x37d6]
========= Host Frame:./eigenvalues [0x3812]
========= Host Frame:./eigenvalues [0x3388]
========= Host Frame:./eigenvalues [0x35da]
========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main + 0xfd) [0x1eead]
========= Host Frame:./eigenvalues [0x2c39]
=========
========= Invalid __global__ read of size 4
========= at 0x00000140 in matrix_product(float*, float*, float*, int)
========= by thread (27,0,0) in block (10,0,0)
========= Address 0x50312066c is out of bounds
========= Saved host backtrace up to driver entry point at kernel launch time
========= Host Frame:/usr/lib/libcuda.so (cuLaunchKernel + 0x2c5) [0x14ad95]
========= Host Frame:./eigenvalues [0x1b768]
========= Host Frame:./eigenvalues [0x3c0a3]
========= Host Frame:./eigenvalues [0x3ead]
========= Host Frame:./eigenvalues [0x37d6]
========= Host Frame:./eigenvalues [0x3812]
========= Host Frame:./eigenvalues [0x3388]
========= Host Frame:./eigenvalues [0x35da]
========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main + 0xfd) [0x1eead]
========= Host Frame:./eigenvalues [0x2c39]
=========
========= Invalid __global__ read of size 4
========= at 0x00000140 in matrix_product(float*, float*, float*, int)
========= by thread (26,0,0) in block (10,0,0)
========= Address 0x503120668 is out of bounds
========= Saved host backtrace up to driver entry point at kernel launch time
========= Host Frame:/usr/lib/libcuda.so (cuLaunchKernel + 0x2c5) [0x14ad95]
========= Host Frame:./eigenvalues [0x1b768]
========= Host Frame:./eigenvalues [0x3c0a3]
========= Host Frame:./eigenvalues [0x3ead]
========= Host Frame:./eigenvalues [0x37d6]
========= Host Frame:./eigenvalues [0x3812]
========= Host Frame:./eigenvalues [0x3388]
========= Host Frame:./eigenvalues [0x35da]
========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main + 0xfd) [0x1eead]
========= Host Frame:./eigenvalues [0x2c39]
=========
========= Invalid __global__ read of size 4
========= at 0x00000140 in matrix_product(float*, float*, float*, int)
========= by thread (25,0,0) in block (10,0,0)
========= Address 0x503120664 is out of bounds
========= Saved host backtrace up to driver entry point at kernel launch time
========= Host Frame:/usr/lib/libcuda.so (cuLaunchKernel + 0x2c5) [0x14ad95]
========= Host Frame:./eigenvalues [0x1b768]
========= Host Frame:./eigenvalues [0x3c0a3]
========= Host Frame:./eigenvalues [0x3ead]
========= Host Frame:./eigenvalues [0x37d6]
========= Host Frame:./eigenvalues [0x3812]
========= Host Frame:./eigenvalues [0x3388]
========= Host Frame:./eigenvalues [0x35da]
========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main + 0xfd) [0x1eead]
========= Host Frame:./eigenvalues [0x2c39]
=========
========= Invalid __global__ read of size 4
========= at 0x00000140 in matrix_product(float*, float*, float*, int)
========= by thread (24,0,0) in block (10,0,0)
========= Address 0x503120660 is out of bounds
========= Saved host backtrace up to driver entry point at kernel launch time
========= Host Frame:/usr/lib/libcuda.so (cuLaunchKernel + 0x2c5) [0x14ad95]
========= Host Frame:./eigenvalues [0x1b768]
========= Host Frame:./eigenvalues [0x3c0a3]
========= Host Frame:./eigenvalues [0x3ead]
========= Host Frame:./eigenvalues [0x37d6]
========= Host Frame:./eigenvalues [0x3812]
========= Host Frame:./eigenvalues [0x3388]
========= Host Frame:./eigenvalues [0x35da]
========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main + 0xfd) [0x1eead]
========= Host Frame:./eigenvalues [0x2c39]
=========
========= Invalid __global__ read of size 4
========= at 0x00000140 in matrix_product(float*, float*, float*, int)
========= by thread (23,0,0) in block (10,0,0)
========= Address 0x50312065c is out of bounds
========= Saved host backtrace up to driver entry point at kernel launch time
========= Host Frame:/usr/lib/libcuda.so (cuLaunchKernel + 0x2c5) [0x14ad95]
========= Host Frame:./eigenvalues [0x1b768]
========= Host Frame:./eigenvalues [0x3c0a3]
========= Host Frame:./eigenvalues [0x3ead]
========= Host Frame:./eigenvalues [0x37d6]
========= Host Frame:./eigenvalues [0x3812]
========= Host Frame:./eigenvalues [0x3388]
========= Host Frame:./eigenvalues [0x35da]
========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main + 0xfd) [0x1eead]
========= Host Frame:./eigenvalues [0x2c39]
=========
========= Invalid __global__ read of size 4
========= at 0x00000140 in matrix_product(float*, float*, float*, int)
========= by thread (22,0,0) in block (10,0,0)
========= Address 0x503120658 is out of bounds
========= Saved host backtrace up to driver entry point at kernel launch time
========= Host Frame:/usr/lib/libcuda.so (cuLaunchKernel + 0x2c5) [0x14ad95]
========= Host Frame:./eigenvalues [0x1b768]
========= Host Frame:./eigenvalues [0x3c0a3]
========= Host Frame:./eigenvalues [0x3ead]
========= Host Frame:./eigenvalues [0x37d6]
========= Host Frame:./eigenvalues [0x3812]
========= Host Frame:./eigenvalues [0x3388]
========= Host Frame:./eigenvalues [0x35da]
========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main + 0xfd) [0x1eead]
========= Host Frame:./eigenvalues [0x2c39]
=========
========= Invalid __global__ read of size 4
========= at 0x00000140 in matrix_product(float*, float*, float*, int)
========= by thread (21,0,0) in block (10,0,0)
========= Address 0x503120654 is out of bounds
========= Saved host backtrace up to driver entry point at kernel launch time
========= Host Frame:/usr/lib/libcuda.so (cuLaunchKernel + 0x2c5) [0x14ad95]
========= Host Frame:./eigenvalues [0x1b768]
========= Host Frame:./eigenvalues [0x3c0a3]
========= Host Frame:./eigenvalues [0x3ead]
========= Host Frame:./eigenvalues [0x37d6]
========= Host Frame:./eigenvalues [0x3812]
========= Host Frame:./eigenvalues [0x3388]
========= Host Frame:./eigenvalues [0x35da]
========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main + 0xfd) [0x1eead]
========= Host Frame:./eigenvalues [0x2c39]
=========
========= Invalid __global__ read of size 4
========= at 0x00000140 in matrix_product(float*, float*, float*, int)
========= by thread (20,0,0) in block (10,0,0)
========= Address 0x503120650 is out of bounds
========= Saved host backtrace up to driver entry point at kernel launch time
========= Host Frame:/usr/lib/libcuda.so (cuLaunchKernel + 0x2c5) [0x14ad95]
========= Host Frame:./eigenvalues [0x1b768]
========= Host Frame:./eigenvalues [0x3c0a3]
========= Host Frame:./eigenvalues [0x3ead]
========= Host Frame:./eigenvalues [0x37d6]
========= Host Frame:./eigenvalues [0x3812]
========= Host Frame:./eigenvalues [0x3388]
========= Host Frame:./eigenvalues [0x35da]
========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main + 0xfd) [0x1eead]
========= Host Frame:./eigenvalues [0x2c39]
=========
========= Invalid __global__ read of size 4
========= at 0x00000140 in matrix_product(float*, float*, float*, int)
========= by thread (19,0,0) in block (10,0,0)
========= Address 0x50312064c is out of bounds
========= Saved host backtrace up to driver entry point at kernel launch time
========= Host Frame:/usr/lib/libcuda.so (cuLaunchKernel + 0x2c5) [0x14ad95]
========= Host Frame:./eigenvalues [0x1b768]
========= Host Frame:./eigenvalues [0x3c0a3]
========= Host Frame:./eigenvalues [0x3ead]
========= Host Frame:./eigenvalues [0x37d6]
========= Host Frame:./eigenvalues [0x3812]
========= Host Frame:./eigenvalues [0x3388]
========= Host Frame:./eigenvalues [0x35da]
========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main + 0xfd) [0x1eead]
========= Host Frame:./eigenvalues [0x2c39]
=========
========= Invalid __global__ read of size 4
========= at 0x00000140 in matrix_product(float*, float*, float*, int)
========= by thread (18,0,0) in block (10,0,0)
========= Address 0x503120648 is out of bounds
========= Saved host backtrace up to driver entry point at kernel launch time
========= Host Frame:/usr/lib/libcuda.so (cuLaunchKernel + 0x2c5) [0x14ad95]
========= Host Frame:./eigenvalues [0x1b768]
========= Host Frame:./eigenvalues [0x3c0a3]
========= Host Frame:./eigenvalues [0x3ead]
========= Host Frame:./eigenvalues [0x37d6]
========= Host Frame:./eigenvalues [0x3812]
========= Host Frame:./eigenvalues [0x3388]
========= Host Frame:./eigenvalues [0x35da]
========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main + 0xfd) [0x1eead]
========= Host Frame:./eigenvalues [0x2c39]
=========
========= Invalid __global__ read of size 4
========= at 0x00000140 in matrix_product(float*, float*, float*, int)
========= by thread (17,0,0) in block (10,0,0)
========= Address 0x503120644 is out of bounds
========= Saved host backtrace up to driver entry point at kernel launch time
========= Host Frame:/usr/lib/libcuda.so (cuLaunchKernel + 0x2c5) [0x14ad95]
========= Host Frame:./eigenvalues [0x1b768]
========= Host Frame:./eigenvalues [0x3c0a3]
========= Host Frame:./eigenvalues [0x3ead]
========= Host Frame:./eigenvalues [0x37d6]
========= Host Frame:./eigenvalues [0x3812]
========= Host Frame:./eigenvalues [0x3388]
========= Host Frame:./eigenvalues [0x35da]
========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main + 0xfd) [0x1eead]
========= Host Frame:./eigenvalues [0x2c39]
=========
========= Invalid __global__ read of size 4
========= at 0x00000140 in matrix_product(float*, float*, float*, int)
========= by thread (16,0,0) in block (10,0,0)
========= Address 0x503120640 is out of bounds
========= Saved host backtrace up to driver entry point at kernel launch time
========= Host Frame:/usr/lib/libcuda.so (cuLaunchKernel + 0x2c5) [0x14ad95]
========= Host Frame:./eigenvalues [0x1b768]
========= Host Frame:./eigenvalues [0x3c0a3]
========= Host Frame:./eigenvalues [0x3ead]
========= Host Frame:./eigenvalues [0x37d6]
========= Host Frame:./eigenvalues [0x3812]
========= Host Frame:./eigenvalues [0x3388]
========= Host Frame:./eigenvalues [0x35da]
========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main + 0xfd) [0x1eead]
========= Host Frame:./eigenvalues [0x2c39]
=========
========= Invalid __global__ read of size 4
========= at 0x00000140 in matrix_product(float*, float*, float*, int)
========= by thread (15,0,0) in block (10,0,0)
========= Address 0x50312063c is out of bounds
========= Saved host backtrace up to driver entry point at kernel launch time
========= Host Frame:/usr/lib/libcuda.so (cuLaunchKernel + 0x2c5) [0x14ad95]
========= Host Frame:./eigenvalues [0x1b768]
========= Host Frame:./eigenvalues [0x3c0a3]
========= Host Frame:./eigenvalues [0x3ead]
========= Host Frame:./eigenvalues [0x37d6]
========= Host Frame:./eigenvalues [0x3812]
========= Host Frame:./eigenvalues [0x3388]
========= Host Frame:./eigenvalues [0x35da]
========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main + 0xfd) [0x1eead]
========= Host Frame:./eigenvalues [0x2c39]
=========
========= Invalid __global__ read of size 4
========= at 0x00000140 in matrix_product(float*, float*, float*, int)
========= by thread (14,0,0) in block (10,0,0)
========= Address 0x503120638 is out of bounds
========= Saved host backtrace up to driver entry point at kernel launch time
========= Host Frame:/usr/lib/libcuda.so (cuLaunchKernel + 0x2c5) [0x14ad95]
========= Host Frame:./eigenvalues [0x1b768]
========= Host Frame:./eigenvalues [0x3c0a3]
========= Host Frame:./eigenvalues [0x3ead]
========= Host Frame:./eigenvalues [0x37d6]
========= Host Frame:./eigenvalues [0x3812]
========= Host Frame:./eigenvalues [0x3388]
========= Host Frame:./eigenvalues [0x35da]
========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main + 0xfd) [0x1eead]
========= Host Frame:./eigenvalues [0x2c39]
=========
========= Invalid __global__ read of size 4
========= at 0x00000140 in matrix_product(float*, float*, float*, int)
========= by thread (13,0,0) in block (10,0,0)
========= Address 0x503120634 is out of bounds
========= Saved host backtrace up to driver entry point at kernel launch time
========= Host Frame:/usr/lib/libcuda.so (cuLaunchKernel + 0x2c5) [0x14ad95]
========= Host Frame:./eigenvalues [0x1b768]
========= Host Frame:./eigenvalues [0x3c0a3]
========= Host Frame:./eigenvalues [0x3ead]
========= Host Frame:./eigenvalues [0x37d6]
========= Host Frame:./eigenvalues [0x3812]
========= Host Frame:./eigenvalues [0x3388]
========= Host Frame:./eigenvalues [0x35da]
========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main + 0xfd) [0x1eead]
========= Host Frame:./eigenvalues [0x2c39]
=========
========= Invalid __global__ read of size 4
========= at 0x00000140 in matrix_product(float*, float*, float*, int)
========= by thread (12,0,0) in block (10,0,0)
========= Address 0x503120630 is out of bounds
========= Saved host backtrace up to driver entry point at kernel launch time
========= Host Frame:/usr/lib/libcuda.so (cuLaunchKernel + 0x2c5) [0x14ad95]
========= Host Frame:./eigenvalues [0x1b768]
========= Host Frame:./eigenvalues [0x3c0a3]
========= Host Frame:./eigenvalues [0x3ead]
========= Host Frame:./eigenvalues [0x37d6]
========= Host Frame:./eigenvalues [0x3812]
========= Host Frame:./eigenvalues [0x3388]
========= Host Frame:./eigenvalues [0x35da]
========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main + 0xfd) [0x1eead]
========= Host Frame:./eigenvalues [0x2c39]
=========
========= Invalid __global__ read of size 4
========= at 0x00000140 in matrix_product(float*, float*, float*, int)
========= by thread (11,0,0) in block (10,0,0)
========= Address 0x50312062c is out of bounds
========= Saved host backtrace up to driver entry point at kernel launch time
========= Host Frame:/usr/lib/libcuda.so (cuLaunchKernel + 0x2c5) [0x14ad95]
========= Host Frame:./eigenvalues [0x1b768]
========= Host Frame:./eigenvalues [0x3c0a3]
========= Host Frame:./eigenvalues [0x3ead]
========= Host Frame:./eigenvalues [0x37d6]
========= Host Frame:./eigenvalues [0x3812]
========= Host Frame:./eigenvalues [0x3388]
========= Host Frame:./eigenvalues [0x35da]
========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main + 0xfd) [0x1eead]
========= Host Frame:./eigenvalues [0x2c39]
=========
========= Invalid __global__ read of size 4
========= at 0x00000140 in matrix_product(float*, float*, float*, int)
========= by thread (10,0,0) in block (10,0,0)
========= Address 0x503120628 is out of bounds
========= Saved host backtrace up to driver entry point at kernel launch time
========= Host Frame:/usr/lib/libcuda.so (cuLaunchKernel + 0x2c5) [0x14ad95]
========= Host Frame:./eigenvalues [0x1b768]
========= Host Frame:./eigenvalues [0x3c0a3]
========= Host Frame:./eigenvalues [0x3ead]
========= Host Frame:./eigenvalues [0x37d6]
========= Host Frame:./eigenvalues [0x3812]
========= Host Frame:./eigenvalues [0x3388]
========= Host Frame:./eigenvalues [0x35da]
========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main + 0xfd) [0x1eead]
========= Host Frame:./eigenvalues [0x2c39]
=========
========= Invalid __global__ read of size 4
========= at 0x00000140 in matrix_product(float*, float*, float*, int)
========= by thread (9,0,0) in block (10,0,0)
========= Address 0x503120624 is out of bounds
========= Saved host backtrace up to driver entry point at kernel launch time
========= Host Frame:/usr/lib/libcuda.so (cuLaunchKernel + 0x2c5) [0x14ad95]
========= Host Frame:./eigenvalues [0x1b768]
========= Host Frame:./eigenvalues [0x3c0a3]
========= Host Frame:./eigenvalues [0x3ead]
========= Host Frame:./eigenvalues [0x37d6]
========= Host Frame:./eigenvalues [0x3812]
========= Host Frame:./eigenvalues [0x3388]
========= Host Frame:./eigenvalues [0x35da]
========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main + 0xfd) [0x1eead]
========= Host Frame:./eigenvalues [0x2c39]
=========
P1
9 4.57762e-41 -1.19245e-07
4.57762e-41 2.10195e-44 0
5.1848e-44 0 0
========= ERROR SUMMARY: 23 errors
I’m not really familiar with this tool but it seems to me that matrix_product is the problem, right?