Skip to content

Commit e0a3d7a

Browse files
Michael YuanMichael Yuan
authored andcommitted
Detect ARM64 + CUDA (Jetson) in install.sh and bootstrap.sh
install.sh: prompts user to choose CUDA vs CPU when nvidia-smi detected on aarch64 bootstrap.sh: auto-selects aarch64-cuda asset when NVIDIA GPU detected Both rely on bundled libtorch/ in the release zip (no separate download needed)
1 parent b8dd102 commit e0a3d7a

2 files changed

Lines changed: 33 additions & 2 deletions

File tree

install.sh

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,30 @@ resolve_asset() {
103103
ASSET_NAME="asr-linux-x86_64"
104104
fi
105105
;;
106-
linux-aarch64) ASSET_NAME="asr-linux-aarch64" ;;
106+
linux-aarch64)
107+
if [ -n "$CUDA_DRIVER" ]; then
108+
echo ""
109+
info "NVIDIA GPU detected on ARM64 (Jetson). Choose build variant:"
110+
echo " 1) CUDA 12.6 (recommended for Jetson)"
111+
echo " 2) CPU only"
112+
echo ""
113+
114+
local choice
115+
read -r -p "Select variant [1]: " choice </dev/tty
116+
choice="${choice:-1}"
117+
118+
case "$choice" in
119+
1) USE_CUDA="true"; ASSET_NAME="asr-linux-aarch64-cuda" ;;
120+
2) USE_CUDA="false"; ASSET_NAME="asr-linux-aarch64" ;;
121+
*)
122+
warn "Invalid choice '${choice}', defaulting to CUDA."
123+
USE_CUDA="true"; ASSET_NAME="asr-linux-aarch64-cuda"
124+
;;
125+
esac
126+
else
127+
ASSET_NAME="asr-linux-aarch64"
128+
fi
129+
;;
107130
macos-x86_64)
108131
err "macOS x86_64 (Intel) is not supported. Apple Silicon required."
109132
exit 1

skills/bootstrap.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ detect_platform() {
3333
echo "${os}-${arch}"
3434
}
3535

36+
has_nvidia_gpu() {
37+
command -v nvidia-smi &>/dev/null && nvidia-smi --query-gpu=driver_version --format=csv,noheader &>/dev/null
38+
}
39+
3640
get_asset_name() {
3741
local platform="$1"
3842

@@ -41,7 +45,11 @@ get_asset_name() {
4145
echo "asr-linux-x86_64"
4246
;;
4347
linux-aarch64)
44-
echo "asr-linux-aarch64"
48+
if has_nvidia_gpu; then
49+
echo "asr-linux-aarch64-cuda"
50+
else
51+
echo "asr-linux-aarch64"
52+
fi
4553
;;
4654
darwin-aarch64)
4755
echo "asr-macos-aarch64"

0 commit comments

Comments
 (0)