# Allocate gpu memory and share between gstreamer pipelines

**URL:** <https://forums.developer.nvidia.com/t/allocate-gpu-memory-and-share-between-gstreamer-pipelines/268433>\
**Category:** Video Codec, PyNv & OFA\
**Tags:** gstreamer, cuda, python\
**Created:** [October 4, 2023, 3:08pm UTC](https://forums.developer.nvidia.com/t/allocate-gpu-memory-and-share-between-gstreamer-pipelines/268433 "2023-10-04T15:08:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nishanth.s](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@nishanth.s](https://forums.developer.nvidia.com/u/nishanth.s)\
**Post date:** [October 4, 2023, 3:08pm UTC](https://forums.developer.nvidia.com/t/allocate-gpu-memory-and-share-between-gstreamer-pipelines/268433/1 "2023-10-04T15:08:49Z")

</div>

Hi all,

Working on gstreamer pipeline with nvidia elements.

Pipeline 1: video file as input and get bounding box predictions.

 ![p1](https://global.discourse-cdn.com/nvidia/original/4X/9/a/2/9a2e08424019361140edbd15ecee6c8e56bde5b9.png)

Pipeline 2: After post-processing logic, get frame by frame, encode video and save to file

 ![p2](https://global.discourse-cdn.com/nvidia/original/4X/f/a/2/fa2c5313e226aa4fca9545df2dded0b5a8cc8559.png)

Trying to implement the following method.

 ![gpu_memory_copy](https://global.discourse-cdn.com/nvidia/original/4X/c/3/b/c3b470d05b501e533e561bc36e8b43ae1f7bb178.png)

1. Can we allocate memory and store `gstreamer nvbuffer` to new GPU memory without copying to CPU ? the new GPU memory will be used in pipeline 2.
2. Do we have example code for achieving this using deepstream-python?
3. Can we achieve this using `NvBufSuface` python APIs ?
