Running jetson_clocks fails randomly at boot

Board: Nvidia Jetson Xavier NX
L4T version: 32.5.1

I have created a service to run jetson_clocks at boot, here is the service file:

; https://forums.developer.nvidia.com/t/camera-timestamp-slow-drift/309894/3?u=user27558
; Disables the DVFS governor and locks the clocks to their maximums as defined by the active nvpmodel power mode.
; Improves and makes global performances deterministic,  may prevent clock drifts.
[Unit]
Description=Boosts Jetson Clocks
; Everything depends on the NVIDIA per-boot script
After=nv.service
; TPC power gating must be enabled before anything touching gpu
After=nvpmodel.service
Before=docker.socket nvargus-daemon.service

[Service]
Type=oneshot
ExecStart=/usr/bin/jetson_clocks
ExecStart=/bin/sh -c "echo 1 > /sys/kernel/debug/bpmp/debug/clk/vi/mrq_rate_locked"
ExecStart=/bin/sh -c "echo 1 > /sys/kernel/debug/bpmp/debug/clk/isp/mrq_rate_locked"
ExecStart=/bin/sh -c "echo 1 > /sys/kernel/debug/bpmp/debug/clk/nvcsi/mrq_rate_locked"
ExecStart=/bin/sh -c "echo 1 > /sys/kernel/debug/bpmp/debug/clk/emc/mrq_rate_locked"
ExecStart=/bin/sh -x -c "/bin/cat /sys/kernel/debug/bpmp/debug/clk/vi/max_rate | /usr/bin/tee /sys/kernel/debug/bpmp/debug/clk/vi/rate"
ExecStart=/bin/sh -x -c "/bin/cat /sys/kernel/debug/bpmp/debug/clk/isp/max_rate | /usr/bin/tee  /sys/kernel/debug/bpmp/debug/clk/isp/rate"
ExecStart=/bin/sh -x -c "/bin/cat /sys/kernel/debug/bpmp/debug/clk/nvcsi/max_rate | /usr/bin/tee /sys/kernel/debug/bpmp/debug/clk/nvcsi/rate"
ExecStart=/bin/sh -x -c "/bin/cat /sys/kernel/debug/bpmp/debug/clk/emc/max_rate | /usr/bin/tee /sys/kernel/debug/bpmp/debug/clk/emc/rate"
ExecStartPost=/bin/sleep 2
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

The issue is that SOMETIMES the jetson_clocks script fails and outputs the following error:

Jan 28 18:14:54 jetson_clocks[4857]: Error: Failed to max GPU frequency!

Then my cameras are running at ~1 to ~5 fps, it only happens if I run jetson_clocks and it fails.

What is going on ?
The fact that it’s random probably means a race condition somewhere but I specifically wait for nv.service and nvpmodel.service, as far as I know it should be enough.

There is nothing useful in kernel logs
What else could I do to make it work ?

Thanks !

Hi,
Please modify this service directly:
Camera's frame rate unstable - #24 by DaneLLL

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