k2-fsa / k2

FSA/FST algorithms, differentiable, with PyTorch compatibility.
https://k2-fsa.github.io/k2
Apache License 2.0
1.07k stars 211 forks source link

Installation on Windows with GPU #1263

Open ron-wein opened 7 months ago

ron-wein commented 7 months ago

I have a Windows machine (Windows 10 Pro, version 22H2) with an Nvidia GeForce RTX 4080 GPU installed on it. I'm trying to install k2 on this machine, and following a previous thread I understand I have to do this very carefully...

So I have already installed MSVC, CUDA (version 12.2) and CuDNN and then torch version 1.11.0+cu113 and torchaudio version 0.11.0+cu113

I understand that performing a plain "pip install k2" may not work properly. Do you have any recommendation on what version/command should I execute next?

Thanks a lot in advance, Ron

csukuangfj commented 7 months ago

Please install k2 from source if you want to use GPU on windows.

Please have a look at https://github.com/k2-fsa/k2/issues/1256#issuecomment-1839107455

Since you have already installed MSVC, cudatoolkit, cudnn, and PyTorch, I think you only need to run

pip install git+https://github.com/k2-fsa/k2
csukuangfj commented 7 months ago

So I have already installed MSVC, CUDA (version 12.2) and CuDNN and then torch version 1.11.0+cu113

Wait.

Your cuda is 12.2, but your torch is 1.11.0+cu113.

Please keep the two cuda versions the same.

For instance, you use torch 1.11.0+cu113, so please install cuda 11.3.

Also, I suggest that you upgrade your torch to 1.13.0