cudaMemCpy() and Zero-Copy access


I want to copy data from linear CUDA memory to pinned memory with zero-copy access. Therefore I get a device pointer by calling cudaHostGetDevicePointer() followed by a cudaMemcpy() operation which reports the device pointer to be invalid.

Is such a copy operation forbidden? Am I supposed to call a kernel for the copy-operation?


you’re doing a cudaMemcpyDeviceToDevice? hmmm, never occurred to me! It should work in principle, but I bet it won’t right now. Might be fixed in the next version…

If cudaMemcpyDeviceToDevice doesn’t work, then I would expect that cudaMemcpyDeviceToHost using the original host pointer would be just as good.

Unless you’re being tricky and writing a framework and passing pointers everywhere… yeah, needs to be looked at. It’s on my whiteboard of things to do.

cudaMemcpyDeviceToHost works for me, thx :thumbup:

I have another question concerning zero-copy access:

If I call a kernel and pass a const device pointer to mapped memory, does the framework recognize that no device-to-host synchronization after the kernel execution is needed (in the dedicated graphics board case)?