Debug is ok,release doesn't work

I use CUDA2.0 in VS 2005 Team Edition for Software Developers, OS is Win XP 64 bit.My project works quite well in debug,but can’t run in release.
The project settings are the same for debug and release.When the project runs in release, the function cuMemcpyHtoD returns CUDA_ERROR_INVALID_VALUE.By the way, cuMemAlloc also fails after this error, it returns CUDA_ERROR_OUT_OF_MEMORY.
Anyone knows how to fix this problem,please tell me,thank you.