Error: Unaligned memory accesses not supported

Hi. I’ve got the a kernel defined as followed (excerpt)

Basically there is a struct gpu_inbuffer and a member e1 that is copied into each thread’s buffer array where it gets modified and copied back afterwards. I get the following error for the memcpy line:

I get this error only when compiling the code for the device, compiling for emulation works fine and the code gives correct results. Also when trying to compile this code for the device with the -G option attached to nvcc, ptxas dies with a signal 11 (invalid memory reference).

nvcc -V gives

Could someone please provide me with some insight on that?

errr… you can’t call memcpy from a kernel (you can call standard C functions from device emulation but not from a device, so of course it doesn’t work on the device…).

the memcpy is actually

which gives the same error. the point seems to be is accessing buffer[j].

I’ve redesigned the kernel to work on big endian ints instead of char arrays. the problem went away.

I have the same problem. When I compiling the code:

char *sNextWord;

char *tmp,

sNextWord[lengthWord-1] = *(tmp);

I have error:

Error: Unaligned memory accesses not supported

You writed :

"I’ve redesigned the kernel to work on big endian ints instead of char arrays. the problem went away. "

You can explain better.

Thank you