GPUs are mapped/indexed into containers. NVIDIA provides a proprietary GPU driver for GL rendering and surface composition.
For graphics applications like Android games, GPUs render frames and pass to surfaceflinger, which supports hardware composing to render the final frames. The frame buffer properties (not frame data) are copied into shared memory for frame capture and sharing purposes.
Frame capture, encoding, and streaming modules run in the host instead of inside the Android containers. The frame capture module reads shared frame buffer properties and passes it to the CUDA based video encoder, which can directly read and encode frames composed by surfaceflinger into the video stream. Encoded video streams can be copied from GPU to CPU memory and then sent on the network.