ELF File Runs Manually but Fails to Capture Video with GStreamer When Launched via Systemd at Boot

Hi,
I am manually running an ELF file like this:

ciphor@ciphor-desktop:~/standalone$ ./unit_sambhu.elf

This works fine, and I can see the following output:

Opening in BLOCKING MODE

NvMMLiteOpen : Block : BlockType = 261

NVMEDIA: Reading vendor.tegra.display-size : status: 6

NvMMLiteBlockCreate : Block : BlockType = 261

Opening in BLOCKING MODE

NvMMLiteOpen : Block : BlockType = 4

===== NVMEDIA: NVENC =====

NvMMLiteBlockCreate : Block : BlockType = 4

H264: Profile = 66, Level = 0

NVMEDIA: Need to set EMC bandwidth : 376000

NVMEDIA_ENC: bBlitMode is set to TRUE

I am able to capture video using GStreamer when running the file manually, but I want this ELF file to run automatically after every boot on my Jetson system, using systemd.

Here’s the current systemd unit file I’m using:

[Unit]

Description=/etc/rc.local Compatibility

ConditionPathExists=/etc/rc.local

[Service]

Type=forking

ExecStart=/etc/rc.local start

User=root

TimeoutSec=0

StandardOutput=tty

RemainAfterExit=yes

SysVStartPriority=99

[Install]

WantedBy=multi-user.target

In the /etc/rc.local file, I have written the following:

#!/bin/bash

./home/ciphor/standalone/unit_sambhu.elf &

exit 0

I have started the service, but after rebooting the system, I check the status and see the following:

rc-local.service - /etc/rc.local Compatibility

Loaded: loaded (/etc/systemd/system/rc-local.service; enabled; vendor preset: enabled)

Drop-In: /usr/lib/systemd/system/rc-local.service.d

└─debian.conf

Active: active (running) since Fri 2024-09-06 16:42:17 IST; 1h 28min ago

Main PID: 1029 (unit_sambhu.elf)

Tasks: 13 (limit: 74727)

Memory: 145.7M

CGroup: /system.slice/rc-local.service

└─1029 ./home/ciphor/standalone/unit_sambhu.elf

The log also shows:

Sep 06 16:42:17 ciphor-desktop systemd[1]: Started /etc/rc.local Compatibility.

Sep 06 16:42:18 ciphor-desktop rc.local[1029]: Opening in BLOCKING MODE

Sep 06 16:42:18 ciphor-desktop rc.local[1029]: Opening in BLOCKING MODE

Sep 06 16:42:18 ciphor-desktop rc.local[1029]: NvMMLiteOpen : Block : BlockType = 4

Sep 06 16:42:18 ciphor-desktop rc.local[1029]: ===== NVMEDIA: NVENC =====

Sep 06 16:42:18 ciphor-desktop rc.local[1029]: NvMMLiteBlockCreate : Block : BlockType = 4

Sep 06 16:42:19 ciphor-desktop rc.local[1029]: H264: Profile = 66, Level = 0

Sep 06 16:42:19 ciphor-desktop rc.local[1029]: NVMEDIA: Need to set EMC bandwidth : 376000

Sep 06 16:42:19 ciphor-desktop rc.local[1029]: NVMEDIA_ENC: bBlitMode is set to TRUE

However, the GStreamer pipeline does not capture video after boot, and the renderer output shows a black screen.
Is there any setting I am missing here?

after system boot up the output of Jtop command

Hi,
Please check

Jetson Nano FAQ
Q: How to autorun an app or commands at startup?

You may try this:
Mediapipe error Open Gl error in myservice.service - #14 by DaneLLL

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