**• Hardware Platform (Jetson / GPU) - GPU
• DeepStream Version 6.4
• JetPack Version (valid for Jetson only)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only) 12.2 CUDA, Driver Version: 510.60.02
**. VPI Version: 3.0
**• Issue Type:
I want to transfer my GPU frame buffer from NvBufSurface to VPIImage directly (without bringing it down to CPU)
Eg:
NvDsFrameMeta *frame_meta = (NvDsFrameMeta *) (l_frame->data);
int _id = frame_meta->batch_id;
uint32_t width = surface->surfaceList[_id].width;
uint32_t height = surface->surfaceList[_id].height;
uint32_t pitch = surface->surfaceList[_id].pitch;
uint32_t _size = surface->surfaceList[_id].dataSize;
NvBufSurfaceColorFormat fmt = surface->surfaceList[_id].colorFormat;
void *cudaPtr = surface->surfaceList[_id].dataPtr;
NvDsFrameMeta *frame_meta = (NvDsFrameMeta *) (l_frame->data);
int _id = frame_meta->batch_id;
uint32_t width = surface->surfaceList[_id].width;
uint32_t height = surface->surfaceList[_id].height;
uint32_t pitch = surface->surfaceList[_id].pitch;
uint32_t _size = surface->surfaceList[_id].dataSize;
NvBufSurfaceColorFormat fmt = surface->surfaceList[_id].colorFormat;
void *cudaPtr = surface->surfaceList[_id].dataPtr;
// This causes Seg Fault.
cudaError_t cudaErr = cudaMemcpy2D (&vpiImage, pitch, cudaPtr, pitch, pitch, height, cudaMemcpyDeviceToHost);
Am I doing something wrong here?
What is the correct way of performing this since there is no existing wrapper function in VPI for this.