#!/usr/bin/env bash # Full Bench2Drive-220 eval of the ConsDrive v2 checkpoint on this 8-GPU box (no conda). # CARLA's -graphicsadapter=N is GPU N here, but the leaderboard maps --gpu-rank=k to adapter k+1, # so GPU 1 cannot host CARLA: its workers run the model on GPU 1 and CARLA on GPU 0. set -euo pipefail REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" cd "$REPO_ROOT" PY=/venv/consdrive/bin/python RUN_DIR=outputs/qwen3vl_2b_video_dream_consdrive_seed_42/2026-08-09_13-10-02 RESULT_ROOT="${RESULT_ROOT:-eval_results/Bench2Drive/consdrive_v2_full}" ROUTES=leaderboard/data/bench2drive220.xml export CARLA_ROOT=/workspace/carla0915 # model_gpu:carla_gpu_rank, two workers per entry. SLOTS=(0:0 1:0 2:1 3:2 4:3 5:4 6:5 7:6) WORKERS=$(( ${#SLOTS[@]} * 2 )) mkdir -p "$RESULT_ROOT/logs" "$RESULT_ROOT/scripts" mapfile -t SUBSETS < <($PY - "$ROUTES" "$WORKERS" <<'PY' import sys import xml.etree.ElementTree as ET ids = [r.attrib["id"] for r in ET.parse(sys.argv[1]).iter("route")] w = int(sys.argv[2]) for k in range(w): print(",".join(ids[k::w])) PY ) for ((w = 0; w < WORKERS; w++)); do slot=${SLOTS[$((w / 2))]} gpu=${slot%%:*} rank=${slot##*:} label=$(printf 'w%02d_g%d_cr%d' "$w" "$gpu" "$rank") launcher="$RESULT_ROOT/scripts/run_${label}.sh" cat > "$launcher" < '$RESULT_ROOT/logs/${label}.log' 2>&1; echo WORKER_EXIT=\$? >> '$RESULT_ROOT/logs/${label}.log'" sleep 3 done echo "launched $WORKERS workers; logs in $RESULT_ROOT/logs"