Skip to content

Falling back from CUDA to CPU torch leaves torch unimportable on Windows #731

Closed

Description

@thcp

Split out of #723.

What goes wrong

After a CUDA torch install fails verification on Windows, the desktop app puts CPU torch back. The result cannot be imported at all: OSError: [WinError 127] ... c10_cuda.dll. From then on the backend cannot run separation on any device, and setup still reports success.

Why

The restore installs CPU torch over the CUDA one with pip install --ignore-installed --no-deps. That overwrites files both wheels share, but never removes files only the CUDA wheel has, such as c10_cuda.dll and torch_cuda.dll. On Windows, torch loads every DLL in torch/lib, so the leftover CUDA DLL from one torch version fails to link against the restored CPU DLLs from another.

Nothing checks that torch imports after the restore.

Constraints

  • The torch that shipped in the bundle is known to work, and it is on disk before any CUDA attempt. Putting back exactly that needs no network.
  • A crash or forced quit in the middle of a swap must be recoverable on the next launch.
  • Installs that are already broken have no backup to restore from.

Activity

  1. added
    bugSomething isn't working
    on Sep 30, 2026
  2. self-assigned this
    on Oct 1, 2026
  3. added a commit that references this issue on Oct 1, 2026
    d78fa34
  4. added a commit that references this issue on Oct 2, 2026
    939d66e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions