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

Fix installing from source on Windows by explicitly mentioning cusparse in setup.py #534

Merged
merged 1 commit into from
Jun 19, 2023

Conversation

aiddun
Copy link
Contributor

@aiddun aiddun commented Jun 17, 2023

Motivation and Context

Currently, when building from source on windows with CUDA 11.8 and Visual Studio 2022, one gets the following error - noticeably, this build command mentions cusolver.lib c10.lib torch.lib torch_cpu.lib etc, but not cusparse.lib. I haven't ran every test but this works with the basic ones that don't require installing a lot of dependencies, like theseus layer.

    "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\bin\HostX64\x64\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\Aidan\.conda\envs\311\Lib\site-packages\torch\lib "/LIBPATH:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\lib\x64" /LIBPATH:C:\Users\Aidan\.conda\envs\311\libs /LIBPATH:C:\Users\Aidan\.conda\envs\311 /LIBPATH:C:\Users\Aidan\.conda\envs\311\PCbuild\amd64 "/LIBPATH:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\lib\x64" "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.22000.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\\lib\10.0.22000.0\\um\x64" "/LIBPATH:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\lib\x64" cusolver.lib c10.lib torch.lib torch_cpu.lib torch_python.lib cudart.lib c10_cuda.lib torch_cuda.lib /EXPORT:PyInit_cusolver_lu_solver E:\redacted\third_party\theseus\build\temp.win-amd64-cpython-311\Release\redacted\third_party\theseus\theseus\extlib\cusolver_lu_solver.obj E:\redacted\third_party\theseus\build\temp.win-amd64-cpython-311\Release\redacted\third_party\theseus\theseus\extlib\cusolver_sp_defs.obj /OUT:build\lib.win-amd64-cpython-311\theseus\extlib\cusolver_lu_solver.cp311-win_amd64.pyd /IMPLIB:E:\redacted\third_party\theseus\build\temp.win-amd64-cpython-311\Release\redacted\third_party\theseus\theseus\extlib\cusolver_lu_solver.cp311-win_amd64.lib
       Creating library E:\redacted\third_party\theseus\build\temp.win-amd64-cpython-311\Release\redacted\third_party\theseus\theseus\extlib\cusolver_lu_solver.cp311-win_amd64.lib and object E:\redacted\third_party\theseus\build\temp.win-amd64-cpython-311\Release\redacted\third_party\theseus\theseus\extlib\cusolver_lu_solver.cp311-win_amd64.exp
    cusolver_lu_solver.obj : error LNK2001: unresolved external symbol cusparseGetErrorString
    cusolver_lu_solver.obj : error LNK2001: unresolved external symbol cusparseSetMatType
    cusolver_lu_solver.obj : error LNK2001: unresolved external symbol cusparseCreateMatDescr
    cusolver_lu_solver.obj : error LNK2001: unresolved external symbol cusparseDestroyMatDescr
    cusolver_lu_solver.obj : error LNK2001: unresolved external symbol cusparseSetMatIndexBase
    build\lib.win-amd64-cpython-311\theseus\extlib\cusolver_lu_solver.cp311-win_amd64.pyd : fatal error LNK1120: 5 unresolved externals
    error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX64\\x64\\link.exe' failed with exit code 1120
    [end of output]

How Has This Been Tested

I only have the capability to test this change on my current windows machine - building works fine on a linux VM I tried.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 17, 2023
@aiddun aiddun changed the title Fix setup.py for windows by explicitly mentioning cusparse Fix installing from source on Windows by explicitly mentioning cusparse in setup.py Jun 17, 2023
@aiddun aiddun changed the title Fix installing from source on Windows by explicitly mentioning cusparse in setup.py Fix installing from source on Windows by explicitly mentioning cusolver in setup.py Jun 17, 2023
@aiddun aiddun changed the title Fix installing from source on Windows by explicitly mentioning cusolver in setup.py Fix installing from source on Windows by explicitly mentioning cusparse in setup.py Jun 17, 2023
@aiddun
Copy link
Contributor Author

aiddun commented Jun 17, 2023

I think the wheel test failed because this is an external branch from a fork, but idk

@luisenp
Copy link
Contributor

luisenp commented Jun 19, 2023

Wheel test passes in my own copy of this branch. Thanks for adding this!

@luisenp luisenp merged commit 016c1f7 into facebookresearch:main Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants