commaai / openpilot

openpilot is an operating system for robotics. Currently, it upgrades the driver assistance system in 275+ supported cars.
https://comma.ai/openpilot
MIT License
49.19k stars 8.96k forks source link

Reduce kernel boot time to <1s on comma 3/3X #30894

Open adeebshihadeh opened 8 months ago

adeebshihadeh commented 8 months ago

systemd-analyze reports this for the latest AGNOS:

Startup finished in 3.650s (kernel) + 7.343s (userspace) = 10.994s
graphical.target reached after 7.059s in userspace

Get the kernel part of that down to <1s in a self-contained way that doesn't delay the rest of the openpilot.

AGNOS is built with https://github.com/commaai/agnos-builder

andiradulescu commented 7 months ago

I'm planning to do the following (most of them extracted from the boot-time-slides.pdf from the documentation links):

Documentation links:

adeebshihadeh commented 7 months ago

We already use quiet to get the initial speedup of like 11s -> 3s. I suspect we'll get the most savings from disabling and deferring. Anything openpilot doesn't use is fine to disable. Also keep in mind that deferring something critical but it costs time later in bootup doesn't count, but something non-essential to driving like WiFi is fine.