The documentation for cudaErrorIllegalAddress says:
The device encountered a load or store instruction on an invalid memory address. This leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the process must be terminated and relaunched.
In my C++ code, I called:
cudaMemcpy( dst, src, size, kind );
How do I determine whether it is the dst
or src
that is invalid memory?
Running cuda-memcheck
reported no errors and valgrind
reports no errors. Given that this crash only happens when built with -g -G
what steps might I take to debug further? Is there a way in the device code to check if a cudaErrorIllegalAddress has occurred so I can divide and conquer where in the device code it fails?