huggingface / candle

Minimalist ML framework for Rust
Apache License 2.0
14.97k stars 868 forks source link

linking with `link.exe` failed: exit code: 1120 #1882

Open kulame opened 5 months ago

kulame commented 5 months ago

i try to compile candle in windows.

cargo run --example stable-diffusion --release --features=cuda,cudnn -- --prompt "a cosmonaut on a horse (hd, realistic, high-def)"

it failed on link

   Compiling candle-examples v0.4.2 (C:\code\rust\candle\candle-examples)
error: linking with `link.exe` failed: exit code: 1181
  = note: libcudarc-7e61ad986ae469c0.rlib(cudarc-7e61ad986ae469c0.cudarc.1b8aab8e6cfb60e0-cgu.06.rcgu.o) : error LNK2019: unresolved external symbol cudnnAdvInferVersionCheck referenced in function _ZN6cudarc5cudnn6result13version_check17h43d83b8ee3072371E
          libcudarc-7e61ad986ae469c0.rlib(cudarc-7e61ad986ae469c0.cudarc.1b8aab8e6cfb60e0-cgu.06.rcgu.o) : error LNK2019: unresolved external symbol cudnnAdvTrainVersionCheck referenced in function _ZN6cudarc5cudnn6result13version_check17h43d83b8ee3072371E
          libcudarc-7e61ad986ae469c0.rlib(cudarc-7e61ad986ae469c0.cudarc.1b8aab8e6cfb60e0-cgu.06.rcgu.o) : error LNK2019: unresolved external symbol cudnnCnnInferVersionCheck referenced in function _ZN6cudarc5cudnn6result13version_check17h43d83b8ee3072371E
          libcudarc-7e61ad986ae469c0.rlib(cudarc-7e61ad986ae469c0.cudarc.1b8aab8e6cfb60e0-cgu.06.rcgu.o) : error LNK2019: unresolved external symbol cudnnCnnTrainVersionCheck referenced in function _ZN6cudarc5cudnn6result13version_check17h43d83b8ee3072371E
          libcudarc-7e61ad986ae469c0.rlib(cudarc-7e61ad986ae469c0.cudarc.1b8aab8e6cfb60e0-cgu.06.rcgu.o) : error LNK2019: unresolved external symbol cudnnOpsInferVersionCheck referenced in function _ZN6cudarc5cudnn6result13version_check17h43d83b8ee3072371E
          libcudarc-7e61ad986ae469c0.rlib(cudarc-7e61ad986ae469c0.cudarc.1b8aab8e6cfb60e0-cgu.06.rcgu.o) : error LNK2019: unresolved external symbol cudnnOpsTrainVersionCheck referenced in function _ZN6cudarc5cudnn6result13version_check17h43d83b8ee3072371E
          C:\code\rust\candle\target\release\examples\stable_diffusion.exe : fatal error LNK1120: 6 unresolved externals

error: could not compile `candle-examples` (example "stable-diffusion") due to 1 previous error

what's wrong with this error?

kulame commented 5 months ago

I'm still waiting for an answer.

newfla commented 5 months ago

I encountered the same problem. Pipeline log

newfla commented 3 months ago

I can confirm the issue on cuda 12.4 with both cudnn 9.1 and 8.9.7 It would be nice if some of the developers could look into this issue

LaurentMazare commented 3 months ago

We've just the upgrade for the latest version of the cuda bindings (cudarc 0.11) in #2165 It might be good to try again though it's worth pointing out that it's only supposed to support cuda up to 12.3, cuda 12.4 support is upcoming.

newfla commented 3 months ago

We've just the upgrade for the latest version of the cuda bindings (cudarc 0.11) in #2165 It might be good to try again though it's worth pointing out that it's only supposed to support cuda up to 12.3, cuda 12.4 support is upcoming.

Unfortunately it has not solved completely the issue: now it's complaining about cublasHgemm 😢 Windows 11, cuda 12.3, cudnn 8.9.7 Env vars: image

 LINK : warning LNK4098: la libreria predefinita 'LIBCMT' è in conflitto con l'utilizzo di altre librerie; usare /NODEFAULTLIB:libreria
          libcudarc-d549b1345f494693.rlib(cudarc-d549b1345f494693.cudarc.80447e6473cb0ba3-cgu.11.rcgu.o) : error LNK2019: riferimento al simbolo esterno cublasHgemm non risolto nella funzione _ZN6cudarc6cublas6result5hgemm17h2070933db030342cE
          libcudarc-d549b1345f494693.rlib(cudarc-d549b1345f494693.cudarc.80447e6473cb0ba3-cgu.11.rcgu.o) : error LNK2019: riferimento al simbolo esterno cublasHgemmStridedBatched non risolto nella funzione _ZN6cudarc6cublas6result21hgemm_strided_batched17h4a8dda451c959c9fE

Related to https://github.com/coreylowman/cudarc/issues/228