Couldn't create nvvic Session: Cannot allocate memory

environment: jetson orin NX ,Jetpack 35.6
when I run NvBufSurfTransform,

static bool
        nvBufSurfaceCropWithBufSurface(NvBufSurface *srcNvBufSurf, NvBufSurface *dstNvBufSurf, uint32_t startX,
                                       uint32_t startY,
                                       uint32_t width, uint32_t height,
                                       NvBufSurfTransformConfigParams &transformConfigParams) {
            if (NvBufSurfTransformSetSessionParams(&transformConfigParams) != NvBufSurfTransformError_Success) {
                spdlog::error(
                        "NvBufSurfTransformSetSessionParams failed with error in nvBufSurfaceCropWithBufSurface\n");
            }

            NvBufSurfTransformParams cropTransParams;
            memset(&cropTransParams, 0, sizeof(cropTransParams));
            cropTransParams.transform_flag = NVBUFSURF_TRANSFORM_CROP_SRC | NVBUFSURF_TRANSFORM_CROP_DST;
            cropTransParams.transform_filter = NvBufSurfTransformInter_Algo3;

            NvBufSurfTransformRect srcRect = {startY,startX, width, height};
            NvBufSurfTransformRect destRect = {0, 0, dstNvBufSurf->surfaceList[0].width,
                                               dstNvBufSurf->surfaceList[0].height};

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

            if (NvBufSurfTransform(srcNvBufSurf, dstNvBufSurf, &cropTransParams)) {
                spdlog::error("Failed to convert the crop buffer in nvBufSurfaceCropWithBufSurface, {}, {}\n", srcNvBufSurf->surfaceList[0].bufferDesc, dstNvBufSurf->surfaceList[0].bufferDesc);
                return false;
            }

            return true;
        }
NVMAP_IOC_GET_FD failed: Bad address
NVMAP_IOC_GET_FD failed: Bad address
NVMAP_IOC_GET_FD failed: Bad address
NvRmStream: Channel submission failed (err=196623)
NvRmStream: Flush failed (err=196623)
/dvs/git/dirty/git-master_linux/nvutils/nvbufsurftransform/nvbufsurftransform.cpp:4594: => NvVicCompose Failed

[2025-01-23 06:11:29.597] [error] Failed to convert the crop buffer in nvBufSurfaceCropWithBufSurface, 314, 562

NVMAP_IOC_GET_FD failed: Bad address
PosixMemMap:74 FD from Handle failed : Bad address
NvRmStream: Buffer mapping failed (err=196611)
Couldn't create nvvic Session: Cannot allocate memory

Hi,
Please refer to 07 sample. The NvBufSurface APIs are demonstrated in the sample.

yeah, my demo function is the same as the 07 example, I allocate the nvbufsurface outside this function in the same way. here still can met this error(Couldn’t create nvvic Session: Cannot allocate memory).

Hi,
It seems like you don’t create the session. Please check if you call the function of creating session beforehand.

I had created the NvBufSurfTransformConfigParams out of the function

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