Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,17 @@ if [ "$GPU" == "-cuda" ] && [ "$OS" == "Darwin" ]; then
exit 1
fi

# There are only two supported CUDA version. Let it fail if unsupported.
if [ "$GPU" == "-cuda" ]; then
export PATH="/usr/local/cuda/bin:$PATH"
CUDA_MAJ=$(nvcc --version | grep -oP "(?<=release )\d+") || 0
if [[ $CUDA_MAJ == 12 ]]; then
CUDA_VERSION="-12-0";
elif [[ $CUDA_MAJ == 11 ]]; then
CUDA_VERSION="-11-7"
fi
fi

# Construct GitHub API URL and get latest version if not specified
if [ "$VERSION" == "latest" ]; then
API_URL="https://api.github.com/repos/janhq/nitro/releases/latest"
Expand All @@ -116,7 +127,7 @@ fi
# Construct download URL based on OS, ARCH, GPU and VERSION
case $OS in
Linux)
FILE_NAME="nitro-${VERSION}-linux-amd64${GPU}.tar.gz"
FILE_NAME="nitro-${VERSION}-linux-amd64${GPU}${CUDA_VERSION}.tar.gz"
;;
Darwin)
ARCH_FORMAT=$( [[ "$ARCH" == "arm64" ]] && echo "mac-arm64" || echo "mac-amd64")
Expand Down