idiap / fast-transformers

Pytorch library for fast transformer implementations
1.65k stars 179 forks source link

Installation failed on Windows #97

Closed WRKULOL closed 2 years ago

WRKULOL commented 3 years ago

Hello. I met trouble when I tried to install the package on Windows. I tried to change my cuda toolkit version, change my python version, change my pytorch version, but the same problem still appeared. Here is the environment and error log of my last attempt.

OS: Windows 10

cuda toolkit version: 10.2

nvcc -V output:

nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2019 NVIDIA Corporation Built on Wed_Oct_23_19:32:27_Pacific_Daylight_Time_2019 Cuda compilation tools, release 10.2, V10.2.89

python version: 3.8.10

pytorch version: 1.9.0

Error log (the last few meaningful lines:)

E:\vc\VC\Tools\MSVC\14.29.30037\bin\HostX86\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:D:\conda\envs\hl\lib\site-packages\torch\lib "/LIBPATH:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\lib/x64" /LIBPATH:D:\conda\envs\hl\libs /LIBPATH:D:\conda\envs\hl\PCbuild\amd64 /LIBPATH:E:\vc\VC\Tools\MSVC\14.29.30037\lib\x64 "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.7\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x64" c10.lib torch.lib torch_cpu.lib torch_python.lib cudart.lib c10_cuda.lib torch_cuda.lib /EXPORT:PyInit_local_product_cuda C:\Users\User\AppData\Local\Temp\pip-install-hvk5cx9o\pytorch-fast-transformers_143dc9da8a604ae992094941d703fc31\build\temp.win-amd64-3.8\Release\fast_transformers/local_product/local_product_cuda.obj /OUT:build\lib.win-amd64-3.8\fast_transformers\local_product\local_product_cuda.cp38-win_amd64.pyd /IMPLIB:C:\Users\User\AppData\Local\Temp\pip-install-hvk5cx9o\pytorch-fast-transformers_143dc9da8a604ae992094941d703fc31\build\temp.win-amd64-3.8\Release\fast_transformers/local_product\local_product_cuda.cp38-win_amd64.lib Creating library C:\Users\User\AppData\Local\Temp\pip-install-hvk5cx9o\pytorch-fast-transformers_143dc9da8a604ae992094941d703fc31\build\temp.win-amd64-3.8\Release\fast_transformers/local_product\local_product_cuda.cp38-win_amd64.lib and object C:\Users\User\AppData\Local\Temp\pip-install-hvk5cx9o\pytorch-fast-transformers_143dc9da8a604ae992094941d703fc31\build\temp.win-amd64-3.8\Release\fast_transformers/local_product\local_product_cuda.cp38-win_amd64.exp local_product_cuda.obj : error LNK2001: unresolved external symbol "public: long * __cdecl at::Tensor::data_ptr(void)const " (??$data_ptr@J@Tensor@at@@QEBAPEAJXZ) build\lib.win-amd64-3.8\fast_transformers\local_product\local_product_cuda.cp38-win_amd64.pyd : fatal error LNK1120: 1 unresolved externals error: command 'E:\vc\VC\Tools\MSVC\14.29.30037\bin\HostX86\x64\link.exe' failed with exit status 1120 ERROR: Failed building wheel for pytorch-fast-transformers

Please tell me how to fix it, thank you.

maulberto3 commented 2 years ago

Hi, have you tried WSL2?

WRKULOL commented 2 years ago

Hello. This issue is opened when Windows 11 wasn't out. Now WSL2 with CUDA is compatible enough. Thank you.