I’ve upgraded my Orin NX to JetPack 6.2 with the super config, and repeated the experiment of converting a GStreamer buffer to a VPI Image. I’ve also included the workaround:
But still facing cudaErrorIllegalAddress error, followed by Segmentation fault (core dumped)
• How to reproduce the issue?
Please refer to this Github repository, I’ve updated the repo with DS7.1 Dockerfile, scripts and configs.
We test the sample on JetPack 6.2 (r36.4.3) with the deepstream container and it can work correctly.
$ sudo docker build . -t vpi:ds7.1 -f Dockerfile.ds7.1
$ sudo docker run -it --rm --runtime nvidia -v ${PWD}:/app/ -w /app/ vpi:ds7.1 bash
# python3 app_ds7.1.py -i file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h265.mp4
<frozen importlib._bootstrap_external>:1184: FutureWarning: The cuda.cudart module is deprecated and will be removed in a future release, please switch to use the cuda.bindings.runtime module instead.
(gst-plugin-scanner:73): GStreamer-WARNING **: 07:27:42.488: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstpulseaudio.so': libFLAC.so.8: cannot open shared object file: No such file or directory
(gst-plugin-scanner:73): GStreamer-WARNING **: 07:27:42.554: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstsndfile.so': libFLAC.so.8: cannot open shared object file: No such file or directory
(gst-plugin-scanner:73): GStreamer-WARNING **: 07:27:42.560: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstchromaprint.so': libavcodec.so.58: cannot open shared object file: No such file or directory
(gst-plugin-scanner:73): GStreamer-WARNING **: 07:27:42.565: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstmpg123.so': libmpg123.so.0: cannot open shared object file: No such file or directory
(gst-plugin-scanner:73): GStreamer-WARNING **: 07:27:42.672: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstfluidsynthmidi.so': libFLAC.so.8: cannot open shared object file: No such file or directory
(gst-plugin-scanner:73): GStreamer-WARNING **: 07:27:42.696: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstmplex.so': libmjpegutils-2.1.so.0: cannot open shared object file: No such file or directory
(gst-plugin-scanner:73): GStreamer-WARNING **: 07:27:42.706: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstlame.so': libmp3lame.so.0: cannot open shared object file: No such file or directory
(gst-plugin-scanner:73): GStreamer-WARNING **: 07:27:42.707: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstopenmpt.so': libmpg123.so.0: cannot open shared object file: No such file or directory
sh: 1: lsmod: not found
sh: 1: modprobe: not found
(Argus) Error FileOperationFailed: Connecting to nvargus-daemon failed: No such file or directory (in src/rpc/socket/client/SocketClientDispatch.cpp, function openSocketConnection(), line 205)
(Argus) Error FileOperationFailed: Cannot create camera provider (in src/rpc/socket/client/SocketClientDispatch.cpp, function createCameraProvider(), line 107)
(gst-plugin-scanner:73): GStreamer-WARNING **: 07:27:42.793: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstlibav.so': libavcodec.so.58: cannot open shared object file: No such file or directory
(gst-plugin-scanner:73): GStreamer-WARNING **: 07:27:42.795: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_udp.so': librivermax.so.0: cannot open shared object file: No such file or directory
(gst-plugin-scanner:73): GStreamer-WARNING **: 07:27:42.972: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/deepstream/libnvdsgst_inferserver.so': libtritonserver.so: cannot open shared object file: No such file or directory
Creating Pipeline
Creating streammux
Creating source_bin 0
Creating source bin
source-bin-00
/app/app_ds7.1.py:346: DeprecationWarning: Gst.Element.get_request_pad is deprecated
sinkpad = streammux.get_request_pad(padname)
Creating Pgie
Creating nvvidconv1
Creating filter1
Creating tiler
Creating nvvidconv
Creating nvosd
Creating Fakesink
Adding elements to Pipeline
Linking elements in the Pipeline
Now playing...
0 : file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h265.mp4
Starting pipeline
Setting min object dimensions as 16x16 instead of 1x1 to support VIC compute mode.
WARNING: Deserialize engine failed because file path: /opt/nvidia/deepstream/deepstream-7.1/samples/models/Primary_Detector/resnet18_trafficcamnet_pruned.onnx_b1_gpu0_int8.engine open error
0:00:00.697953186 43 0xaaaadd89c5b0 WARN nvinfer gstnvinfer.cpp:681:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::deserializeEngineAndBackend() <nvdsinfer_context_impl.cpp:2080> [UID = 1]: deserialize engine from file :/opt/nvidia/deepstream/deepstream-7.1/samples/models/Primary_Detector/resnet18_trafficcamnet_pruned.onnx_b1_gpu0_int8.engine failed
0:00:00.697985187 43 0xaaaadd89c5b0 WARN nvinfer gstnvinfer.cpp:681:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Warning from NvDsInferContextImpl::generateBackendContext() <nvdsinfer_context_impl.cpp:2185> [UID = 1]: deserialize backend context from engine from file :/opt/nvidia/deepstream/deepstream-7.1/samples/models/Primary_Detector/resnet18_trafficcamnet_pruned.onnx_b1_gpu0_int8.engine failed, try rebuild
0:00:00.697998948 43 0xaaaadd89c5b0 INFO nvinfer gstnvinfer.cpp:684:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:2106> [UID = 1]: Trying to create engine from model files
0:01:13.167403518 43 0xaaaadd89c5b0 INFO nvinfer gstnvinfer.cpp:684:gst_nvinfer_logger:<primary-inference> NvDsInferContext[UID 1]: Info from NvDsInferContextImpl::buildModel() <nvdsinfer_context_impl.cpp:2138> [UID = 1]: serialize cuda engine to file: /opt/nvidia/deepstream/deepstream-7.1/samples/models/Primary_Detector/resnet18_trafficcamnet_pruned.onnx_b1_gpu0_int8.engine successfully
Implicit layer support has been deprecated
INFO: [Implicit Engine Info]: layers num: 0
0:01:13.471200162 43 0xaaaadd89c5b0 INFO nvinfer gstnvinfer_impl.cpp:343:notifyLoadModelStatus:<primary-inference> [UID 1]: Load new model:dstest_imagedata_cupy_config_ds7.1.txt sucessfully
Decodebin child added: source
Decodebin child added: decodebin0
**PERF: {'stream0': 0.0}
Decodebin child added: qtdemux0
Decodebin child added: multiqueue0
Decodebin child added: h265parse0
Decodebin child added: capsfilter0
Warning: gst-stream-error-quark: No decoder available for type 'audio/mpeg, mpegversion=(int)4, framed=(boolean)true, stream-format=(string)raw, level=(string)2, base-profile=(string)lc, profile=(string)lc, codec_data=(buffer)119056e500, rate=(int)48000, channels=(int)2'. (6): ../gst/playback/gsturidecodebin.c(960): unknown_type_cb (): /GstPipeline:pipeline0/GstBin:source-bin-00/GstURIDecodeBin:uri-decode-bin
sh: 1: lsmod: not found
sh: 1: modprobe: not found
Decodebin child added: nvv4l2decoder0
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 279
NvMMLiteBlockCreate : Block : BlockType = 279
In cb_newpad
1920x1080 Format.RGBA8
960x540 Format.BGR8
**PERF: {'stream0': 0.0}
1920x1080 Format.RGBA8
960x540 Format.BGR8
1920x1080 Format.RGBA8
960x540 Format.BGR8
1920x1080 Format.RGBA8
960x540 Format.BGR8
...
1920x1080 Format.RGBA8
960x540 Format.BGR8
nvstreammux: Successfully handled EOS for source_id=0
1920x1080 Format.RGBA8
960x540 Format.BGR8
1920x1080 Format.RGBA8
960x540 Format.BGR8
1920x1080 Format.RGBA8
960x540 Format.BGR8
1920x1080 Format.RGBA8
960x540 Format.BGR8
1920x1080 Format.RGBA8
960x540 Format.BGR8
1920x1080 Format.RGBA8
960x540 Format.BGR8
End-of-stream
Exiting app
Could you try it again to see if there is any difference between us?
Thanks.
Yes, I am using the standard docker with the account belonging to sudo group. Also if GPU is not accessible, nvinfer should fail as well, but it’s not the case.
FYI, here’s my docker version & nvidia-container-cli version:
It seems that you expect the print of metadata (width x height and format) to sync the output and thus delete n_frame_gpu after printing. But this can cause illegal memory access as vpi_image may still be being read in “with” (async algos of VPI) and deleting the underlying memory of the wrapped vpi_image.
The correct usage is to sync before delete, or delete the wrapped image before deleting the raw buffer n_frame_gpu.