JPEG encoding reports "Surface not registered" after hundreds of images on Jetpack 5.x

We use NvJPEGEncoder to encode images (resolution: 1920x1080, color format: NVBUF_COLOR_FORMAT_YUV420):

NVJPGGetSurfPinHandle 91: NVJPGGetSurfPinHandle : Surface not registered
NVJPGPushSurfFalconMethodRelocShift 369: Surface not registered
tvmrNvjpgJPEGEncFeedFrame_safe 583: NVJPGPushSurfFalconMethodRelocShift failed for SET_CUR_PIC_CHROMA_U with error 0x4
NVJPGGetSurfPinHandle 91: NVJPGGetSurfPinHandle : Surface not registered
NVJPGPushSurfFalconMethodRelocShift 369: Surface not registered
tvmrNvjpgJPEGEncFeedFrame_safe 590: NVJPGPushSurfFalconMethodRelocShift failed for SET_CUR_PIC_CHROMA_V with error 0x4
NvRmHost1xStreamEndClass: Requested number of operations in StreamBegin not yet pushed
NvRmHost1xStreamEnd: StreamEndClass failed, err = 8
pushNVJPGStreamEnd 153: Stream end failed
tvmrNvjpgJPEGEncFeedFrame_safe 597: Call to pushNVJPGStreamEnd failed with error 0x1
tvmrNvjpgJPEGEncFeedFrame_safe 605: Stream flush failed with error 0x8

Thread 103 "mediapipe/44073" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xfffedffec900 (LWP 440733)]
0x0000ffffe8ef01c4 in jpeg_write_raw_data () from /usr/lib/aarch64-linux-gnu/tegra/libnvjpeg.so
(gdb) bt
#0  0x0000ffffe8ef01c4 in jpeg_write_raw_data () at /usr/lib/aarch64-linux-gnu/tegra/libnvjpeg.so
#1  0x0000ffffe9d53148 in NvJPEGEncoder::encodeFromFd(int, J_COLOR_SPACE, unsigned char**, unsigned long&, int) (this=
    0xffff4c0034e0, fd=277, color_space=JCS_YCbCr, out_buf=0xfffedffeb120, out_buf_size=@0xfffedffeb130: 1555200, quality=90)
    at /home/work/workspace/jetson/jetson_multimedia_api_35.1.0/samples/common/classes/NvJpegEncoder.cpp:115
...

Any idea for this problem?

Hi,
The latest release is 5.1.1. Please check if you can run 05_jpeg_encode sample to reproduce the failure. If yes, please share us the command and we will set up and try to replicate the failure.

The sample is ok, we encounter this problem only after correctly encoding hundreds of images, any idea what might be related to?

Hi,
It might be a bug in low-level and we would need to reporduce it and check further. Would need your help to check if it can be reproduced on Jetpack 5.1.1. And share us a method to reproduce it.

Hi, thanks for responding, we might need some time to prepare the reproducible method even through it’s easy in our product, I’ll let you know if we’re ready.

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