Team Ai
Modelpublic

reyden009/speculative-decoding-lab

sourceHugging Facemitupdated 2mo agoView on Hugging Face
8likes
prepare-cuda.sh25 linesDownload Raw Back to scripts
1#!/usr/bin/env bash2# Merges the NVIDIA wheels of the venv (uv) into a single CUDA tree for CMake.3# Produces .venv/cuda/{bin,include,lib} with symlinks; does NOT require sudo.4# Usage: bash scripts/prepare-cuda.sh5 6set -euo pipefail7REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"8VENV="$REPO/.venv"9NV="$VENV/lib/python3.12/site-packages/nvidia"10DEST="$VENV/cuda"11 12[ -d "$NV" ] || { echo "ERROR: NVIDIA wheels not found in $NV (did uv sync fail?)"; exit 1; }13 14mkdir -p "$DEST/bin" "$DEST/include" "$DEST/lib"15 16# nvcc17find "$NV" -path '*/bin/nvcc' -exec ln -sf {} "$DEST/bin/nvcc" \;18# headers (cuda.h, cublas_v2.h, ...)19find "$NV" -path '*/include/*' -name '*.h' -exec ln -sf {} "$DEST/include/" \;20# libraries (.so and .so.*)21find "$NV" -path '*/lib/*' -name 'lib*.so*' -exec ln -sf {} "$DEST/lib/" \;22 23echo "[prepare-cuda] toolkit merged at $DEST"24"$DEST/bin/nvcc" --version | tail -2 | head -125