DRIVE OS Version: 7.0.3
Issue Description: We’ve noticed large fluctuations in the offset when syncing network interface to system clock via phc2sys service.
Our setup:
Time server ↔ eqos_0
phc2sys service to sycn eqos_0 to CLOCK_REALTIME
The problem we observed:
When running the following command:
journalctl -fu phc2sys_eqos_to_sys.service
The offset observed from phc2sys seems to overshoot by 0.4ms (400us) followed by undershooting before returning to values close to 0. This happens regularly at random intervals.
Plot of the offset from a snippet of the above logs is below:
※phc2sys_eqos_to_sys.service is just a service that calls
phc2sys -s eqos_0 -c CLOCK_REALTIME -O 0 -S 1.0
Other Nv forum posts on a similar issue:
From searching the Nv forums we have found similar issues that have been posted, albeit on a different platform.
Jetson AGX Orin PHC Instability Using phc2sys - Jetson Systems / Jetson AGX Orin - NVIDIA Developer…
JP6.2系统时间跳变问题 - Jetson Systems / Jetson AGX Orin - NVIDIA Developer Forums
The solution from these posts seem to suggest turning off nvpps. However, that is not an option for us, we need nvpps to be enabled.
Question:
Does Nvidia see this as an issue and do you all intend to address it?
(Just asking to disable nvpps and closing the forum post does not seem like a resolution)
Dear @kunhao.toh.j5z ,
Could you test using DOS 7.2.5 release if there is no dependency on DOS 7.0.3?
So ethernet is connected to eqos interface and trying to sync system clock to eqos clock using phc2sys causing offset to go beyond 0.4 msec and comes back to normal. Is my understanding correct?
Can this be reproduced using phc2sys -s eqos_0 -c CLOCK_REALTIME -O 0 -S 1.0 on with ethernet connected to eqos interface?
What version linuxptp binaries are you using? linuxptp repo had update about 5 months ago to address:
The previous behaviour resulted in peer delays not being correctly
reported, which could break 802.1AS implementations that gate
asCapable on neighborPropDelayThresh, as well as reporting incorrect
accumulatedLatency values to 802.1Qat implementations that retrieve
the path delay from the management interface.
apt search linuxptp
linuxptp/noble-updates,now 4.0-1ubuntu1.1 arm64 [installed]
git clone https://github.com/richardcochran/linuxptp.git
cd linuxptp
make
mkdir bin
find . -path ./bin -prune -o -type f -executable -exec cp -vt ./bin/ -- {} +
cd bin
rm *.sample *.sh
sudo cp * /usr/sbin/
ptp4l -v
4.4-00039-gddeec0f-dirty
ls /usr/share/doc/linuxptp/configs/automotive-*.cfg
Here’s a config I’ve seen used.
/etc/linuxptp/automotive-slave.cfg
[global]
# IEEE 802.1AS / Automotive Profile — time-aware end station (slave)
gmCapable 0
priority1 248
priority2 248
# Hardware timestamping
time_stamping hardware
tx_timestamp_timeout 20
network_transport L2
delay_mechanism P2P
transportSpecific 0x1
ptp_dst_mac 01:80:C2:00:00:0E
# gPTP
logSyncInterval -3
syncReceiptTimeout 3
neighborPropDelayThresh 800
min_neighbor_prop_delay -20000000
assume_two_step 1
path_trace_enabled 1
follow_up_info 1
# Automotive Profile (static roles, no BMCA)
BMCA noop
clientOnly 1 # use 'slaveOnly 1' if staying on older linuxptp.
inhibit_announce 1
asCapable true
ignore_source_id 1
# Interval negotiation once the servo is locked
operLogSyncInterval 0
operLogPdelayReqInterval 2
msg_interval_request 1
# Servo
clock_servo pi
step_threshold 1 # step on GM time jumps > 1 s
servo_offset_threshold 30 # ns
servo_num_offset_values 10
# Logging
summary_interval 4 # summary every 16 s
fault_reset_interval 1
[eqos_0]
Hi @SivaRamaKrishnaNV
Could you test using DOS 7.2.5 release if there is no dependency on DOS 7.0.3?
Unfortunately, our system will be using DOS 7.0.3 only.
So ethernet is connected to eqos interface and trying to sync system clock to eqos clock using phc2sys causing offset to go beyond 0.4 msec and comes back to normal. Is my understanding correct?
Yes. eqos_0 is connected to time server and eqos_0 is synced with time server. phc2sys is then trying to sync system clock to eqos_0 and large offsets are observed sometimes.
Can this be reproduced using phc2sys -s eqos_0 -c CLOCK_REALTIME -O 0 -S 1.0 on with ethernet connected to eqos interface?
For our system we have designated eqos_0 as the interface to the time server. Hence system clock is synced with eqos_0 and nvpps is also synced with eqos_0. I don’t think the exact interface matters so long as you do phc2sys -s <interface that nvpps uses> -c CLOCK_REALTIME -O 0 -S 1.0.
Hi @whitesscott
What version linuxptp binaries are you using?
We’re using v4.0
Will upgrading to v4.4 fix this issue?
It may be worth trying; takes literally seconds to compile. You could backup the binaries, see if it helps, if not revert.
cd /usr/sbin
cp -p hwstamp_ctl nsm phc2sys phc_ctl pmc ptp4l timemaster ts2phc tz2alt /tmp
Build linuxptp
cp hwstamp_ctl nsm phc2sys phc_ctl pmc ptp4l timemaster ts2phc tz2alt /usr/sbin/
On my plain Thor dev kit Jetpack 7.2.1 I had to stop/restart ptp4l-mgbe0_0.service to be able to copy ptp4l.
Dear @kunhao.toh.j5z ,
Did you try updating linuxptp? Did it help?
@SivaRamaKrishnaNV @whitesscott
Hi sorry it took a while to reply.
I have tried updating to version 4.4 for linuxptp and the issue still persists.
Dear @kunhao.toh.j5z ,
Could you please share the connection port and which dongle is connected? Is it J4 P2 port <->1G dongle ↔ LAN port and ran phc2sys -s eqos_0 -c CLOCK_REALTIME -O 0 -S 1.0 on target?
If you’re running the default configuration on the devkit, I believe mgbe3_0 is the default interface that syncs with the grandmaster as well as the default interface that does ptp tsc locking. (Our system is not running the default hence is using eqos_0)
In that case please connect to ETH5(mgbe3_0)<->1G dongle ↔ LAN port
Please create the following service file called phc2sys_mgbe3_0_to_sys.service in /usr/lib/systemd/system
[Unit]
Description=Service for phc2sys to sync sys clock with eqos_0
Requires=nv_ptp4l_slave_mgbe3_0.service
After=nv_ptp4l_slave_mgbe3_0.service
[Service]
Type=simple
#ExecStartPre=/bin/bash -c 'while ! ip link show eqos_0 | grep -q "state UP"; do sleep 1; done'
ExecStartPre=/bin/bash -c 'sleep 1'
ExecStart=phc2sys -s mgbe3_0 -c CLOCK_REALTIME -O 0 -S 1.0
Restart=on-failure
RestartSec=3
[Install]
WantedBy=multi-user.target
Run the following command
systemctl start phc2sys_mgbe3_0_to_sys.service
To monitor the offset
journalctl -fu phc2sys_mgbe3_0_to_sys.service
could you clarify which connector and port from P3960 Network Topology — NVIDIA DriveOS 7.2.5 Linux SDK Early Access Developer Guide ? is it J5 connector you mean by ETH5?
Dear @kunhao.toh.j5z ,
Is this issue specific to eqos interface or other interfaces also have same issue?
Disclaimer: Synthesized with AI assistance; technical details should be verified against official documentation.
Hi @kunhao.toh.j5z,
Since updating to linuxptp v4.4 didn’t resolve the 400µs offset spikes, this looks like a classic Proportional-Integral (PI) servo loop instability rather than a strict binary version issue.
When phc2sys overshoots and then undershoots in a ringing pattern, it often means the default PI constants (P and I) are too aggressive for the jitter profile of your specific system clock (TSC) and the nvpps subsystem you are required to keep enabled.
Before looking at different physical interfaces like NVIDIA is suggesting, you can try tuning the phc2sys servo loop to dampen the response.
You can manually pass custom P (proportional) and I (integral) constants to phc2sys using the -P and -I flags. Try overriding the defaults with significantly lower values to soften the clock discipline:
phc2sys -s eqos_0 -c CLOCK_REALTIME -O 0 -S 1.0 -P 0.01 -I 0.001
If the 400µs spikes flatten out (even if it takes slightly longer to achieve the initial lock), then the root cause is just servo configuration. You can then tweak the -P and -I values until you find the sweet spot for your board’s thermal/scheduler jitter.
I don’t think it’s specific to eqos interface as other topics that I’ve linked to in the original post are not specific to eqos
is it J5 connector you mean by ETH5?
Yes, I mean J5. Sorry for the incorrect terminology. I believe any of the J5 ports should link to mgbe3_0
Thanks for the suggestion. I’ll give it a try later
Hi I’ve tried adjusting P and I and it seems to have an effect on the spikes.
Without any proper tuning, adjusting P and I has changed the peak and response time of the spikes. (The peak got higher and the response time slower)
I have not found the proper parameters yet to flatten it out but seeing that the spikes have changed, with proper tuning it seems like it might work.