Nvbufsurface: Failed to create EGLImage & ERROR from primary_gie: Failed to set buffer pool to active

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU)
Jetson AGX Orin
• DeepStream Version
6.3
• JetPack Version (valid for Jetson only)
5.1.2
• Issue Type( questions, new requirements, bugs)
question

Hi, I have yolov7 tiny model and I convert it to onnx model work with deepstream using Deepstream-Yolo package. When I tried to convert onnx to engine file with this package I am getting errors as follows:

WARNING: [TRT]: Unknown embedded device detected. Using 59659MiB as the allocation cap for memory on embedded devices.
Building complete

0:05:32.596015447 32657 0xaaaacd3fcea0 INFO                 nvinfer gstnvinfer.cpp:682:gst_nvinfer_logger:<primary_gie> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:2034> [UID = 1]: serialize cuda engine to file: /home/ubuntu/Documents/Barkod_Gap/utils/DeepStream-Yolo/model_b1_gpu0_fp32.engine successfully
WARNING: [TRT]: The getMaxBatchSize() function should not be used with an engine built from a network created with NetworkDefinitionCreationFlag::kEXPLICIT_BATCH flag. This function will always return 1.
INFO: [Implicit Engine Info]: layers num: 4
0   INPUT  kFLOAT input           3x640x640       
1   OUTPUT kFLOAT boxes           25200x4         
2   OUTPUT kFLOAT scores          25200x1         
3   OUTPUT kFLOAT classes         25200x1         

nvbufsurface: Failed to create EGLImage.
0:05:32.921130946 32657 0xaaaacd3fcea0 WARN                 nvinfer gstnvinfer.cpp:994:gst_nvinfer_start:<primary_gie> error: Failed to set buffer pool to active
** ERROR: <main:716>: Failed to set pipeline to PAUSED
Quitting
nvstreammux: Successfully handled EOS for source_id=0
ERROR from primary_gie: Failed to set buffer pool to active
Debug info: /dvs/git/dirty/git-master_linux/deepstream/sdk/src/gst-plugins/gst-nvinfer/gstnvinfer.cpp(994): gst_nvinfer_start (): /GstPipeline:pipeline/GstBin:primary_gie_bin/GstNvInfer:primary_gie
App run failed

I have done many search about the problems, most of them was about connecting orin to monitor, now I cannot access monitor to connect orin and not sure that is related to monitor.
If it is, is it a bug? Because cannot use it with monitor all the time.

Also here are1 the files to run deepstream app.

[application]
enable-perf-measurement=1
perf-measurement-interval-sec=5

[tiled-display]
enable=1
rows=1
columns=1
width=1280
height=720
gpu-id=0
nvbuf-memory-type=0

[source0]
enable=1
type=3
uri=file:///home/ubuntu/Documents/img2vid_v2.mp4
num-sources=1
gpu-id=0
cudadec-memtype=0

[sink0]
enable=1
type=2
sync=0
gpu-id=0
nvbuf-memory-type=0

[sink1]
enable=1
#Type - 1=FakeSink 2=EglSink 3=File 4=RTSPStreaming
type=3
#1=mp4 2=mkv
container=2
#1=h264 2=h265
codec=1
#encoder type 0=Hardware 1=Software
enc-type=0
sync=1
#iframeinterval=10
bitrate=6000000
#H264 Profile - 0=Baseline 2=Main 4=High
#H265 Profile - 0=Main 1=Main10
profile=0
output-file=video.mkv
source-id=0

[osd]
enable=1
gpu-id=0
border-width=5
text-size=15
text-color=1;1;1;1;
text-bg-color=0.3;0.3;0.3;1
font=Serif
show-clock=0
clock-x-offset=800
clock-y-offset=820
clock-text-size=12
clock-color=1;0;0;0
nvbuf-memory-type=0

[streammux]
gpu-id=0
live-source=0
batch-size=1
batched-push-timeout=40000
width=1920
height=1080
enable-padding=0
nvbuf-memory-type=0

[primary-gie]
enable=1
gpu-id=0
gie-unique-id=1
nvbuf-memory-type=0
config-file=/home/ubuntu/Documents/Barkod_Gap/utils/DeepStream-Yolo/config_infer_primary_yoloV7_deneme.txt

[tests]
file-loop=0

also:


[property]
gpu-id=0
net-scale-factor=0.0039215697906911373
model-color-format=0
#custom-network-config=/home/ubuntu/Documents/Barkod_Gap/utils/DeepStream-Yolo/transfer_learning2.cfg
onnx-file=/home/ubuntu/Documents/Barkod_Gap/utils/DeepStream-Yolo/transfer_learning2.onnx
model-engine-file=/home/ubuntu/Documents/Barkod_Gap/utils/DeepStream-Yolo/transfer_learning2.engine
labelfile-path=/home/ubuntu/Documents/Barkod_Gap/utils/DeepStream-Yolo/labels_deneme.txt
batch-size=1
network-mode=0
num-detected-classes=7
interval=0
gie-unique-id=1
process-mode=1
network-type=0
cluster-mode=2
maintain-aspect-ratio=1 
symmetric-padding=1
#workspace-size=2000
parse-bbox-func-name=NvDsInferParseYolo
#parse-bbox-func-name=NvDsInferParseYoloCuda
custom-lib-path=/home/ubuntu/Documents/Barkod_Gap/utils/DeepStream-Yolo/nvdsinfer_custom_impl_Yolo/libnvdsinfer_custom_impl_Yolo.so
engine-create-func-name=NvDsInferYoloCudaEngineGet

[class-attrs-all]
nms-iou-threshold=0.45
pre-cluster-threshold=0.25
topk=300

I have tried closing sinks, opening them, changing source0 type 2-3 but nothing solved the issue. Also when I change the xorg settings my issue changes as follows:


Opening in BLOCKING MODE 
** ERROR: <main:716>: Failed to set pipeline to PAUSED
Quitting
nvstreammux: Successfully handled EOS for source_id=0
ERROR from sink_sub_bin_sink1: GStreamer error: state change failed and some element failed to post a proper error message with the reason for the failure.
Debug info: gstbasesink.c(5367): gst_base_sink_change_state (): /GstPipeline:pipeline/GstBin:processing_bin_0/GstBin:sink_bin/GstBin:sink_sub_bin1/GstNv3dSink:sink_sub_bin_sink1:
Failed to start
App run failed

How can I solve that issue?
Have a nice day.

Could you try to run unset DISPLAY first to eliminate the effects of display?

thanks it works.

hi @yuweiw , I am facing the issue because of unset DISPLAY commnad, If I set this I cannot see osd and in osd method I am saving images where bıxes are detected that’s why also images are not saved. How can I solve this actually?

You can try to set the DISPLAY according to your display system of your jetson. Please refer to our FAQ.

If I set the display I am getting the error that I mentioned firstly in this issue.

You need to set the DISPLAY parameter according to the monitor linked to your Jetson. You can refer to our FAQ.

I have set some xorg settigs but nothing works and after unset DISPLAY I am ettin this o/p but there is no screen still.

Creating Pipeline 
 
Creating Source 
 
[INFO] [1724327360.143524814] [init_logger]: rclpy initialized
[INFO] [1724327360.220953808] [inference_publisher_node]: class setup complete
[INFO] [1724327360.221721791] [object_logger]: object initialized
Creating Video Converter 

Playing cam /dev/video0 
Adding elements to Pipeline 

Linking elements in the Pipeline 


Using winsys: x11 
gstnvtracker: Loading low-level lib at /opt/nvidia/deepstream/deepstream-6.3/lib/libnvds_nvmultiobjecttracker.so
gstnvtracker: Failed to open low-level lib at /opt/nvidia/deepstream/deepstream-6.3/lib/libnvds_nvmultiobjecttracker.so
 dlopen error: /lib/aarch64-linux-gnu/libgomp.so.1: cannot allocate memory in static TLS block
gstnvtracker: Failed to initilaize low level lib.
gstnvtracker: Loading low-level lib at /opt/nvidia/deepstream/deepstream-6.3/lib/libnvds_nvmultiobjecttracker.so
gstnvtracker: Failed to open low-level lib at /opt/nvidia/deepstream/deepstream-6.3/lib/libnvds_nvmultiobjecttracker.so
 dlopen error: /lib/aarch64-linux-gnu/libgomp.so.1: cannot allocate memory in static TLS block
gstnvtracker: Failed to initilaize low level lib.
gstnvtracker: Loading low-level lib at /opt/nvidia/deepstream/deepstream-6.3/lib/libnvds_nvmultiobjecttracker.so
gstnvtracker: Failed to open low-level lib at /opt/nvidia/deepstream/deepstream-6.3/lib/libnvds_nvmultiobjecttracker.so
 dlopen error: /lib/aarch64-linux-gnu/libgomp.so.1: cannot allocate memory in static TLS block
gstnvtracker: Failed to initilaize low level lib.
WARNING: [TRT]: Using an engine plan file across different models of devices is not recommended and is likely to affect performance or even cause errors.
0:00:05.683287609  5695     0x38ddb920 INFO                 nvinfer gstnvinfer.cpp:682:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:1988> [UID = 1]: deserialized trt engine from :/home/ubuntu/Documents/Barkod_Gap/utils/DeepStream-Yolo/transfer_learning2.engine
WARNING: [TRT]: The getMaxBatchSize() function should not be used with an engine built from a network created with NetworkDefinitionCreationFlag::kEXPLICIT_BATCH flag. This function will always return 1.
INFO: [Implicit Engine Info]: layers num: 4
0   INPUT  kFLOAT input           3x640x640       
1   OUTPUT kFLOAT boxes           25200x4         
2   OUTPUT kFLOAT scores          25200x1         
3   OUTPUT kFLOAT classes         25200x1         

0:00:05.894109194  5695     0x38ddb920 INFO                 nvinfer gstnvinfer.cpp:682:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2091> [UID = 1]: Use deserialized engine model: /home/ubuntu/Documents/Barkod_Gap/utils/DeepStream-Yolo/transfer_learning2.engine
0:00:05.924395648  5695     0x38ddb920 INFO                 nvinfer gstnvinfer_impl.cpp:328:notifyLoadModelStatus:<primary-inference> [UID 1]: Load new model:/home/ubuntu/Documents/x/gapbarkod_x/src/scripts/utils/DeepStream-Yolo/config_infer_primary_yoloV7_deneme.txt sucessfully

NOTE: I am using teamviewer to connect AGX Orin

Is your AGX Orin connected to a monitor?

No, I cannot connect it to monitor.
also I have the same problem mentioned here but there is not any solution there person did not response.

If there is no monitor connected to your board, you cannot use teamviewer to check the osd.
If you want to check the video, you should use the RTSPStreaming sink and check that with a rtsp media player like VLC, ffmpeg etc…

[sink]
enable=1
#Type - 1=FakeSink 2=EglSink 3=File 4=RTSPStreaming 5=nvdrmvideosink
type=4
#1=h264 2=h265
codec=1
#encoder type 0=Hardware 1=Software
enc-type=0
sync=0
bitrate=4000000
#H264 Profile - 0=Baseline 2=Main 4=High
#H265 Profile - 0=Main 1=Main10
# set profile only for hw encoder, sw encoder selects profile based on sw-preset
profile=0
# set below properties in case of RTSPStreaming
rtsp-port=8554
udp-port=5400

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks

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