From b80aee1e46fea6bea620203d747d2435368eb6d0 Mon Sep 17 00:00:00 2001 From: Thales <> Date: Wed, 24 Jun 2026 20:44:50 +0100 Subject: [PATCH] fix: remove orphaned nvidia-* CUDA packages from Linux bundle Both Linux tarballs were 2.5 GB (over GitHub's 2 GiB asset limit) even with CPU torch. Root cause: 'uv pip install ' pulls the default Linux torch, which is the CUDA build, dragging in nvidia-* runtime packages (cuDNN/cuBLAS/NCCL/...) and triton (~2.5 GB). The CPU torch swap uses --force-reinstall --no-deps, so torch becomes CPU but those CUDA packages stay installed and orphaned, bloating the tarball. Uninstall the nvidia-* packages and triton after the swap. CPU torch does not use them and the NVIDIA variant re-downloads CUDA at first run. --- scripts/linux/make-portable.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/linux/make-portable.sh b/scripts/linux/make-portable.sh index c0eec902..18412c82 100755 --- a/scripts/linux/make-portable.sh +++ b/scripts/linux/make-portable.sh @@ -114,6 +114,19 @@ echo "==> Baking CPU-only torch (NVIDIA variant downloads CUDA at first run)" --index-url https://download.pytorch.org/whl/cpu \ --force-reinstall --no-deps +# The project install above pulled the default Linux torch, which is the CUDA +# build, dragging in nvidia-* CUDA runtime packages (cuDNN, cuBLAS, NCCL, ...) and +# triton -- together ~2.5 GB. The CPU torch swap used --no-deps, so those packages +# are now orphaned but still installed, bloating the tarball past GitHub's 2 GiB +# asset limit. Remove them: CPU torch does not use them, and the NVIDIA variant +# re-downloads CUDA at first run anyway. +echo "==> Removing orphaned CUDA runtime packages" +orphans=$("$BUNDLED_PYTHON" -m pip list --format=freeze 2>/dev/null \ + | sed -n 's/^\(nvidia-[^=]*\)==.*/\1/p') +orphans="$orphans triton" +echo " removing:$orphans" +"$BUNDLED_PYTHON" -m pip uninstall -y $orphans 2>/dev/null || true + echo "==> Verifying imports" "$BUNDLED_PYTHON" -c "import fastapi, uvicorn, yt_dlp, demucs, torch, torchaudio, librosa, pyloudnorm, soundfile; print('torch', torch.__version__, 'cuda', torch.version.cuda)"