My Self-Driving G-Wagon

Notes / 3 Nov 2026

The camera loop ran below 20 Hz because OpenBLAS threads spun

On N16 drives the camera loop ran 17.7 to 18.8 Hz: a serial decoder skipped ticks while OpenBLAS worker threads used 1.75 cores. With one OpenBLAS thread per service, three drives held 19.91 to 19.92 Hz.

3 Nov 2026. Measured on recorded drives, in replay on the truck's Jetson board, and on three drives after the fix was installed.

What was asked

N16 (comma's driving model, "N16 nav") assumes its input frames arrive 50 ms apart, 20 Hz, so its four-step history spans 200 ms. On every drive with N16 running, the truck's camera loop on the Jetson ran at 17.7 to 18.8 Hz instead. The question was why, and what the smallest fix is.

What was done

The loop's timing was read from 49 recorded sessions, together with the board's logged load and a read-only per-thread CPU sampler run on the Jetson during one drive. The camera itself delivered 29.95 frames per second in every session. A 20 Hz tick is skipped when the frame queued at the previous tick has not finished decoding.

The cause was then reproduced offline by replaying a recorded two-camera segment at the camera's 30 fps. The fix was tried on the board, and a larger alternative, a rewrite of the decoder, was built and replayed for comparison.

Result

The rebuild alone, measured with and without the fix:

OpenBLAS threadsProcess CPUPer rebuild
unset (8 threads)201.4 % of a core8.8 ms
13.5 %6.8 ms

The installed loop replayed with that rebuild running beside it:

Rebuild loadLoop rateMissed ticks
none20.00 Hz0
1 thread20.00 Hz0
8 threads (default)18.7 and 19.4 Hz (two runs)7.0 % and 3.0 %

The 18.7 Hz run matches the drives (17.7 to 18.8 Hz, 53 to 56 ms spacing). The chosen fix is setting one OpenBLAS thread on three Jetson services (camera inference, fisheye recording, IMU). The decoder rewrite (two decode threads, wide frame converted ahead) reached 20.0 Hz under load but had a step 99th percentile of 53 ms against a 48 ms bar, and its hit rate was shown only after a change to the replay, so it is shelved.

On the road, after the fix was installed on the Jetson: on the three drives that carried wheel speed, the loop ran 19.91 to 19.92 Hz with 0.36 to 0.47 % of ticks missed and a decode 99th percentile of 42.0 to 42.7 ms. Drives without wheel speed cannot be scored by the timing check.

Correction: the earlier claim of 20.0 Hz when parked came from status lines. Recorded results show 18.1 to 18.8 Hz when parked with the key on.

What it does not show