--- name: freetoken-build-dankclaw description: "Build FreeToken on Dankclaw (Ubuntu 24.04) with CUDA — installs nvidia-cuda-toolkit, sets CUDA_HOME=/usr, overrides nvcc/CUDA version mismatch" --- # FreeToken Build on Dankclaw Dankclaw is Ubuntu 24.04 with ROCm already installed. FreeToken builds for **CUDA** (not ROCm) because the kernel package (`_pinned_tensor`) links against `cudart`. ## Prerequisites (install if missing) ```bash export PATH="/home/dank/.local/bin:$PATH" export CUDA_HOME=/usr export FREETOKEN_ALLOW_CUDA_MISMATCH=1 # CUDA toolkit (if not present): sudo apt-get install -y nvidia-cuda-toolkit # UV (if not present): curl -LsSf https://astral.sh/uv/install.sh | sh ``` ## Key environment variables |Variable|Value|Why| |---|---|---| |`CUDA_HOME`|`/usr`|Ubuntu CUDA toolkit package places nvcc at `/usr/bin/nvcc` and libcudart at `/usr/lib/x86_64-linux-gnu/`| |`FREETOKEN_ALLOW_CUDA_MISMATCH=1`|Set|nvcc is 12.4 but torch 2.11.0+cu130 ships CUDA 13.0 — safe to override| |`PATH`|`/home/dank/.local/bin:$PATH`|uv installs here| ## Build procedure ```bash cd /home/dank git clone https://github.com/FlashML-org/FreeToken.git cd FreeToken uv venv && source .venv/bin/activate uv pip install -e ".[accel]" ``` ## Verification ```bash ft --version # → freetoken version 0.1.2 python3 -c "import torch; print(torch.__version__)" # → 2.11.0+cu130 python3 -c "from freetoken.kernel import _pinned_tensor; print(_pinned_tensor.__file__)" python3 -c "import flashinfer; print(flashinfer.__version__)" # → 0.6.18 python3 -c "import sgl_kernel; print(sgl_kernel.__version__)" # → 0.4.5 ``` ## Notes - `torch.cuda.is_available()` may return `False` with "Can't initialize NVML" warning — this is the management library, not CUDA runtime. The kernels are built and linked correctly. - The NVIDIA driver modules may or may not be loaded; they don't affect the build. - ROCm is present on Dankclaw but FreeToken's kernel build specifically requires CUDA (links `cudart`).