LaurentMazare / tch-rs

Rust bindings for the C++ api of PyTorch.
Apache License 2.0
4.38k stars 347 forks source link

libtorch & tch-rs version suitable in windows 11 #782

Open Sola-AIGithub opened 1 year ago

Sola-AIGithub commented 1 year ago

My cuda version is 11.2, which version of libtorch & tch-rs is suitable for me? Thanks lot!

PS D:\tch-rs> nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Sun_Feb_14_22:08:44_Pacific_Standard_Time_2021
Cuda compilation tools, release 11.2, V11.2.152
Build cuda_11.2.r11.2/compiler.29618528_0
PS D:\tch-rs> cargo run --example basics
    Updating crates.io index
   Compiling version_check v0.9.4
   Compiling typenum v1.16.0
   Compiling cfg-if v1.0.0
   Compiling jobserver v0.1.26
   Compiling pkg-config v0.3.27
   Compiling subtle v2.5.0
   Compiling libc v0.2.147
   Compiling autocfg v1.1.0
   Compiling cpufeatures v0.2.9
   Compiling base64ct v1.6.0
   Compiling proc-macro2 v1.0.66
   Compiling zstd-safe v5.0.2+zstd.1.5.2
   Compiling unicode-ident v1.0.11
   Compiling crc32fast v1.3.2
   Compiling cc v1.0.82
   Compiling adler v1.0.2
   Compiling miniz_oxide v0.7.1
   Compiling generic-array v0.14.7
   Compiling time-core v0.1.1
   Compiling rand_core v0.6.4
   Compiling deranged v0.3.7
   Compiling getrandom v0.2.10
   Compiling anyhow v1.0.72
   Compiling password-hash v0.4.2
   Compiling constant_time_eq v0.1.5
   Compiling byteorder v1.4.3
   Compiling flate2 v1.0.26
   Compiling num-traits v0.2.16
   Compiling serde v1.0.183
   Compiling matrixmultiply v0.3.7
   Compiling num-integer v0.1.45
   Compiling quote v1.0.32
   Compiling time v0.3.25
   Compiling serde_json v1.0.104
   Compiling syn v2.0.28
   Compiling itoa v1.0.9
   Compiling ppv-lite86 v0.2.17
   Compiling rawpointer v0.2.1
   Compiling thiserror v1.0.44
   Compiling ryu v1.0.15
   Compiling tch v0.13.0 (D:\tch-rs)
   Compiling rand_chacha v0.3.1
   Compiling half v2.3.1
   Compiling lazy_static v1.4.0
   Compiling zstd-sys v2.0.8+zstd.1.5.5
   Compiling bzip2-sys v0.1.11+1.0.8
   Compiling crypto-common v0.1.6
   Compiling block-buffer v0.10.4
   Compiling inout v0.1.3
   Compiling rand v0.8.5
   Compiling digest v0.10.7
   Compiling cipher v0.4.4
   Compiling sha2 v0.10.7
   Compiling hmac v0.12.1
   Compiling aes v0.8.3
   Compiling sha1 v0.10.5
   Compiling num-complex v0.4.3
   Compiling pbkdf2 v0.11.0
   Compiling ndarray v0.15.6
   Compiling serde_derive v1.0.183
   Compiling thiserror-impl v1.0.44
   Compiling bzip2 v0.4.4
   Compiling zstd v0.11.2+zstd.1.5.2
   Compiling zip v0.6.6
   Compiling torch-sys v0.13.0 (D:\tch-rs\torch-sys)
   Compiling safetensors v0.3.2
    Finished dev [unoptimized + debuginfo] target(s) in 30.52s
     Running `target\debug\examples\basics.exe`
error: process didn't exit successfully: `target\debug\examples\basics.exe` (exit code: 0xc0000139, STATUS_ENTRYPOINT_NOT_FOUND)
Sola-AIGithub commented 1 year ago

I'm using libtorch-win-shared-with-deps-2.0.0+cu117 & tch version = "0.13.0"

LaurentMazare commented 1 year ago

Should be all good, tch 0.13.0 is compatible with pytorch 2.0.0 (this is mentioned in the readme for each versions, e.g. on crates.io).