Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

torch_cuda.dll not linked when using dynamic linking, and missing clog.lib when static linking #921

Open
ViliamVadocz opened this issue Dec 29, 2024 · 0 comments

Comments

@ViliamVadocz
Copy link
Contributor

tch-rs version: 0.18.1
LibTorch version: Stable (2.5.1), CUDA 12.4, Release
CUDA: 12.6
OS: Windows 10, 64-bit
cargo: 1.85.0-nightly (c86f4b3a1 2024-12-24)

I am using a local LibTorch (see version above), and linking dynamically. Compilation succeeds, but very soon I run into a runtime error:

Could not run 'aten::empty.memory_format' with arguments from the 'CUDA' backend. This could be because the operator doesn't exist for this backend, or was omitted during the selective/custom build process (if using custom build). If you are a Facebook employee using PyTorch on mobile, please visit https://fburl.com/ptmfixes for possible resolutions. 'aten::empty.memory_format' is only available for these backends:
... // I cut this short for readability

From trying to debug this myself, I think it has something to do with the fact that torch_cuda.dll is not linked to: dumpbin /imports my_binary.exe shows torch_cpu.dll, but not torch_cuda.dll.


I tried linking statically instead, but there I ran into this problem:

error: linking with `link.exe` failed: exit code: 1356
  |
  = note: ... // removed this for readability
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: LINK : fatal error LNK1356: cannot find library `clog.lib' specified to be whole archived␍

I don't know what clog.lib is, and it is difficult to find out because there seem to be many things called clog. To my best guess is that it is related to this: https://github.com/pytorch/cpuinfo/tree/main/deps/clog

Good news about this approach is that torch_cuda.dll is mentioned in the linker arguments, but bad news is that it does not even build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant