pytorch3d icon indicating copy to clipboard operation
pytorch3d copied to clipboard

installation error on windows

Open jerryliu20d opened this issue 3 years ago • 3 comments

Hi community,

I ran into errors with the installation of pytorch3D on windows.

environment

python 3.9.12 Cuda 11.3 PyTorch 1.12.1, 1.12.0, 1.11.0 (all failed) Microsoft Visual Studio 2019 ---- MSVC 14.28.29910

installation code

conda install pytorch==1.12.0 torchvision==0.13.0 torchaudio==0.12.0 cudatoolkit=11.3 -c pytorch
pip install "git+https://github.com/facebookresearch/pytorch3d.git"

log

I thought the key error is C:\software\Programming\Anaconda\envs\nurbsdiff_debug\lib\site-packages\torch\utils\cpp_extension.py:346: UserWarning: Error checking compiler version for cl: [WinError 2] The system cannot find the file specified

log file one drive link

Thank you in advance!

jerryliu20d avatar Sep 07 '22 04:09 jerryliu20d

Can you run cl in the command prompt? If not, can you check the installation of visual studio and check you are using the correct command prompt for building with visual studio and nvcc?

bottler avatar Sep 07 '22 11:09 bottler

Can you run cl in the command prompt? If not, can you check the installation of visual studio and check you are using the correct command prompt for building with visual studio and nvcc?

cl is not recognized in the command prompt. I added the "MSVC\14.28.29910\bin\Hostx64\x64" to path, and the cl command gives the output now like

Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29915 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

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

It gives the error output when installing the pytorch3d

error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29910\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2

It's confusing that ver.14.28.29910 is used in pytorch3d installation, while the command window shows ver.19.28.29915 after typing 'cl'.

jerryliu20d avatar Sep 14 '22 18:09 jerryliu20d

You shouldn't add it manually to the path. There should be dedicated ways to open a command prompt for visual studio. But in any case, this isn't a specific pytorch3d problem. To build pytorch3d on windows, you need to be able to build C++ and cuda files.

bottler avatar Oct 12 '22 11:10 bottler