after cudaMemcpy2D, you can dump hardware buffer to check if the data is valid. please refer to this topic for NV12 format to GpuMat. please refer to this topic.