Orin agx 中使用vpi 接口vpiImageSetWrapper报错

Jetson 模组
[*] Jetson AGX Orin

Jetson 软件
[*] JetPack 5.1.1

VPI 版本 2.2.6

问题描述
1.使用vpiImageCreateWrapperOpenCVMat 包装一个cpu上的cv::Mat mat1 得到VPIImage wrap1
2. 调用vpiSubmitConvertImageFormat 将转换结果写入到上面包装的VPIImage wrap1中
3. cpu内存上申请一个大小格式与mat1完全相同的cv::Mat mat2
4. 基于mat2构造一个VPIImageData
5. 调用vpiImageSetWrapper 将 4中构造的VPIImageData 替换到wrap1中
出现报错 :
vpi op failed vpiImageSetWrapper(output_wrap, &out_imgdata) VPI_ERROR_INVALID_ARGUMENT: Buffer can’t be wrapped by this container

错误码
VPI_ERROR_INVALID_ARGUMENT

错误日志
vpi op failed vpiImageSetWrapper(output_wrap, &out_imgdata) VPI_ERROR_INVALID_ARGUMENT: Buffer can’t be wrapped by this container

*** Please note that this reply is generated by LLM automatically ***

The question appears to be related to an error encountered while using the Jetson AGX Orin with JetPack 5.1.1 and VPI (Vision Programming Interface). The error message indicates that there is an issue with wrapping a buffer with a container, specifically a VPIImageData object.

After analyzing the provided context, I found several topics related to Jetson AGX Orin, JetPack, and VPI. However, none of them directly address the error message provided.

One possible cause of the error could be a mismatch between the buffer format and the container format. The VPIImageData object is used to represent image data, and the vpiImageSetWrapper function is used to set the wrapper for a VPIImage object. The error message suggests that the buffer cannot be wrapped by the container, which could indicate a format mismatch.

To troubleshoot this issue, I would recommend checking the following:

  1. Verify that the buffer format matches the container format. Ensure that the buffer is in a format that can be wrapped by the VPIImageData container.
  2. Check the documentation for vpiImageSetWrapper and VPIImageData to ensure that the correct parameters are being passed.
  3. Review the VPI programming guide to ensure that the correct steps are being followed for creating and manipulating VPIImage objects.

If the issue persists, it may be helpful to provide more context or code snippets to further diagnose the problem.

In comparison to other topics in the provided context, this issue appears to be specific to the Jetson AGX Orin and VPI. Other topics related to Jetson AGX Orin, such as container runtime issues or PCIe problems, do not seem to be directly related to this error message.

*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***

Hi,
It looks like the function calls are invalid. Please follow the samples in/opt/nvidia/vpi to implement your use-case.

那应该如何做呢,我的目的是每次convert后将outputWrap中的cpu内存地址更新,这样可以避免每次重新申请一个VPIImage,因为这个操作很耗时