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

Could not locate a supported Microsoft Visual C++ installation #100

Open
MbertoldiNormal opened this issue Feb 26, 2024 · 4 comments
Open

Comments

@MbertoldiNormal
Copy link

im trying to install zipnerf on nerfstudio and when i run this command pip install git+https://github.com/SuLvXiangXin/zipnerf-pytorch#subdirectory=extensions/cuda

i get this error : Could not locate a supported Microsoft Visual C++ installation

any clues ?

@HungNgoCT
Copy link

Hi,

I have the same problem. When installed using this command: git+https://github.com/SuLvXiangXin/zipnerf-pytorch#subdirectory=extensions/cuda, it requires std=c++17. I installed visual studio 2022, the compiler is c++14. Can anybody help to solve this?

Thank you in advance

@jyomu
Copy link

jyomu commented Mar 4, 2024

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin\nvcc --generate-dependencies-with-compile --dependency-output R:\Temp\pip-req-build-69ydt_qb\extensions\cuda\build\temp.win-amd64-cpython-310\Release\Temp\pip-req-build-69ydt_qb\extensions\cuda\src\gridencoder.obj.d -std=c++17 --use-local-env -Xcompiler /MD -Xcompiler /wd4819 -Xcompiler /wd4251 -Xcompiler /wd4244 -Xcompiler /wd4267 -Xcompiler /wd4275 -Xcompiler /wd4018 -Xcompiler /wd4190 -Xcompiler /wd4624 -Xcompiler /wd4067 -Xcompiler /wd4068 -Xcompiler /EHsc -Xcudafe --diag_suppress=base_class_has_different_dll_interface -Xcudafe --diag_suppress=field_without_dll_interface -Xcudafe --diag_suppress=dll_interface_conflict_none_assumed -Xcudafe --diag_suppress=dll_interface_conflict_dllexport_assumed -IE:\AI\nerfstudio\.venv\lib\site-packages\torch\include -IE:\AI\nerfstudio\.venv\lib\site-packages\torch\include\torch\csrc\api\include -IE:\AI\nerfstudio\.venv\lib\site-packages\torch\include\TH -IE:\AI\nerfstudio\.venv\lib\site-packages\torch\include\THC "-IC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\include" -IE:\AI\nerfstudio\.venv\include -IC:\Users\jyomu\scoop\persist\rye\py\[email protected]\install\include -IC:\Users\jyomu\scoop\persist\rye\py\[email protected]\install\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" -c R:\Temp\pip-req-build-69ydt_qb\extensions\cuda\src\gridencoder.cu -o R:\Temp\pip-req-build-69ydt_qb\extensions\cuda\build\temp.win-amd64-cpython-310\Release\Temp\pip-req-build-69ydt_qb\extensions\cuda\src\gridencoder.obj -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr -O3 -std=c++14 -U__CUDA_NO_HALF_OPERATORS__ -U__CUDA_NO_HALF_CONVERSIONS__ -U__CUDA_NO_HALF2_OPERATORS__ -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_cuda_backend -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_86,code=compute_86 -gencode=arch=compute_86,code=sm_86
      cl : コマンド ライン warning D9025 : '/D__CUDA_NO_HALF_OPERATORS__' より '/U__CUDA_NO_HALF_OPERATORS__' が優先されます。
      cl : コマンド ライン warning D9025 : '/D__CUDA_NO_HALF_CONVERSIONS__' より '/U__CUDA_NO_HALF_CONVERSIONS__' が優先されます。
      cl : コマンド ライン warning D9025 : '/D__CUDA_NO_HALF2_OPERATORS__' より '/U__CUDA_NO_HALF2_OPERATORS__' が優先されます。

      gridencoder.cu

      E:/AI/nerfstudio/.venv/lib/site-packages/torch/include\c10/util/C++17.h(27): fatal error C1189: #error:  You need C++17 to compile PyTorch

      nvcc warning : incompatible redefinition for option 'std', the last value of this option was used

This is my build log, and it seems that the nvcc option had -std=c++14 after -std=c++17, which was overwritten.
The last one seems to be applied, so I added the following and the build was successful.

$env:NVCC_APPEND_FLAGS="-std=c++17"

@jyomu
Copy link

jyomu commented Mar 4, 2024

nvcc_flags = [
'-O3', '-std=c++14',
'-U__CUDA_NO_HALF_OPERATORS__', '-U__CUDA_NO_HALF_CONVERSIONS__', '-U__CUDA_NO_HALF2_OPERATORS__',
]

Looks like an if statement is needed here.

@koktavy
Copy link

koktavy commented Jul 10, 2024

@jyomu Thank you! I hit a "Failed to build cuda_backend" error when trying to get this running within Nerfstudio. This solved it within my conda env:

set NVCC_APPEND_FLAGS=-std=c++17
pip install git+https://github.com/SuLvXiangXin/zipnerf-pytorch#subdirectory=extensions/cuda

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

4 participants