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

ERROR PYTORCH3D ON WIN10 #1720

Closed jaehyeonha closed 9 months ago

jaehyeonha commented 9 months ago

I am installing pytorch3d on cuda 11.3 pytorch 1.12.1 with vs2019 x64

having below error: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.3/include/cub-2.1.0/cub\util_debug.cuh(42): fatal error C1083: Cannot open include file: 'nv/target': No such file or directory

If i don't edit config.h located at "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\include\thrust\system\cuda\config.h" , C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.3/include\thrust/system/cuda/config.h(79): fatal error C1189: #error: The version of CUB in your include path is not compatible with this release of Thrust. CUB is now included in the CUDA Toolkit, so you no longer need to use your own checkout of CUB. Define THRUST_IGNORE_CUB_VERSION_CHECK to ignore this. error: command 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\bin\nvcc.exe' failed with exit code 2.

bottler commented 9 months ago

I don't know what's really causing this error, but here's something to fix. With CUDA 11.3 you need to download CUB and set CUB_HOME to its location. (See https://github.com/facebookresearch/pytorch3d/blob/main/INSTALL.md ). You can't rely on the CUB which is included within CUDA. This error looks like the CUB inside CUDA is being used, which is suspicious.

I am confused as to why THRUST_IGNORE_CUB_VERSION_CHECK is not defined: our setup.py should always define it.

You should not need to edit anything inside the cuda install.

jaehyeonha commented 9 months ago

I already set cub_home to cub-2.1.0 which moved into cuda folder. THRUST_IGNORE_CUB_VERSION_CHECK also defined it as true. Nevertheless, I don't know why this error is coming out.

bottler commented 9 months ago

I think you need cub version 1.10.0. I think you have a much newer version which may not be compatible with cuda 11.3.

jaehyeonha commented 9 months ago

having below error: C:\Users\User.conda\envs\pytorch3d\Library\usr\bin\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\User.conda\envs\pytorch3d\lib\site-packages\torch\lib "/LIBPATH:C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\lib/x64" /LIBPATH:C:\Users\User.conda\envs\pytorch3d\libs /LIBPATH:C:\Users\User.conda\envs\pytorch3d /LIBPATH:C:\Users\User.conda\envs\pytorch3d\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\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_cu.lib torch_cuda_cpp.lib /EXPORT:PyInit__C build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\ball_query\ball_query.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\ball_query\ball_query_cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\blending\sigmoid_alpha_blend.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\blending\sigmoid_alpha_blend_cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\compositing\alpha_composite.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\compositing\alpha_composite_cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\compositing\norm_weighted_sum.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\compositing\norm_weighted_sum_cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\compositing\weighted_sum.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\compositing\weighted_sum_cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\ext.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\face_areas_normals\face_areas_normals.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\face_areas_normals\face_areas_normals_cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\gather_scatter\gather_scatter.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\gather_scatter\gather_scatter_cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\interp_face_attrs\interp_face_attrs.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\iou_box3d\iou_box3d.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\iou_box3d\iou_box3d_cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\knn\knn.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\knn\knn_cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\marching_cubes\marching_cubes.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\marching_cubes\marching_cubes_cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\mesh_normal_consistency\mesh_normal_consistency_cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\packed_to_padded_tensor\packed_to_padded_tensor.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\packed_to_padded_tensor\packed_to_padded_tensor_cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\point_mesh\point_mesh_cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\point_mesh\point_mesh_cuda.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\points_to_volumes\points_to_volumes.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\points_to_volumes\points_to_volumes_cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\cuda\renderer.backward.gpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\cuda\renderer.backward_dbg.gpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\cuda\renderer.calc_gradients.gpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\cuda\renderer.calc_signature.gpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\cuda\renderer.construct.gpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\cuda\renderer.create_selector.gpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\cuda\renderer.destruct.gpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\cuda\renderer.fill_bg.gpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\cuda\renderer.forward.gpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\cuda\renderer.norm_cam_gradients.gpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\cuda\renderer.norm_sphere_gradients.gpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\cuda\renderer.render.gpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\host\renderer.backward.cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\host\renderer.backward_dbg.cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\host\renderer.calc_gradients.cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\host\renderer.calc_signature.cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\host\renderer.construct.cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\host\renderer.create_selector.cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\host\renderer.destruct.cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\host\renderer.fill_bg.cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\host\renderer.forward.cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\host\renderer.norm_cam_gradients.cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\host\renderer.norm_sphere_gradients.cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\host\renderer.render.cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\pytorch\camera.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\pytorch\renderer.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\pytorch\tensor_util.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\pytorch\util.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\pulsar\warnings.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\rasterize_coarse\rasterize_coarse.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\rasterize_meshes\rasterize_meshes.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\rasterize_meshes\rasterize_meshes_cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\rasterize_points\rasterize_points.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\rasterize_points\rasterize_points_cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\sample_farthest_points\sample_farthest_points.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\sample_farthest_points\sample_farthest_points_cpu.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\sample_pdf\sample_pdf.obj build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\sample_pdf\sample_pdf_cpu.obj /OUT:build\lib.win-amd64-cpython-39\pytorch3d_C.cp39-win_amd64.pyd /IMPLIB:build\temp.win-amd64-cpython-39\Release\Windows\System32\pytorch3d\pytorch3d\csrc\ball_query_C.cp39-win_amd64.lib /usr/bin/link: extra operand '/LTCG' Try '/usr/bin/link --help' for more information. error: command 'C:\Users\User\.conda\envs\pytorch3d\Library\usr\bin\link.exe' failed with exit code 1

Unfortunately it still failed. Is it a virtual environment problem?

bottler commented 9 months ago

The problem here seems to be /LTCG on the command line. I don't think windows users of pytorch3d normally use link time code generation, which this flag is asking for. It is not something I think you want, but I don't know why the flag is there. Can you see if you can get rid of it?

jaehyeonha commented 9 months ago

Where can I delete it?

jaehyeonha commented 9 months ago

I don't know why, but I installed a new virtual environment and there was no problem. Thank you for your help.

jb2020-super commented 8 months ago

I think you need cub version 1.10.0. I think you have a much newer version which may not be compatible with cuda 11.3.

I set the cub branch to tag cuda-11.3, and it worked. Thank you.