pip install torch Pulls 2,861 MiB, and 82% of It Is CUDA
A small Linux VM installs torch and pays for 2.3 GiB of CUDA libraries the machine cannot use.
📜 Table of Contents
- What the resolver actually pulls
- Why a CPU box still gets CUDA
- The CPU-only path
- What the difference costs on a small VPS
- When the CUDA build is the right call
- Check it before you install
- Related measurements
- FAQ
- Does pip behave the same as uv here?
- Will the CPU wheel break my imports?
- I already installed the CUDA build by accident. What now?
📖 Keep reading
On Linux x86_64, resolving torch 2.15.0 for CPython 3.12 returns 29 packages and 2,861 MiB of wheel downloads. Nineteen of those packages are NVIDIA libraries plus Triton. Together they weigh 2,337 MiB, 82% of the download, and on a machine with no GPU none of them ever executes. The CPU-only index installs the same torch from 10 packages and 210 MiB.
Every size below comes from PyPI's JSON metadata for the exact wheel versions a resolver picked for manylinux_2_28, cross-checked with a dry run. No vendor page was trusted for a number.
What the resolver actually pulls
| package | version | wheel | runs on CPU? |
|---|---|---|---|
| torch | 2.15.0 | 514.2 MB | yes, but built against CUDA 13 |
| nvidia-cudnn-cu13 | 9.26.0.51 | 495.1 MB | no |
| nvidia-cublas | 13.4.1.3 | 386.1 MB | no |
| triton | 3.9.0 | 272.6 MB | no |
| nvidia-cusolver | 12.2.0.11 | 217.4 MB | no |
| nvidia-cufft | 12.2.0.57 | 208.1 MB | no |
| nvidia-nccl-cu13 | 2.30.7 | 206.0 MB | no |
| nvidia-cusparselt-cu13 | 0.8.1 | 162.3 MB | no |
| nvidia-cusparse | 12.7.10.12 | 144.0 MB | no |
| nvidia-nvshmem-cu13 | 3.7.2 | 129.1 MB | no |
| nvidia-cuda-nvrtc | 13.2.86 | 44.8 MB | no |
| nvidia-nvjitlink | 13.5.37 | 44.5 MB | no |
| the other 17 packages | n/a | 36.8 MB | mostly yes |
The other 17 packages add 36.8 MB: six more cuda modules (cupti 11.4, cuda-bindings 8.1, cccl 3.9, cuda-runtime 2.2, cufile 1.3, nvtx 0.1), two empty or tiny entries (cuda-pathfinder, cuda-toolkit), and the Python side of the tree, sympy 6.0, networkx 2.0, setuptools 0.8, mpmath 0.5, filelock, fsspec, jinja2, markupsafe and typing-extensions. cuda-toolkit 13.2.2 is a metapackage with no wheel of its own, so its row would read 0 MB; its weight sits in the nvidia-* rows it expands into.
Why a CPU box still gets CUDA
The Linux wheels declare this stack as a hard requirement, gated only by platform_system == "Linux", never by the presence of a GPU. The identical resolution for Windows returns 6 packages and no NVIDIA wheel at all. The trap is specific to the environment most small deployments actually use: a Linux VPS, a container image, a CI runner.
The chain matters if you want to trim it deliberately. torch 2.15 depends on cuda-toolkit, cuda-bindings, cudnn, cusparselt, nccl, nvshmem and triton. cudnn pulls cublas; cublas pulls nvrtc; cuda-toolkit expands into cusolver, cufft, cusparse, cupti, cuda-runtime, nvjitlink and cufile. Remove any link by hand and the resolver reinstalls it on the next upgrade.
The CPU-only path
uv pip install --index-url https://download.pytorch.org/whl/cpu "torch==2.15.0+cpu"
A dry run against that index resolves 10 packages and 210 MiB: torch at 199.8 MB instead of 514.2 MB, plus sympy 6.0, networkx 2.0, setuptools 0.8, mpmath 0.5, filelock 0.2, fsspec 0.2, jinja2 0.1, markupsafe and typing-extensions. No nvidia row, no triton, no cuda-toolkit.
The index URL has to be passed as --index-url, which replaces PyPI for that command. Adding it as --extra-index-url keeps both indexes in play and leaves the resolver free to pick the PyPI build, which is the CUDA one.
What the difference costs on a small VPS
| path | packages | download | at 10 Mbit/s | at 100 Mbit/s |
|---|---|---|---|---|
| PyPI torch (CUDA) | 29 | 2,861 MiB | 38 min | 3.8 min |
| CPU index | 10 | 210 MiB | 2.8 min | 17 s |
Those times are arithmetic on the wheel bytes at a sustained 1.25 MB/s and 12.5 MB/s, with no retries. They cover download only. Unpacked, the CUDA tree takes more disk than the compressed wheels, which matters on a 20 GB volume that also holds a model and a database.
When the CUDA build is the right call
If the box has an NVIDIA GPU and you are doing inference or fine-tuning on it, the PyPI wheel is exactly what you want, and the 2.3 GiB of libraries is the price of not compiling anything. If the box is a CPU VPS running embeddings, a reranker or classical ML, the 200 MB wheel does the same work more slowly.
For embeddings specifically, torch is not the only option: onnxruntime 1.32.0 is a 26.5 MB Linux wheel and faiss-cpu 1.16.0 is 18.6 MB, both with no CUDA dependencies. sentence-transformers ships a universal wheel, so it never decides which torch you get; install torch from the CPU index first and it will use that build.
Check it before you install
uv pip install --dry-run --python-platform x86_64-manylinux_2_28 --python-version 3.12 torch==2.15.0
pip download --no-deps --only-binary=:all: torch==2.15.0 -d /tmp/check
The first prints the package list without downloading anything. The second downloads exactly one wheel so you can see its size. Either one takes less time than a failed deploy on a 20 GB disk.
Related measurements
- What pip install crewai pulls: 807 MB across 120 packages
- KV cache VRAM per user at 32k context
- Q4_K_M measured at 4.9 bits per weight
FAQ
Does pip behave the same as uv here?
Yes. Both read the same wheel metadata, and the NVIDIA packages are listed as install requirements rather than optional extras, so pip will pull them too. The package count can differ by a version or two depending on when each resolver runs.
Will the CPU wheel break my imports?
No. It is the same import torch with the same API. Operations run on the CPU, so training is slow, but inference on small models and embedding workloads are fine.
I already installed the CUDA build by accident. What now?
In a virtualenv, delete the environment and reinstall from the CPU index; that is faster than uninstalling 19 packages. System-wide, pip uninstall -y torch triton followed by a check of pip list | grep nvidia is the short version, and any leftover nvidia package can be removed by name.
Written by our editorial team; tools listed here are tested or verified against public sources. Links point to official sites or GitHub repos for reference only — no paid placements.