From 0c2ef0bbdbe0ab7e715a22b67d02ead17a3ce188 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Wed, 19 Aug 2026 23:22:47 -0400 Subject: [PATCH] modeld_v2: restore chestnut link check before big model build --- openpilot/sunnypilot/modeld_v2/compile_modeld.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/openpilot/sunnypilot/modeld_v2/compile_modeld.py b/openpilot/sunnypilot/modeld_v2/compile_modeld.py index c99a7c9d25..927e5f3392 100755 --- a/openpilot/sunnypilot/modeld_v2/compile_modeld.py +++ b/openpilot/sunnypilot/modeld_v2/compile_modeld.py @@ -296,14 +296,14 @@ def _load_policy_runners(args: argparse.Namespace) -> tuple[list, list]: if __name__ == "__main__": - # if 'USB' in os.getenv('DEV', '') or os.getenv('USBGPU'): - # from openpilot.system.hardware.chestnut.flash import link_up - # for _ in range(10): - # if link_up(): - # break - # time.sleep(1) - # else: - # raise RuntimeError("Chestnut not ready, skipping big model build") + if 'USB' in os.getenv('DEV', '') or os.getenv('USBGPU'): + from openpilot.system.hardware.chestnut.flash import link_up + for _ in range(10): + if link_up(): + break + time.sleep(1) + else: + raise RuntimeError("Chestnut not ready, skipping big model build") from openpilot.common.file_chunker import chunk_file, get_chunk_targets from openpilot.selfdrive.modeld.get_model_metadata import make_metadata_dict