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

Pytorch Installation Error Contradiction #1659

Closed
raprakashvi opened this issue Oct 17, 2023 · 11 comments
Closed

Pytorch Installation Error Contradiction #1659

raprakashvi opened this issue Oct 17, 2023 · 11 comments

Comments

@raprakashvi
Copy link

raprakashvi commented Oct 17, 2023

🐛 Bugs / Unexpected behaviors

Hi, I am struggling to install pytorch3d on Windows 11 and have followed the issues for past few days.
It's a windows 11 machine with 3070Ti card , Pytorch 2.0.1 , Visual studio 2019 with redistributable and build tools. x64 machine. Cuda 11.8 , Pytorch_Cuda Version = 11.8

Below is the error:
""C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -IC:\Users\rp247\rp-repo\pytorch3d\pytorch3d\csrc -IC:\Users\rp247.conda\envs\pytorch3d\lib\site-packages\torch\include -IC:\Users\rp247.conda\envs\pytorch3d\lib\site-packages\torch\include\torch\csrc\api\include -IC:\Users\rp247.conda\envs\pytorch3d\lib\site-packages\torch\include\TH -IC:\Users\rp247.conda\envs\pytorch3d\lib\site-packages\torch\include\THC -IC:\Users\rp247.conda\envs\pytorch3d\include -IC:\Users\rp247.conda\envs\pytorch3d\Include "-I"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include" -I" "-I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt" -I" /EHsc /TpC:\Users\rp247\rp-repo\pytorch3d\pytorch3d\csrc\ball_query\ball_query_cpu.cpp /Fobuild\temp.win-amd64-cpython-39\Release\Users\rp247\rp-repo\pytorch3d\pytorch3d\csrc\ball_query\ball_query_cpu.obj /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /wd4624 /wd4067 /wd4068 /EHsc -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=0 /std:c++17
ball_query_cpu.cpp
C:\Users\rp247.conda\envs\pytorch3d\lib\site-packages\torch\include\c10/core/DeviceType.h(10): fatal error C1083: Cannot open include file: 'functional': No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe' failed with exit code 2"

I am installing the files in x64 Native Tools in admin mode and have followed the steps in #1227 to remove "c++14" with "[]" .

On entering "cl" in cmd:
Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30152 for x64
Copyright (C) Microsoft Corporation. All rights reserved.

usage: cl [ option... ] filename... [ /link linkoption... ]

"where cl " command gives "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64\cl.exe".

I am suspecting I need to edit the "ball_query"code somehow. Can you please recommend the solution? I have reinstalled and removed most of the softwares.

@raprakashvi
Copy link
Author

@bottler tagging here.

@bottler
Copy link
Contributor

bottler commented Nov 7, 2023

This is something very basic going wrong with the compiler. It doesn't understand #include <functional>. It's always worth trying to add more visual studio components..

Maybe just maybe it thinks some file is C not C++, so maybe you could try adding /TP as a compiler option in setup.py in addition to the others.

@bottler bottler closed this as completed Nov 16, 2023
@2catycm
Copy link

2catycm commented Jan 8, 2024

this issue is still occuring on my computer, it is right that it cannot find functional
image

@2catycm
Copy link

2catycm commented Jan 8, 2024

but adding /TP does not work, I have added it here:
image

@2catycm
Copy link

2catycm commented Jan 8, 2024

This is something very basic going wrong with the compiler. It doesn't understand #include <functional>. It's always worth trying to add more visual studio components..

Maybe just maybe it thinks some file is C not C++, so maybe you could try adding /TP as a compiler option in setup.py in addition to the others.

The guess that "cl.exe treats the .h as c" may not be correct, in the device.h file, I can see there are c++ libs in front of , but they can be included.
image

@2catycm
Copy link

2catycm commented Jan 8, 2024

It is also not because of the version of C++17, I see that C++17 should have here: https://en.cppreference.com/w/cpp/header/functional

@2catycm
Copy link

2catycm commented Jan 8, 2024

@2catycm
Copy link

2catycm commented Jan 8, 2024

can you just build the binary for windows x64? It is so hard to build pytorch3d

@2catycm
Copy link

2catycm commented Jan 8, 2024

why not install the binary by pip

@bottler
Copy link
Contributor

bottler commented Jan 8, 2024

found a relevant issue answered by VS developercommunity.visualstudio.com/t/Visual-Studio-2022-172-C-functional-h/10036384

Are you using a release of Visual Studio newer than microsoft's comment there in Aug 2022? It should just work if you are, right?

@2catycm
Copy link

2catycm commented Jan 10, 2024

found a relevant issue answered by VS developercommunity.visualstudio.com/t/Visual-Studio-2022-172-C-functional-h/10036384

Are you using a release of Visual Studio newer than microsoft's comment there in Aug 2022? It should just work if you are, right?

Hi, I've just upgraded my VS2022, and it works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants