VPI 1.2 NvBuffer wrapper fails with GRAY8, XRGB32, etc


I’ve been trying to use NvBuffers directly with VPI 1.2, but I can only upload NV12 and ABGR32. If I try to use any other format vpiImageCreateNvBufferWrapper will fail.

When using GRAY8 specifically I get the following log:

NVMEDIA_ARRAY:   53,  Version 2.1
NVMEDIA_VPI :  172,  Version 2.4
[NvMediaEglFillLocalImageSurface:508] Surface format of acquired frame(type = 5) and Surface format of consumer(type = 128)do not match.
VPINvMediaEglStreamConsumerAcquireCommon: Acquire: EGLExports.stream2.consumer.publicStateGet failed (4)
[WARN ] 2022-07-27 15:00:35 (NvError_InvalidState)
[WARN ] 2022-07-27 15:00:35 (NvError_BadParameter)
[VPINvMediaEglStreamConsumerAcquireImage:1044] Consumer acquire failed: 7

Other formats sometimes just fail or print something similar. I haven’t found any format restrictions for this function. Is this expected or is this an error?

I would appreciate it if you could provide some insight into the supported formats for this function. And if VPI2 is any different.


Would you mind sharing a simple source to reproduce this on VPI 1.2?
Since NvBuffer is deprecated in rel-35, we need to check the wrapper in detail with our internal team first.


Hi @AastaLLL ,

Thanks for your response. Here is a simple code that reproduces the issue.
example.c (1.2 KB)


We test your source on JetPack 4.6.2 with VPI 1.2.3.
The test can work without issue:

$ g++ example.c -o out -I/usr/src/jetson_multimedia_api/include -L/usr/lib/aarch64-linux-gnu/tegra -lnvvpi -lnvbuf_utils
$ ./out 
NVMEDIA_ARRAY:   53,  Version 2.1
NVMEDIA_VPI :  172,  Version 2.4
Returned without errors.


Thank you very much. However, I think I mixed up the VPI version since I was reading the documentation for VPI 1.2. Could you also test this source with JetPack 4.5.1, please?

I’ll also be testing with 4.6.2 to see if it suits our needs


Did you have any dependency on JetPack 4.5.1?
If not, it’s recommended to use the latest JetPack 4.


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