facebookresearch / pytorch3d

PyTorch3D is FAIR's library of reusable components for deep learning with 3D data
https://pytorch3d.org/
Other
8.81k stars 1.32k forks source link

Installing Pytorch3D on Windows 11 and WSL2 fails #1617

Open danielsjf opened 1 year ago

danielsjf commented 1 year ago

🐛 Bugs / Unexpected behaviors

I'm trying to install pytorch3D on Windows 11 + Python 3.11, within WSL2 and with CUDA 12.2. I'm using the nightly build for Pytorch 2.01 for CUDA 12.1. Pytorch installs fine.

Then I tried to install pytorch3D from git as there were no wheels available:

pip install 'git+https://github.com/facebookresearch/pytorch3d.git@stable'

When installing I get the following error:

In file included from /tmp/pip-req-build-nbn989gk/pytorch3d/csrc/face_areas_normals/face_areas_normals.cu:9:
      /xxx/.venv/lib/python3.11/site-packages/torch/include/ATen/ATen.h:4:2: error: #error C++17 or later compatible compiler is required to use ATen.
          4 | #error C++17 or later compatible compiler is required to use ATen.
            |  ^~~~~
      In file included from /xxx/.venv/lib/python3.11/site-packages/torch/include/c10/util/string_view.h:4,
                       from /xxx/.venv/lib/python3.11/site-packages/torch/include/c10/util/StringUtil.h:6,
                       from /xxx/.venv/lib/python3.11/site-packages/torch/include/c10/util/Exception.h:5,
                       from /xxxr/.venv/lib/python3.11/site-packages/torch/include/ATen/core/Generator.h:11,
                       from /xxx/.venv/lib/python3.11/site-packages/torch/include/ATen/CPUGeneratorImpl.h:3,
                       from /xxx/.venv/lib/python3.11/site-packages/torch/include/ATen/Context.h:3,
                       from /xxx/.venv/lib/python3.11/site-packages/torch/include/ATen/ATen.h:7,
                       from /tmp/pip-req-build-nbn989gk/pytorch3d/csrc/face_areas_normals/face_areas_normals.cu:9:
      /xxx/.venv/lib/python3.11/site-packages/torch/include/c10/util/C++17.h:27:2: error: #error You need C++17 to compile PyTorch
         27 | #error You need C++17 to compile PyTorch
            |  ^~~~~

The gcc version seems fine

$ g++ --version
g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I've already tried a few things:

There are quite a few related errors with the installation of pytorch, however, since that seems to run smooth I am reporting the issue here. Maybe there is something in the settings of pytorch3D which is configured differently. https://discuss.pytorch.org/t/you-need-c-14-to-compile-pytorch/63185