Skip to content

Pytorch3d fails to build on Windows11 #1398

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

Closed
kilwa3 opened this issue Dec 18, 2022 · 6 comments
Closed

Pytorch3d fails to build on Windows11 #1398

kilwa3 opened this issue Dec 18, 2022 · 6 comments

Comments

@kilwa3
Copy link

kilwa3 commented Dec 18, 2022

I have the following conda list:
packages in environment at C:\Users\kilwa\miniconda3\envs\3d:

Name Version Build Channel
blas 2.116 mkl conda-forge
blas-devel 3.9.0 16_win64_mkl conda-forge
brotlipy 0.7.0 py38h294d835_1004 conda-forge
ca-certificates 2022.12.7 h5b45459_0 conda-forge
certifi 2022.12.7 pyhd8ed1ab_0 conda-forge
cffi 1.15.1 py38hd8c33c5_0 conda-forge
charset-normalizer 2.1.1 pyhd8ed1ab_0 conda-forge
colorama 0.4.6 pyhd8ed1ab_0 conda-forge
cryptography 37.0.4 py38hb7941b4_0 conda-forge
cudatoolkit 11.6.0 hc0ea762_10 conda-forge
freetype 2.12.1 h546665d_0 conda-forge
fvcore 0.1.5.post20210915 py38 fvcore
idna 3.4 pyhd8ed1ab_0 conda-forge
intel-openmp 2022.2.1 h57928b3_19741 conda-forge
iopath 0.1.9 py38 iopath
jpeg 9e h8ffe710_2 conda-forge
lcms2 2.12 h2a16943_0 conda-forge
lerc 3.0 h0e60522_0 conda-forge
libblas 3.9.0 16_win64_mkl conda-forge
libcblas 3.9.0 16_win64_mkl conda-forge
libdeflate 1.12 h8ffe710_0 conda-forge
libffi 3.4.2 hd77b12b_6
liblapack 3.9.0 16_win64_mkl conda-forge
liblapacke 3.9.0 16_win64_mkl conda-forge
libpng 1.6.37 h1d00b33_4 conda-forge
libtiff 4.4.0 h2ed3b44_1 conda-forge
libuv 1.44.2 h8ffe710_0 conda-forge
libwebp-base 1.2.4 h8ffe710_0 conda-forge
libxcb 1.13 hcd874cb_1004 conda-forge
libzlib 1.2.12 h8ffe710_2 conda-forge
lz4-c 1.9.3 h8ffe710_1 conda-forge
m2w64-gcc-libgfortran 5.3.0 6 conda-forge
m2w64-gcc-libs 5.3.0 7 conda-forge
m2w64-gcc-libs-core 5.3.0 7 conda-forge
m2w64-gmp 6.1.0 2 conda-forge
m2w64-libwinpthread-git 5.0.0.4634.697f757 2 conda-forge
mkl 2022.1.0 h6a75c08_874 conda-forge
mkl-devel 2022.1.0 h57928b3_875 conda-forge
mkl-include 2022.1.0 h6a75c08_874 conda-forge
msys2-conda-epoch 20160418 1 conda-forge
numpy 1.23.2 py38h223ccf5_0 conda-forge
openjpeg 2.5.0 hc9384bd_1 conda-forge
openssl 1.1.1s h2bbff1b_0
pillow 9.2.0 py38h37aa274_2 conda-forge
pip 22.3.1 py38haa95532_0
portalocker 1.4.0 py_0 conda-forge
pthread-stubs 0.4 hcd874cb_1001 conda-forge
pycparser 2.21 pyhd8ed1ab_0 conda-forge
pyopenssl 22.0.0 pyhd8ed1ab_1 conda-forge
pypiwin32 223 pypi_0 pypi
pysocks 1.7.1 pyh0701188_6 conda-forge
python 3.8.15 h6244533_2
python_abi 3.8 2_cp38 conda-forge
pytorch 1.12.0 py3.8_cuda11.6_cudnn8_0 pytorch
pytorch-mutex 1.0 cuda pytorch
pywin32 305 pypi_0 pypi
pyyaml 6.0 py38h294d835_4 conda-forge
requests 2.28.1 pyhd8ed1ab_1 conda-forge
setuptools 65.5.0 py38haa95532_0
sqlite 3.40.0 h2bbff1b_0
tabulate 0.9.0 pyhd8ed1ab_1 conda-forge
tbb 2021.5.0 h2d74725_1 conda-forge
termcolor 2.1.1 pyhd8ed1ab_0 conda-forge
tk 8.6.12 h8ffe710_0 conda-forge
torchvision 0.13.0 py38_cu116 pytorch
tqdm 4.64.1 pyhd8ed1ab_0 conda-forge
typing_extensions 4.4.0 pyha770c72_0 conda-forge
urllib3 1.26.13 pyhd8ed1ab_0 conda-forge
vc 14.2 h21ff451_1
vs2015_runtime 14.27.29016 h5e58377_2
wheel 0.37.1 pyhd3eb1b0_0
win_inet_pton 1.1.0 pyhd8ed1ab_6 conda-forge
wincertstore 0.2 py38haa95532_2
xorg-libxau 1.0.9 hcd874cb_0 conda-forge
xorg-libxdmcp 1.1.3 hcd874cb_0 conda-forge
xz 5.2.6 h8d14728_0 conda-forge
yacs 0.1.8 pyhd8ed1ab_0 conda-forge
yaml 0.2.5 h8ffe710_2 conda-forge
zstd 1.5.2 h6255e5f_4 conda-forge

after following the instructions on https://github.com/facebookresearch/pytorch3d/blob/main/INSTALL.md and running setup.py I am getting the attached output:

Any help is appreciated. Thanks
log.txt

@kilwa3
Copy link
Author

kilwa3 commented Dec 18, 2022

follow up:

After I set MAX_JOBS=1 I realised that the problem was with my visual studio 2022 which cuda 11.6 don't support, After I downgraded to VS 2019 and calling vcvars64.bat , some of the problems are solved. However, now i'm getting a similar problem in the ticket: #1127
Only now for the file: /csrc/marching_cubes/marching_cubes.cu
The solutions suggested in the mentioned ticket would not solve the porblem. I attached the error from the log.
log.txt

@bottler
Copy link
Contributor

bottler commented Dec 19, 2022

I see the problem. This is like #843 and #1024. The relatively new file pytorch3d/csrc/marching_cubes/marching_cubes.cu does not need the include #include "utils/pytorch3d_cutils.h" (currently its line 16) and in fact having that include (which further leads to torch/extension.h) breaks the build on windows. (The symptom is errors mentioning pybind11. We don't care about pybind11 in cuda files. nvcc on windows chokes on pybind11 headers.)

Can you try deleting that line and trying the build again?

@bottler
Copy link
Contributor

bottler commented Dec 19, 2022

Actually more code changes will be required.

@kilwa3
Copy link
Author

kilwa3 commented Dec 19, 2022

Thank you for your quick response...
As I said I tried the solutions in the mentioned tickets (removing #include "utils/pytorch3d_cutils.h" ) and that lead to more compiling errors. I beleive the logs stated "more than 1000 errors occurred while compiling the file..". Unfortunately, I am not on my build PC right now, but please let me know if posting the error logs could help..

@bottler
Copy link
Contributor

bottler commented Dec 19, 2022

I am planning to land a proper fix. Meanwhile I think this might work.
marching_cubes.cu.txt

@kilwa3
Copy link
Author

kilwa3 commented Dec 19, 2022

It worked!
Thank you for your support.

@kilwa3 kilwa3 closed this as completed Dec 19, 2022
facebook-github-bot pushed a commit that referenced this issue Dec 20, 2022
Summary: See #1398 .

Reviewed By: davidsonic

Differential Revision: D42139493

fbshipit-source-id: 972fc33b9c3017554ce704f2f10190eba406b7c8
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

2 participants