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

Installation problems on weindows #894

Closed
Sunshine19980919 opened this issue Oct 22, 2021 · 10 comments
Closed

Installation problems on weindows #894

Sunshine19980919 opened this issue Oct 22, 2021 · 10 comments
Assignees
Labels
installation Installation questions or issues

Comments

@Sunshine19980919
Copy link

running build
running build_py
running build_ext
building 'pytorch3d._C' extension
Emitting ninja build file D:\PythonProject\pythonProject\py_3d\pytorch3d-0.6.0\build\temp.win-amd64-3.8\Release\build.ninja...
Compiling objects...
Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
1.10.2
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Anaconda3\envs\pytorch_gpu\lib\site-packages\torch\lib "/LIBPATH:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\lib/x64" /LIBPATH:C:\Anaconda3\envs\pytorch_gpu\libs /LIBPATH:C:\Anaconda3\envs\pytorch_gpu\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\ATLMFC\lib\x64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.19041.0\um\x64" c10.lib torch.lib torch_cpu.lib torch_python.lib cudart.lib c10_cuda.lib torch_cuda.lib /EXPORT:PyInit__C D:\PythonProject\pythonProject\py_3d\pytorch3d-0.6.0\build\temp.win-amd64-3.8\Release\PythonProject\pythonProject\py_3d\pytorch3d-0.6.0\pytorch3d\csrc\ext.obj D:\PythonProject\pythonProject\py_3d\pytorch3d-0.6.0\build\temp.win-amd64-3.8\Release\PythonProject\pythonProject\py_3d\pytorch3d-0.6.0\pytorch3d\csrc\ball_query\ball_query_cpu.obj D:\PythonProject\pythonProject\py_3d\pytorch3d-0.6.0\build\temp.win-amd64-3.8\Release\PythonProject\pythonProject\py_3d\pytorch3d-0.6.0\pytorch3d\csrc\blending\sigmoid_alpha_blend_cpu.obj D:\PythonProject\pythonProject\py_3d\pytorch3d-0.6.0\build\temp.win-amd64-3.8\Release\PythonProject\pythonProject\py_3d\pytorch3d-0.6.0\pytorch3d\csrc\compositing\alpha_composite_cpu.obj D:\PythonProject\pythonProject\py_3d\pytorch3d-0.6.0\build\temp.win-amd64-3.8\Release\PythonProject\pythonProject\py_3d\pytorch3d-0.6.0\pytorch3d\csrc\compositing\norm_weighted_sum_cpu.obj D:\PythonProject\pythonProject\py_3d\pytorch3d-0.6.0\build\temp.win-amd64-3.8\Release\PythonProject\pythonProject\py_3d\pytorch3d-0.6.0\pytorch3d\csrc\compositing\weighted_sum_cpu.obj D:\PythonProject\pythonProject\py_3d\pytorch3d-0.6.0\build\temp.win-amd64-3.8\Release\PythonProject\pythonProject\py_3d\pytorch3d-0.6.0\pytorch3d\csrc\face_areas_normals\face_areas_normals_cpu.obj D:\PythonProject\pythonProject\py_3d\pytorch3d-0.6.0\build\temp.win-amd64-3.8\Release\PythonProject\pythonProject\py_3d\pytorch3d-0.6.0\pytorch3d\csrc\gather_scatter\gather_scatter_cpu.obj
。。。
。。。
D:\PythonProject\pythonProject\py_3d\pytorch3d-0.6.0\build\temp.win-amd64-3.8\Release\PythonProject\pythonProject\py_3d\pytorch3d-0.6.0\pytorch3d\csrc\sample_pdf\sample_pdf.obj /OUT:build\lib.win-amd64-3.8\pytorch3d_C.cp38-win_amd64.pyd /IMPLIB:D:\PythonProject\pythonProject\py_3d\pytorch3d-0.6.0\build\temp.win-amd64-3.8\Release\PythonProject\pythonProject\py_3d\pytorch3d-0.6.0\pytorch3d\csrc_C.cp38-win_amd64.lib

LINK : fatal error LNK1181: can not open flie : “D:\PythonProject\pythonProject\py_3d\pytorch3d-0.6.0\build\temp.win-amd64-3.8\Release\PythonProject\pythonProject\py_3d\pytorch3d-0.6.0\pytorch3d\csrc\iou_box3d\iou_box3d_cpu.obj”
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\link.exe' failed with exit status 1181

@Sunshine19980919
Copy link
Author

Sunshine19980919 commented Oct 22, 2021

enviroments :

  1. torch 1.8.0
  2. nvcc&vs tool : nvcc: 10.2 & 2019

@bottler
Copy link
Contributor

bottler commented Oct 22, 2021

Are you using the latest version of the main branch of the code? Is there a log file from the build which contains an actual error?

@bottler bottler self-assigned this Oct 22, 2021
@bottler bottler added the installation Installation questions or issues label Oct 22, 2021
@Sunshine19980919
Copy link
Author

Sunshine19980919 commented Oct 24, 2021

Sorry for not replying to you in time, because I reinstalled the window system, and now I have built the new windows system and install following:

image

and : set DISTUTILS_USE_SDK=1 , add CUB_HOME ,

then,the error is :
first.txt

@Sunshine19980919
Copy link
Author

您使用的是最新版本main的代码分支吗?构建中是否有包含实际错误的日志文件?

Are you using the latest version of the main branch of the code? Is there a log file from the build which contains an actual error?

I download the 0.6 version from releases

@bottler
Copy link
Contributor

bottler commented Oct 25, 2021

I have put the relevant error from your file below. You have the same problem as #876, although I find the actual wording of the error messages unfamiliar. This has been fixed on the main branch at 1a7442a . You might find it easier to make the changes in that commit locally in your code.

E:\zsfile\pytorch3d-0.6.0\pytorch3d\csrc\iou_box3d/iou_utils.h(440): error C2065: “not”: Undeclared identifier
E:\zsfile\pytorch3d-0.6.0\pytorch3d\csrc\iou_box3d/iou_utils.h(440): error C2146: Grammatical errors: lack“)”(In the identifier“isin1”的前面)
E:\zsfile\pytorch3d-0.6.0\pytorch3d\csrc\iou_box3d/iou_utils.h(440): error C2059: Grammatical errors:“)”
E:\zsfile\pytorch3d-0.6.0\pytorch3d\csrc\iou_box3d/iou_utils.h(441): error C2059: Grammatical errors:“return”
E:\zsfile\pytorch3d-0.6.0\pytorch3d\csrc\iou_box3d/iou_utils.h(443): error C2059: Grammatical errors:“if”
E:\zsfile\pytorch3d-0.6.0\pytorch3d\csrc\iou_box3d/iou_utils.h(443): error C2143: Grammatical errors: lack“;”(in front of“{”)
E:\zsfile\pytorch3d-0.6.0\pytorch3d\csrc\iou_box3d/iou_utils.h(443): error C2447: “{”:Missing function title (is it an old-fashioned form?)
E:\zsfile\pytorch3d-0.6.0\pytorch3d\csrc\iou_box3d/iou_utils.h(448): error C2059: Grammatical errors:“if”
E:\zsfile\pytorch3d-0.6.0\pytorch3d\csrc\iou_box3d/iou_utils.h(448): error C2143: Grammatical errors: lack“;”(in front of“{”)
E:\zsfile\pytorch3d-0.6.0\pytorch3d\csrc\iou_box3d/iou_utils.h(448): error C2447: “{”:Missing function title (is it an old-fashioned form?)
E:\zsfile\pytorch3d-0.6.0\pytorch3d\csrc\iou_box3d/iou_utils.h(451): error C2059: Grammatical errors:“if”
E:\zsfile\pytorch3d-0.6.0\pytorch3d\csrc\iou_box3d/iou_utils.h(451): error C2143: Grammatical errors: lack“;”(in front of“{”)
E:\zsfile\pytorch3d-0.6.0\pytorch3d\csrc\iou_box3d/iou_utils.h(451): error C2447: “{”:Missing function title (is it an old-fashioned form?)
E:\zsfile\pytorch3d-0.6.0\pytorch3d\csrc\iou_box3d/iou_utils.h(454): error C2059: Grammatical errors:“if”
E:\zsfile\pytorch3d-0.6.0\pytorch3d\csrc\iou_box3d/iou_utils.h(454): error C2143: Grammatical errors: lack“;”(in front of“{”)
E:\zsfile\pytorch3d-0.6.0\pytorch3d\csrc\iou_box3d/iou_utils.h(454): error C2447: “{”:Missing function title (is it an old-fashioned form?)
E:\zsfile\pytorch3d-0.6.0\pytorch3d\csrc\iou_box3d/iou_utils.h(459): error C2059: Grammatical errors:“return”
E:\zsfile\pytorch3d-0.6.0\pytorch3d\csrc\iou_box3d/iou_utils.h(460): error C2059: Grammatical errors:“}”
E:\zsfile\pytorch3d-0.6.0\pytorch3d\csrc\iou_box3d/iou_utils.h(460): error C2143: Grammatical errors: lack“;”(in front of“}”)
E:\zsfile\pytorch3d-0.6.0\pytorch3d\csrc\iou_box3d/iou_utils.h(474): error C2143: Grammatical errors: lack“;”(in front of“{”)
E:\zsfile\pytorch3d-0.6.0\pytorch3d\csrc\iou_box3d/iou_utils.h(474): error C2447: “{”:Missing function title (is it an old-fashioned form?)
E:\zsfile\pytorch3d-0.6.0\pytorch3d\csrc\iou_box3d\iou_box3d_cpu.cpp(83): error C3861: “IsCoplanarFace”: Identifier not found

@Sunshine19980919
Copy link
Author

According to your instructions, modify the not keyword. After I successfully installed it, but it doesn't seem to work on the GPU. Then I checked the relevant problems and installed the complete CUDA 10.2 instead of just

CUDA in pytorch. However, it still does not support GPU, and then I tried to reinstall pytorch3d. Unfortunately, the installation failed, and then I reduced vs2019 to version 16.9, but it still failed

folling:

E:/Anaconda3/envs/pytorch_gpu/lib/site-packages/torch/include\c10/util/ThreadLocalDebugInfo.h(12): warning: modifier is ignored on an enum specifier

E:/Anaconda3/envs/pytorch_gpu/lib/site-packages/torch/include\c10/util/ThreadLocalDebugInfo.h(12): warning: modifier is ignored on an enum specifier

nvcc warning : The -std=c++14 flag is not supported with the configured host compiler. Flag will be ignored.
interp_face_attrs.cu
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File "E:\Anaconda3\envs\pytorch_gpu\lib\site-packages\torch\utils\cpp_extension.py", line 1509, in _run_ninja_build
subprocess.run(
File "E:\Anaconda3\envs\pytorch_gpu\lib\subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "setup.py", line 132, in
setup(
File "E:\Anaconda3\envs\pytorch_gpu\lib\site-packages\setuptools_init_.py", line 153, in setup
return distutils.core.setup(**attrs)
File "E:\Anaconda3\envs\pytorch_gpu\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "E:\Anaconda3\envs\pytorch_gpu\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "E:\Anaconda3\envs\pytorch_gpu\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "E:\Anaconda3\envs\pytorch_gpu\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "E:\Anaconda3\envs\pytorch_gpu\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "E:\Anaconda3\envs\pytorch_gpu\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "E:\Anaconda3\envs\pytorch_gpu\lib\site-packages\setuptools\command\build_ext.py", line 79, in run
_build_ext.run(self)
File "E:\Anaconda3\envs\pytorch_gpu\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run
_build_ext.build_ext.run(self)
File "E:\Anaconda3\envs\pytorch_gpu\lib\distutils\command\build_ext.py", line 340, in run
self.build_extensions()
File "E:\Anaconda3\envs\pytorch_gpu\lib\site-packages\torch\utils\cpp_extension.py", line 649, in build_extensions
build_ext.build_extensions(self)
File "E:\Anaconda3\envs\pytorch_gpu\lib\site-packages\Cython\Distutils\old_build_ext.py", line 195, in build_extensions
_build_ext.build_ext.build_extensions(self)
File "E:\Anaconda3\envs\pytorch_gpu\lib\distutils\command\build_ext.py", line 449, in build_extensions
self._build_extensions_serial()
File "E:\Anaconda3\envs\pytorch_gpu\lib\distutils\command\build_ext.py", line 474, in _build_extensions_serial
self.build_extension(ext)
File "E:\Anaconda3\envs\pytorch_gpu\lib\site-packages\setuptools\command\build_ext.py", line 202, in build_extension
_build_ext.build_extension(self, ext)
File "E:\Anaconda3\envs\pytorch_gpu\lib\distutils\command\build_ext.py", line 528, in build_extension
objects = self.compiler.compile(sources,
File "E:\Anaconda3\envs\pytorch_gpu\lib\site-packages\torch\utils\cpp_extension.py", line 622, in win_wrap_ninja_compile
_write_ninja_file_and_compile_objects(
File "E:\Anaconda3\envs\pytorch_gpu\lib\site-packages\torch\utils\cpp_extension.py", line 1228, in _write_ninja_file_and_compile_objects
_run_ninja_build(
File "E:\Anaconda3\envs\pytorch_gpu\lib\site-packages\torch\utils\cpp_extension.py", line 1529, in _run_ninja_build
raise RuntimeError(message)
RuntimeError: Error compiling objects for extension

@Sunshine19980919
Copy link
Author

GPU error details are as follows:

Traceback (most recent call last):
File "E:/个人编程/python项目/临时实验文件夹/1.py", line 92, in
images = renderer(mesh)
File "E:\Anaconda3\envs\pytorch_gpu\lib\site-packages\torch\nn\modules\module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "E:\Anaconda3\envs\pytorch_gpu\lib\site-packages\pytorch3d-0.6.0-py3.8-win-amd64.egg\pytorch3d\renderer\mesh\renderer.py", line 59, in forward
fragments = self.rasterizer(meshes_world, **kwargs)
File "E:\Anaconda3\envs\pytorch_gpu\lib\site-packages\torch\nn\modules\module.py", line 722, in _call_impl
result = self.forward(*input, **kwargs)
File "E:\Anaconda3\envs\pytorch_gpu\lib\site-packages\pytorch3d-0.6.0-py3.8-win-amd64.egg\pytorch3d\renderer\mesh\rasterizer.py", line 192, in forward
pix_to_face, zbuf, bary_coords, dists = rasterize_meshes(
File "E:\Anaconda3\envs\pytorch_gpu\lib\site-packages\pytorch3d-0.6.0-py3.8-win-amd64.egg\pytorch3d\renderer\mesh\rasterize_meshes.py", line 234, in rasterize_meshes
pix_to_face, zbuf, barycentric_coords, dists = _RasterizeFaceVerts.apply(
File "E:\Anaconda3\envs\pytorch_gpu\lib\site-packages\pytorch3d-0.6.0-py3.8-win-amd64.egg\pytorch3d\renderer\mesh\rasterize_meshes.py", line 308, in forward
pix_to_face, zbuf, barycentric_coords, dists = _C.rasterize_meshes(
RuntimeError: Not compiled with GPU support

@Sunshine19980919
Copy link
Author

Maybe I could make some changes to some of the Torch1.6 headers? But I don't know what to change. I didn't find the concerned website

@bottler
Copy link
Contributor

bottler commented Oct 25, 2021

subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.

You should have a log file with a more detailed error. (Or, if not, maybe your compilation has run out of memory. Try building again with the environment variable MAX_JOBS set to 1.)

@Sunshine19980919
Copy link
Author

Thank you for your guidance. Although my work still didn't work, I finally chose to run on colab

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

No branches or pull requests

2 participants