on-device building fixups (#34642)

* on-device building fixups

* fix
pull/34646/head
Adeeb Shihadeh 2 months ago committed by GitHub
parent d9a8fab3e6
commit 2e374cd962
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      system/manager/build.py
  2. 8
      tools/op.sh

@ -7,7 +7,7 @@ from pathlib import Path
from openpilot.common.basedir import BASEDIR from openpilot.common.basedir import BASEDIR
from openpilot.common.spinner import Spinner from openpilot.common.spinner import Spinner
from openpilot.common.text_window import TextWindow from openpilot.common.text_window import TextWindow
from openpilot.system.hardware import AGNOS from openpilot.system.hardware import HARDWARE, AGNOS
from openpilot.common.swaglog import cloudlog, add_file_handler from openpilot.common.swaglog import cloudlog, add_file_handler
from openpilot.system.version import get_build_metadata from openpilot.system.version import get_build_metadata
@ -26,6 +26,10 @@ def build(spinner: Spinner, dirty: bool = False, minimal: bool = False) -> None:
extra_args = ["--minimal"] if minimal else [] extra_args = ["--minimal"] if minimal else []
if AGNOS:
HARDWARE.set_power_save(False)
os.sched_setaffinity(0, range(8)) # ensure we can use the isolcpus cores
# building with all cores can result in using too # building with all cores can result in using too
# much memory, so retry with less parallelism # much memory, so retry with less parallelism
compile_output: list[bytes] = [] compile_output: list[bytes] = []

@ -283,7 +283,13 @@ function op_build() {
CDIR=$(pwd) CDIR=$(pwd)
op_before_cmd op_before_cmd
cd "$CDIR" cd "$CDIR"
op_run_command scons $@ if [[ -f "/AGNOS" ]]; then
# needed on AGNOS to not run out of memory
op_run_command system/manager/build.py
else
# scons is fine on PC
op_run_command scons $@
fi
} }
function op_juggle() { function op_juggle() {

Loading…
Cancel
Save