before using zero copy,i found that my application would be killed because i use of malloc cpu memory or memcpy from cpu to gpu frequently.
And now i use zero copy with these code without using cudaHostGetDevicePointer(&ans,res,0).
Hi there, I have checked the pointers you mentioned and they are absolutely identical.What confuses me is that why my program gets killed, and I am certain that it is NOT because the RAM explodes. Could you tell me is there any logs I can check?
I assume that you run the zeroCopyTestGPU function more than once?
You call both cudaMalloc() and cudaHostAlloc() without deallocating those buffers.
Presumably, you leak those buffers, and run out of memory, and that’s why your program dies.
If you run the program through the debugger (like gdb) what does it say when it dies?
It’s still recommended to use cudaHostGetDevicePointer for the device pointer.
It may happen to be identical but not always guaranteed.
Another possible reason to lead to killed error is that the concurrent access.
Have you added the synchronization call before accessing the buffer with another process?
Hi,
for reason of the concurrent access,I make sure that my program is have not the concurrent access.And I have tested my program for 24 hours,the killed situation is not happening.Thanks for your reply.I will check it continue.
Thanks