I have an application that uses cudaHostRegister() to pin some memory that is allocated externally (by the client). Everything seems to work EXCEPT when I run with cuda-gdb, where it produces an error ‘CUDBG_ERROR_INVALID_MEMORY_SEGMENT(0x7)’ at the point where I try to call cudaHostUnregister().
My first thought is that the arguments passed to cudaHostRegister (ptr and size) should be page-aligned and that is what is causing the error. Older versions of the documentation seem to state this, however in the current version of the documentation (v9.1.85) I do not see this stated anywhere.
Can anyone clarify whether the arguments passed to cudaHostRegister need to be page-aligned? Thanks in advance!
Here is the documentation in question:
http://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__MEMORY.html#group__CUDART__MEMORY_1ge8d5c17670f16ac4fc8fcb4181cb490c
EDIT - I have discovered that this issue is not related to alignment but due to trying to trying to register/unregister small segments of memory that reside in the same 4KB page. Please see my next post below.