Orin Nano: ~20 us memory stall on 1 s BPMP EMC tick. Can it be disabled?

Hello,

We run a hard real-time audio workload on Jetson Orin Nano. A persistent CUDA kernel processes one sample every ~20.8 us (48 kHz). We see a sporadic worst-case delay of about +20-23 us. We traced it to a short memory stall that affects the whole SoC, and we would like to understand it and, if possible, avoid it.

**Platform**

- Jetson Orin Nano Engineering Reference Developer Kit Super

- L4T R36.5.0 (nvidia-l4t-core 36.5.0-20260115194252), kernel 5.15.185-tegra, CUDA 12.6.68

- BPMP firmware: 030ffe301d1db1d01cb6-68f126a8abf

- Power mode MAXN_SUPER, `jetson_clocks` applied (GPU 1020 MHz, EMC 3199 MHz, FreqOverride=1)

- LPDDR5, 8 channels

**What we observe**

1. Every memory access stalls for 20-23 us at the same moment: GPU loads that hit L2, GPU loads that go to DRAM, GPU reads of host-mapped (zero-copy) memory, and CPU DRAM loads on another core. GPU warps that use only shared memory or registers are not affected.

2. The stall happens only on a 1 s grid, and the phase on that grid stays fixed relative to the GPU `%globaltimer` (within ±0.3 ms over minutes). Relative to Linux `CLOCK_MONOTONIC`, which is NTP-disciplined, the phase drifts by about 37 ppm. So it does not look like a Linux timer. It matches `/sys/kernel/debug/bpmp/debug/emc/timer_period = 1000`.

3. The trigger is a change in GPU DRAM write activity:

  • GPU busy with no DRAM traffic: no stall.

  • DRAM reads only: no stall (0 of 20 trials).

  • Host-mapped reads only: no stall (0 of 10).

  • GPU DRAM writes start: one stall on the next 1 s tick (11 of 11).

  • GPU DRAM writes stop: one stall 1-4 ticks later (5 of 11).

  • Steady, continuous writes: no further stalls (tested for 10-15 min).

4. It is not an EMC frequency change. `emc/stats` keeps the same transition count (9) before and after the test, and `clk/emc/rate` stays at 3199000000.

5. It does not depend on the display (also seen with gdm stopped), on temperature ramps, or on other processes creating CUDA contexts.

6. `emc/timer_period` and `emc/timer_period_training` (100) are read-only. Writing to them returns EINVAL.

We can share a small standalone CUDA program that reproduces this. It toggles GPU DRAM writes on and off every few seconds while a separate warp records `%globaltimer` gaps.

**Questions**

1. What does the BPMP EMC code do on the 1000 ms `timer_period` tick that blocks all memory clients for about 20 us? Is it LPDDR5 periodic training or compensation (for example DQS/WCK oscillator retraining), MR4 temperature polling, or something else?

2. Why does a change in GPU DRAM write activity cause it? Is there a documented activity or threshold condition?

3. Is there a supported way to avoid or bound this stall? For example: a BPMP DT or EMC table property to disable it or lengthen its period, to make it run unconditionally at a known time, or to make it non-blocking. What are the effects on DRAM reliability across temperature?

4. For workloads with a deadline of about 20 us per sample, does NVIDIA recommend any configuration or approach? Keeping a constant write load is a possible workaround, but it costs bandwidth and latency and does not seem robust.

Thank you.

Hi,
There are some patches in nvgpu driver for r36.5.0:
Making sure you're not a bot!

Please apply the patches and try.

Hi,

Thank you for the reply and the link.

We checked the two items in the GPU section of the r36.5.x patches page:

1. **rcu_preempt stall fix** (`host1x-fence`: `spin_lock` changed to `spin_lock_irqsave` in the pollfd release and poll paths). This fixes an IRQ-vs-process-context lock race. We do not see that symptom: the kernel log on this board has no RCU stall reports.

2. **nvgpu kmem_cache sysfs alias leak fix**. This fixes a memory leak. The posted diff is for r36.5.2, and we are on r36.5.0.

We do not think either patch can change what we see, for these reasons:

- **The stall is not in the GPU or the kernel driver.** At the same moment, a CPU core doing plain DRAM loads in a user-space thread also stalls by the same amount (about 22 us). GPU warps that use only shared memory or registers keep running.

- **Its timing comes from firmware, not Linux.** The stalls fall on a fixed 1 s grid. That grid stays locked to the GPU `%globaltimer` hardware clock (within ±0.3 ms over minutes), while it drifts by about 37 ppm against Linux `CLOCK_MONOTONIC`. The period matches the BPMP `emc/timer_period = 1000` ms.

- **No driver activity is needed.** The trigger is a change in GPU DRAM write traffic from an already running persistent kernel, with no kernel launches, ioctls, or allocations around the stall. We also saw no correlation with the nvgpu kernel threads (`nvgpu_channel_p`, `nvgpu_clk_arb_p`, devfreq workqueue) when we sampled their scheduler run counts.

- **It is not EMC DVFS.** `emc/stats` keeps the same transition count, and the EMC rate stays at 3199 MHz.

So it looks like a periodic action of the BPMP EMC firmware, such as LPDDR5 periodic training or compensation, or MR4 polling. It seems to be conditional on recent memory activity, and it blocks all memory clients for about 20 us.

Could you please forward this to the EMC/BPMP team? Our questions are:

1. What does the BPMP EMC code do on the 1000 ms `timer_period` tick, and why does a change in GPU DRAM write activity make it run (or block)?

2. Is there a supported BPMP DT or EMC table setting to disable it, make it non-blocking, lengthen its period, or make it run unconditionally (so its timing is predictable)? What is the impact on DRAM reliability across temperature?

3. If no setting exists, is there a recommended way for a workload with a deadline of about 20 us to avoid it?

If useful, we can attach a small standalone CUDA reproducer (about 150 lines, no product code). It toggles GPU DRAM writes on and off every few seconds and logs `%globaltimer` gaps. On this board it shows the stall about 0.5 s after writes start, every time.

If you still think the nvgpu patches are relevant, could you explain how they relate to this? We can then build and test them, but we would like to understand the expected effect first, because it means rebuilding and replacing the kernel modules.

Thank you.

Hi,
These are patches for critical issues. If you use the Jetpack version before r36.5.x, would suggest apply them.

Since you have run jetson_clcoks to have CPU/GPU run in maximum clock, this is optimal performance mode. Further latency reduction may not be feasible.