Skip to content

Windows wheels resolve unpinned torch dependency to CPU-only build: 'cannot use CUDA device 0: only 0 device(s) visible' #607

Open

Description

@pablosilva87

Summary

The Windows wheels don't constrain their torch dependency to the CUDA build, so a fresh install (or any --reinstall) that resolves torch from PyPI silently yields CPU-only torch, and the engine then fails with:

Backend supervisor: RuntimeError: cannot use CUDA device 0: only 0 device(s) visible (CUDA_VISIBLE_DEVICES=None)

Repro

uv pip install --python <ft venv python> --reinstall \
  https://github.com/FlashML-org/FreeToken-Web/releases/download/beta/freetoken-0.1.3%2Bgfa0e9537d-cp312-cp312-win_amd64.whl \
  https://github.com/FlashML-org/FreeToken-Web/releases/download/beta/freetoken_kernel_cache-0.1.3%2Bcu130.gfa0e9537d-py3-none-win_amd64.whl

uv resolves the wheel's Requires-Dist: torch (unpinned) from PyPI:

- torch==2.11.0+cu130
+ torch==2.11.0            # CPU build, no CUDA
+ torchvision==0.26.0      # was 0.26.0+cu130

torch.cuda.is_available() → False, torch.version.cuda → None. Engine can't see the GPU at all. The engine itself is fine — re-installing the CUDA build from the PyTorch index restores everything:

uv pip install --python <ft venv python> --reinstall-package torch --reinstall-package torchvision \
  "torch==2.11.0+cu130" "torchvision==0.26.0+cu130" --index-url https://download.pytorch.org/whl/cu130

Suggested fixes (any one would do)

  1. Pin the CUDA build in the wheel metadata: torch==2.11.0+cu130 — pip/uv can fetch it given the documented extra index, and existing installs keep resolving correctly.
  2. Or declare torch>=2.11,<2.12 plus a runtime self-check at ft serve startup: if torch.version.cuda is None, fail with "CPU-only torch installed — see install docs" instead of the cryptic "0 device(s) visible".
  3. Or document the exact torch requirement next to the wheel URLs.

Seen on Windows 11, Python 3.12.10, uv 0.9.x, engine 0.1.3+gfa0e9537d.

Activity

  1. jason-fxz commented on Oct 5, 2026

    @jason-fxz
    Collaborator

    Thanks for the report! The cause: on Windows, PyPI only ships CPU-only torch, and a manual --reinstall without --torch-backend=cu130 pulls that build in.

    If you're on FreeToken Desktop, the easiest way to update is Settings -> Engine -> Reinstall engine. It always installs the latest engine with the CUDA torch build.

    If you update by hand, just add --torch-backend=cu130 to your command:

    uv pip install --python <ft venv python> --reinstall --torch-backend=cu130 <freetoken whl> <freetoken_kernel_cache whl>

    We'll add install notes next to the Windows wheels on the release page so this is clearer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions