NvBufSurfTransform is very slow the first time it is executed on GPU

environment: jetson orin NX, Jetpack 35.6
when I run NvBufSurfTransform(srcNvBufSurf, dstNvBufSurf, &resizeTransParams) is very slow the first time it is executed on GPU.

static bool nvBufSurfaceResize(NvBufSurface *src, NvBufSurface *dst,
                                                       NvBufSurfTransformConfigParams &transformConfigParams) {
            NvBufSurfTransformParams resizeTransParams;
            memset(&resizeTransParams, 0, sizeof(resizeTransParams));
            resizeTransParams.transform_flag = NVBUFSURF_TRANSFORM_FILTER;
            resizeTransParams.transform_filter = NvBufSurfTransformInter_Algo4;

            NvBufSurfaceMemSet(dstNvBufSurf, 0, 0, 0);

            uint32_t inputWidth = srcNvBufSurf->surfaceList[0].width;
            uint32_t inputHeight = srcNvBufSurf->surfaceList[0].height;
            uint32_t outputWidth = dstNvBufSurf->surfaceList[0].width;
            uint32_t outputHeight = dstNvBufSurf->surfaceList[0].height;

            NvBufSurfTransformRect srcRect = {0, 0, inputWidth, inputHeight};
            NvBufSurfTransformRect destRect = {0, 0, outputWidth, outputHeight};

            // Set the transform parameters
            resizeTransParams.src_rect = &srcRect;
            resizeTransParams.dst_rect = &destRect;

            if (NvBufSurfTransformSetSessionParams(&transformConfigParams) != NvBufSurfTransformError_Success) {
                return false;
            }

            if (NvBufSurfTransform(srcNvBufSurf, dstNvBufSurf, &resizeTransParams)) {
                return false;
            }
            return true;
        }

Hi,
Please check if you can reproduce it by running 07_video_convert sample. If yes, please share us the patch and steps. We will set up developer kit and check.

Also please use VIC engine as a quick solution.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.