The target application XXX exited before profiling started

I’m running nsight system 2024.5.4 on a ubuntu22.04 host to profile an application running on an orin nx running jetpack 6.2.

This is the host:

$ uname -a
Linux XXXXXXX 6.8.0-65-generic #68~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Jul 15 18:06:34 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -aNo LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.5 LTS
Release:	22.04
Codename:	jammy

$ dpkg -l | grep nsight-systems
ii  nsight-systems-2024.5.4                            2024.5.4.34-245434855735v0                amd64        Nsight Systems is a statistical sampling profiler with tracing features.

This is the target:

$ uname -a
Linux sai-aaa-boson22-xx 5.15.148-tegra #1 SMP PREEMPT Mon Jul 7 21:43:07 PDT 2025 aarch64 aarch64 aarch64 GNU/Linux

$ cat /etc/nv_tegra_release
# R36 (release), REVISION: 4.3, GCID: 38968081, BOARD: generic, EABI: aarch64, DATE: Wed Jan  8 01:49:37 UTC 2025
# KERNEL_VARIANT: oot
TARGET_USERSPACE_LIB_DIR=nvidia
TARGET_USERSPACE_LIB_DIR_PATH=usr/lib/aarch64-linux-gnu/nvidia

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.5 LTS
Release:	22.04
Codename:	jammy

$ dpkg -l | grep nsight-systems
ii  nsight-systems-2024.5.4                      2024.5.4.34-245434855735v0                           arm64        Nsight Systems is a statistical sampling profiler with tracing features.
ii  nvidia-nsight-systems                        6.2.1+b38                                            arm64        NVIDIA Nsight System Meta Package

When I attempt to start profiling from the UI, I consistently get the error Target application XXX exited before profiling started.

I can run the profiling command on the target using nsys profile … then download the report file and display it in the GUI:

So I searched the forums and came across this thread here to capture a log and obtained the following file:

nsys-ui.log (43.6 KB)

All I see is that Deinitialize::start message but no error message.

...
I01:15:59:512|quadd_common_runtime_elf| 3842|DLOpenHook.cpp:59[DLOpen]: Trying to load '/opt/nvidia/nsight-systems/2024.5.4/target-linux-tegra-armv8/libToolsInjection64.so'
I01:15:59:512|Injection| 3842|InjectionDL.cpp:275[DLOpenHook]: Handling dlopen(/opt/nvidia/nsight-systems/2024.5.4/target-linux-tegra-armv8/libToolsInjection64.so, 0x1002) = 0xaaaaf4763950 (new=0)
I01:15:59:513|Injection| 3842|Manager.cpp:317[Deinitialize]: Deinitialize::start.
I01:15:59:513|Injection| 3842|InjectionOSRuntime.cpp:147[OnApplicationExit]: OS runtime libraries: OnApplicationExit
...

Any idea what is happening?

@Andrey_Trachenko can you further triage this?

To add some more information.

I do have the magic/permissive settings added to`/etc/sysctl.conf` so that they survive boot:

$ cat /etc/sysctl.conf
...
kernel.perf_event_paranoid=-1
kernel.kptr_restrict=0


$ cat /proc/sys/kernel/perf_event_paranoid
-1
$ cat /proc/sys/kernel/kptr_restrict
0

I tried to profile a binary that requires LD_LIBRARY_PATH to be set but wrapped the command line into a script /home/nvidia/myscript.sh:

#!/bin/bash
export LD_LIBRARY_PATH=…
mybinary arg1 arg2

I checked that the script runs fine when invoked manually from the target.

When running from the UI, same error. The log shows message Skipping injection of myscript.sh process 6797 indicating that it finds the script and I’m configuring things correctly to run.

Only working case I found was using sleep 1000 as the command to profile (log shows it finds the binary as /usr/bin/sleep)

Can the tool be configured to be even more verbose?