-
Hardware Platform: Jetson AGX Orin 64 GB.
-
JetPack Version: JetPack 6.2.1 (L4T 36.4.7)
-
DeepStream Version: DeepStream 7.1.
-
TensorRT Version: 10.7.0
-
Issue Type: Bug report / help request for stability when using either a custom recording plugin or NVIDIA Smart Record across multiple sources.
App:
Custom C++ DeepStream app based on gst_parse_launch. Pipeline structure (13 RTSP cameras):
nvurisrcbin (per camera)
→ queue → tee
tee → nvstreammux → nvinfer → nvtracker → nvdsosd → display
tee → per-source smart-record branch (see below)
Recording paths tried:
-
Home-grown recordplugin (GstBaseTransform) that deep-copies the incoming GstBuffer, feeds an appsrc-based H.264 MP4 pipeline, and generates first/last snapshots from the same recorded video.
-
NVIDIA Smart Record via NvDsSRContext. Each source taps off the post-OSD tee and runs its own encoder → parser → NvDsSR recordbin.
Issue A: Custom Record Plugin - CUDA Illegal Memory Access & System Reboot
Repro:
-
Each detection triggers recordplugin (signals record-start / record-stop), launching its internal appsrc→nvvideoconvert→nvv4l2h264enc→mp4mux→filesink pipeline and a separate snapshot pipeline for JPEGs.
-
After a few start/stop cycles across 13 sources, logs show:
/dvs/git/…/nvbufsurftransform_copy.cpp:438: => Failed in mem copy
libnvosd … Unable to map EGL Image
cudaErrorIllegalAddress … nvll_osd/memory.hpp:59
Segmentation fault (core dumped) build/app -
Kernel log (kernel.log) contains GPU faults (e.g., nvgpu … source enable violation, cudaErrorIllegalAddress) followed by a watchdog-triggered reboot.
Hypothesis: deep-copying NVMM buffers in the plugin, then pushing them through additional GPU elements (nvvideoconvert, nvjpegenc) races with DeepStream’s buffer lifecycle, leading to stale pointers and illegal device access.
Issue B: Smart Record (NvDsSR) Exhausts NVENC and Crashes
After removing the custom plugin, Smart Record was integrated per NVIDIA docs:
demux.src_i → queue → nvvideoconvert → nvdsosd → tee_rec_i
tee_rec_i → queue → nvvideoconvert → nvv4l2h264enc → h264parse → NvDsSR recordbin
===== NvVideo: NVENC =====
NVMEDIA: Need to set EMC bandwidth …
NVMAP_IOC_GET_FD failed: Bad address
nvbufsurface: Failed to create EGLImage
libnvosd … Unable to map EGL Image
/dvs/git/…/nvbufsurftransform.cpp: => NvVicCompose Failed
gstnvtracker: NvBufSurfTransform failed with error -2 …
nvinfer error: Internal data stream error (streaming stopped, reason error (-5))
After the NVENC errors, the pipeline collapses and the system may reboot. Each Smart Record branch creates its own nvv4l2h264enc, so we simply exceed the Orin’s encoder capacity.
Workaround: switch the Smart Record branch to CPU encoding (nvvideoconvert → videoconvert → x264enc → h264parse → NvDsSR). That avoids NVENC, but doing x264 on 13 HD streams pushes CPU usage very high, so it’s not a viable long-term solution
Full log excerpt attached (smart_record_error.log)
libnvosd (1386):(ERROR) : cuGraphicsEGLRegisterImage failed : 1
nvbufsurface: Failed to create EGLImage.
/dvs/git/…/nvbufsurftransform.cpp:4814: => NvVicCompose Failed
gstnvtracker: NvBufSurfTransform failed with error -2 …
nvinfer error: Internal data stream error.
What We Need
-
Guidance for custom record plugin:
- How to safely clone or share surfaces for out-of-band pipelines without triggering cudaErrorIllegalAddress? Is there a recommended method to convert DeepStream buffers to CPU memory for appsrc pipelines without racing the pool?
-
Smart Record across many sources:
-
Best practice for using Smart Record when ~13 cameras may record simultaneously. Can NvDsSR reuse already encoded frames (e.g., from nvstreammux) so we don’t need a separate encoder per source?
-
Is there a supported way to mux the demuxed streams into Smart Record without instantiating nvv4l2h264enc for every source?
-
-
General robustness:
- Any DeepStream or Jetson settings we can tweak (memory pool sizes, NvBufSurface cache settings, etc.) to keep the pipeline stable during frequent record start/stop sequences?
Recordings are triggered whenever nvinfer detects the target class; each trigger kicks off Smart Record (or previously, our custom recordplugin).
Any insights or recommended pipeline adjustments from the DeepStream team would be greatly appreciated. Happy to share additional logs or code snippets if needed.
Attached are all the logs/errors I have encountered so far.
cudaErrorIllegalAddress.log (9.4 KB)
kernal.log (73.0 KB)
recording.log (1.2 KB)
smart_record_error.log (14.3 KB)