What are the timing semantics of cuEGLStreamConsumerAcquireFrame?

Is it CPU-synchronous or not? Does it stall the GPU execution stream mid-run because the CPU can’t queue more work on the stream until after preceding GPU work on the acquired frame has completed?

It takes a CUstream, so you’d think it worked asynchronously. But, it returns the frame synchronously and then you pass that frame to cuGraphicsResourceGetMappedEglFrame definitely works synchronously. And, you can’t queue a kernel to consume the frame until after you have it’s address.


The time for a new frame to be acquired.
Please check below for the details:



I’m not asking about the timeout parameter.

Does the function synchronize the GPU with the CPU?

For example:

cuEGLStreamConsumerAcquireFrame(&conn_, &resource, &stream_, timeout);

// Do we need to call cuStreamSynchronize(stream_) here?

cuGraphicsResourceGetMappedEglFrame(&eglFrame, resource, 0, 0);

cuEGLStreamConsumerReleaseFrame(&conn_, resource, &stream_);



This function maps the pinned CPU buffer into EGL driver.
Since it is a zero-copy mechanism, there is no GPU computation.

You don’t need to call the cuStreamSynchronize in the case above.
Instead, please validate if cuEGLStreamConsumerAcquireFrame return success.


1 Like