Skip to content

torch::install_torch() succeeds (all files present) but library(torch) fails with "Lantern is not loaded" / system.file() "no file found" — Windows, v0.17.0, cu128 #1479

Description

@lundc01

Environment:

  • torch version: 0.17.0
  • OS: Windows 10/11
  • CUDA build: cu128 (also reproduced with cu129 before switching)
  • R: 4.6.1

Problem:
install_torch() completes successfully every time — both LibTorch (~3.2GB)
and Lantern (~2.3MB) download to their exact reported byte sizes, with no
warnings. But library(torch) / torch::cuda_is_available() then fails with:

Error: Lantern is not loaded. Please use install_torch() to install
additional dependencies.
Caused by error in system.file(): ! no file found

What I've ruled out:

  • Confirmed lantern.dll, torch.dll, torch_cuda.dll, and all CUDA/cuDNN DLLs
    ARE physically present in .../win-library/4.6/torch/lib/ (verified via
    File Explorer screenshot)
  • .libPaths() correctly includes the folder where these files live
  • Not an antivirus/quarantine issue (Windows Defender Protection History
    empty; exclusions added for the install folder regardless)
  • Not a path-length issue (tested with TORCH_HOME set to a short path,
    C:/torchlib — same error)
  • Not RStudio-specific (identical error in plain RGui, outside RStudio)
  • Not a stale/corrupted previous install (identical error after
    remove.packages() + manual folder deletion + fresh install)
  • Not a download/network issue (both files match exact reported byte size
    every time, multiple independent attempts)
  • Tried creating a "deps" subfolder (matching an older, possibly outdated
    internal path convention) as a copy of "lib" — no change
  • rlang::last_trace() reports no error was recorded; options(error =
    traceback) also produces no additional stack trace — the error appears
    to be caught and re-messaged internally before reaching R's standard
    error-reporting mechanisms, so I can't get further diagnostic detail
    from the R session itself.

Happy to provide any additional diagnostics on request — just not sure
what else to check from the outside at this point.

Activity

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions