Initialize unified memory


I am working on jetson TX2, and I am using a Gige Camera.

I didn’t find a way to copy directly the image in unified memory (I can use pinned memory too). Is there a solution to do that ?
The pointer is not declare in unified memory, I don’t control the adress of the image provides by the camera. I have to initialize the image stocked in unified memory with a for-loop, and it takes a long time.

Thank you for your help

You may try the function:

cudaMallocManaged (&address, size, cudaMemAttachGlobal);

We have sample in


It demonstrates frame capture through v4l2. Your camera should not support v4l2, but you can refer to the part of allocating buffers.