When using the NvJPEGEncoder interface of jetson_multimedia_api, connecting the DP port to a monitor will affect the encoding performance

HI:

My device is: Jetson AGX Orin Developer Kit
The version of jetpack is:
Package: nvidia-jetpack
Version: 5.1.2-b104

I tested jetson_multimedia_api/samples/05_jpeg_encode and added time printing in jpeg_encode_main.cpp. I found that when the DP monitor is connected, the time of end_time - start_time is about 11ms, but when the DP monitor is not connected, this time increases to more than 30ms. Can you explain this phenomenon?

        clock_gettime(CLOCK_MONOTONIC, &real_tp);
        start_time = real_tp.tv_sec * 1000000000ULL + real_tp.tv_nsec;

        ret = ctx.jpegenc->encodeFromFd(dst_dma_fd, JCS_YCbCr, &out_buf,
              out_buf_size, ctx.quality);

	clock_gettime(CLOCK_MONOTONIC, &real_tp);
        end_time = real_tp.tv_sec  * 1000000000ULL + real_tp.tv_nsec;
        cout << "nielei_debug, frame:" << file_num  <<" Time taken for encoding: " << (end_time - start_time) << " ns" << endl;

Can it be considered that NvJPEGEncoder does not use the GPU?

In addition, my image size is 1600*1300. Is the time of 11ms in line with expectations? How to improve encoding performance

In addition, when the DP monitor is connected, run jtop of NvJPEGEncoder

Hi,
Are you able to try Jetpack 6.2 r36.4.3? Certain issues are discovered and fixed in later release. Would suggest upgrade and try.

Hi, DaneLLL:

Sorry, we need to develop based on the current Jetpack and cannot upgrade.
I have a few questions:
1, Can it be considered that NvJPEGEncoder does not use the GPU? Is it a bug that NvJPEGEncoder becomes slow when not connecting a DP monitor?
2, My image size is 1600*1300. Is the time of 11ms in line with expectations? The running frequency of NvJPG is 729MHz. Can it be improved? If it cannot be increased,How to improve NvJPG encoding performance?

Thanks!

Can anyone help answer this question?

Hi,
There is individual NVJPG engine to do JPEG encoding/decoding. It is not executed on GPU. The maximum clock of each engine is listed in

Jetson Orin Nano Series, Jetson Orin NX Series and Jetson AGX Orin Series — NVIDIA Jetson Linux Developer Guide

On Orin 32GB, maximum clock of NVJPG is 729.6MHz.

If you would like to develop the use-case without display, would suggest run in headless mode. You may refer to developer guide to generate headless rootfs:

Root File System — NVIDIA Jetson Linux Developer Guide

Thank you very much for your reply.

Can you further explain the impact of connecting a monitor and not connecting a monitor on the computing resources (CPU, GPU, etc.) in the system?

From the phenomenon, it seems that connecting a monitor helps improve the performance of NvJPEGEncoder::encodeFromFd(). This is a very interesting phenomenon. I would like to know the reason.

Hi,
This is not a valid setup. We would expect display output device is present when it’s enabled in device tree. Certain use-cases may not work properly in the setup.

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