problem with memory access

Hello. I have one problem with running of my application in debug mode (Visual Studio 2012, Nsight Visual Studio Edition Version 5.2). There is an error “an illegal memory access was encountered” when i do cudaMemcpy from DevicetoDevice or from DeviceToHost. When I run my application in release mode everething is all right and there is no any errors with memory access.
If sombody knows smth about this porblem help please.
Thanks, Mike

Hmm, have you run your code through cuda-memcheck? It might also help us if you posted what you believe to be the relevant code snippets.

Thanks for your help, but i revealed that problem was in visual studio 2012. I don’t know what exactly it is, but if i run my application in VS2015 everething is all right. VS2012 doesn’t work correctly on my PC and i have no any idea why).
Best regards,
Mike

Mike, also be aware that Nvidia highly suggest that whenever you compile you do so in release mode in Visual Studio. There are some issues with compiling in debug mode.

You should be able to compile in debug mode.

The only general caveat that I know of is that in debug mode, it’s not recommended to do performance analysis, and of course if you want production level performance, you should compile in release mode.

This is news to me, and I am not aware of statements by NVIDIA to that effect. Would you happen to have a relevant pointer handy?