fix(c3xl-vip): rebuild params after branch switch

This commit is contained in:
1okko
2026-09-29 21:28:49 +08:00
parent 3c7e29c981
commit b6df4409ac
3 changed files with 19 additions and 1 deletions
+4
View File
@@ -23,6 +23,10 @@
3. 保持 `QNN control preference` 关闭进行 shadow 验证;只有独立资格记录通过后才允许控制输出接管。
4. 每次 onroad 首次失败会写入 `C3XLQnnWifiFailedThisOnroad` 并锁定本地模型到本次行车结束。
## 分支切换
从旧的 `c3xl-dev` 或任何还没有 QNN 参数/原生组件的分支切到本分支时,必须重新执行 `build.py`/`scons`。启动脚本会检测 `C3XLQnnWifiEnabled` 是否已编译进 Params,发现缺失时自动强制重建一次,避免 manager 因 `UnknownKeyName` 启动失败。
## 构建注意
启用后会通过 `openpilot/sunnypilot/SConscript` 编译 `external_host/opif/SConscript`,生成 `opif_native` 和 C3XL 用的 `wifi_power_ctl`。Android 端模型 ABI 是 Cinque v3,不是普通 supercombo pkl 的直接替换。
+7
View File
@@ -124,6 +124,13 @@ function launch {
# start manager
cd openpilot/system/manager
# A branch switch can add Params keys or native sources while an old
# prebuilt library is still present. Detect the schema mismatch before
# manager starts and force one rebuild instead of crashing on UnknownKeyName.
if [ -f "$DIR/prebuilt" ] && ! PYTHONPATH="$DIR" python3 -c 'from openpilot.common.params import Params; Params().get_bool("C3XLQnnWifiEnabled")' >/dev/null 2>&1; then
echo "[bootstrap] Params schema changed; forcing rebuild"
rm -f "$DIR/prebuilt"
fi
if [ ! -f $DIR/prebuilt ]; then
./build.py
fi
+8 -1
View File
@@ -93,7 +93,14 @@ def is_stock_model(started, params, CP: car.CarParams) -> bool:
return bool(get_active_model_runner(params, not started) == custom.ModelManagerSP.Runner.stock)
def c3xl_qnn_discovery(started, params: Params, CP: car.CarParams) -> bool:
return get_hardware_profile() == HardwareProfile.C3XL and params.get_bool('C3XLQnnWifiEnabled')
if get_hardware_profile() != HardwareProfile.C3XL:
return False
try:
return params.get_bool('C3XLQnnWifiEnabled')
except Exception:
# Older compiled Params libraries do not know this key yet. The launcher
# forces a rebuild, and manager must still be able to start in the meantime.
return False
def mapd_ready(started: bool, params: Params, CP: car.CarParams) -> bool: