#!/usr/bin/env bash # SUM Parts - bring a bare machine to the point where setup_env.sh can run # # setup_env.sh and setup_pointnext.sh both assume two things already exist: # ~/miniconda3 (they call conda directly) # ~/sum-parts (the upstream benchmark clone they build inside) # # On a fresh machine neither is there, so this runs first. Idempotent: an # existing miniconda or clone is left alone. # # No sudo anywhere. Miniconda installs to $HOME, and the CUDA toolkit comes # from conda rather than apt, so this works on locked-down machines. set -euo pipefail CONDA_ROOT="$HOME/miniconda3" REPO_DIR="$HOME/sum-parts" UPSTREAM="https://github.com/tudelft3d/SUM-Parts-Benchmarks.git" echo "=== [1/3] miniconda ===" if [ -x "$CONDA_ROOT/bin/conda" ]; then echo " present: $($CONDA_ROOT/bin/conda --version)" else echo " installing to $CONDA_ROOT" TMP=$(mktemp -d) curl -fsSL -o "$TMP/miniconda.sh" \ https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh bash "$TMP/miniconda.sh" -b -p "$CONDA_ROOT" rm -rf "$TMP" echo " installed: $($CONDA_ROOT/bin/conda --version)" fi echo echo "=== [2/3] upstream benchmark repo ===" if [ -d "$REPO_DIR/.git" ]; then echo " present: $REPO_DIR ($(cd "$REPO_DIR" && git log --oneline -1))" else echo " cloning $UPSTREAM" git clone --depth 1 "$UPSTREAM" "$REPO_DIR" echo " cloned: $(cd "$REPO_DIR" && git log --oneline -1)" fi BUNDLE="$REPO_DIR/semantic_segmentation/PointNeXt_bundle" if [ ! -d "$BUNDLE" ]; then echo "error: $BUNDLE missing -- upstream layout changed?" >&2 exit 1 fi echo " bundle: $BUNDLE" echo echo "=== [3/3] GPU visible ===" if ! command -v nvidia-smi > /dev/null; then echo " WARNING: nvidia-smi not found. On WSL2 this means the driver is not" echo " exposing the GPU; fix that before continuing -- nothing below works" echo " without it." else nvidia-smi --query-gpu=name,memory.total,driver_version --format=csv,noheader TOTAL=$(nvidia-smi --query-gpu=memory.total --format=csv,noheader,nounits | head -1) echo if [ "$TOTAL" -ge 20000 ]; then echo " ${TOTAL} MiB -- the paper setting voxel_max=64000 (needs ~16.5 GB) fits." else echo " ${TOTAL} MiB -- voxel_max=64000 needs ~16.5 GB and will NOT fit." echo " Use scripts/sweep_voxel_max.sh to find the largest value that does." fi fi echo echo "BOOTSTRAP DONE -- next: bash scripts/setup_env.sh"