pytorch3d icon indicating copy to clipboard operation
pytorch3d copied to clipboard

building 'pytorch3d._C' extension error: Don't know how to compile

Open h-OUS-e opened this issue 1 year ago • 1 comments

I keep getting an error trying to compile pytorch3d from source.

I am basically trying to install pytorch3d in a Conda env, so I am using the Anaconda prompt. I have added MVSC to the path as well as CUBA_HOME and CUDA_HOME, installed cuda toolkits and CudaNN. But I just can't get past that error of failing to compile. Here is a more detailed error output:

(pytorch3d) C:\Users\PECIH\Documents\GitHub\pytorch3d>python setup.py --verbose install running install C:\Users\PECIH\anaconda3\envs\pytorch3d\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( C:\Users\PECIH\anaconda3\envs\pytorch3d\lib\site-packages\setuptools\command\easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. warnings.warn( running bdist_egg running egg_info writing pytorch3d.egg-info\PKG-INFO writing dependency_links to pytorch3d.egg-info\dependency_links.txt writing entry points to pytorch3d.egg-info\entry_points.txt writing requirements to pytorch3d.egg-info\requires.txt writing top-level names to pytorch3d.egg-info\top_level.txt reading manifest file 'pytorch3d.egg-info\SOURCES.txt' adding license file 'LICENSE' adding license file 'LICENSE-3RD-PARTY' installing library code to build\bdist.win-amd64\egg running install_lib running build_py running build_ext building 'pytorch3d._C' extension error: Don't know how to compile C:\Users\PECIH\Documents\GitHub\pytorch3d\pytorch3d\csrc\ball_query\ball_query.cu

Any ideas on how to solve this?

thanks

h-OUS-e avatar Aug 25 '22 00:08 h-OUS-e

This is likely to be a problem with cuda install. What is the output of nvcc --version and echo %CUDA_HOME% ?

Building PyTorch3D with CUDA on Windows is known to be difficult. If you can avoid it for what you need to do (e.g. by running cpu-only or inside WSL (or similar) or on colab) then that would often be easier.

bottler avatar Aug 31 '22 14:08 bottler

echo %CUDA_HOME% returns C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6 nvcc --version returns Cuda compilation tools, release 11.6, V11.6.55 Build cuda_11.6.r11.6/compiler.30794723_0

h-OUS-e avatar Oct 26 '22 23:10 h-OUS-e

What does conda list output? Is pytorch working with cuda?

bottler avatar Oct 27 '22 08:10 bottler

Yes pytorch is working with cuda. I have cuda 11.6 and cub 1.15.0 (compaitable with cuda 11.6) installed. I tried the recommended cuda and cub versions previously, but it would still give me the same error.

conda list gives me: `#

Name Version Build Channel

blas 2.116 mkl conda-forge blas-devel 3.9.0 16_win64_mkl conda-forge brotlipy 0.7.0 py310h8d17308_1005 conda-forge bzip2 1.0.8 h8ffe710_4 conda-forge ca-certificates 2022.9.24 h5b45459_0 conda-forge certifi 2022.9.24 pyhd8ed1ab_0 conda-forge cffi 1.15.1 py310h628cb3f_2 conda-forge charset-normalizer 2.1.1 pyhd8ed1ab_0 conda-forge cryptography 38.0.2 py310h6e82f81_2 conda-forge cudatoolkit 11.6.0 hc0ea762_10 conda-forge freetype 2.12.1 h546665d_0 conda-forge idna 3.4 pyhd8ed1ab_0 conda-forge intel-openmp 2022.1.0 h57928b3_3787 conda-forge jpeg 9e h8ffe710_2 conda-forge lcms2 2.12 h2a16943_0 conda-forge lerc 4.0.0 h63175ca_0 conda-forge libblas 3.9.0 16_win64_mkl conda-forge libcblas 3.9.0 16_win64_mkl conda-forge libdeflate 1.14 hcfcfb64_0 conda-forge libffi 3.4.2 h8ffe710_5 conda-forge liblapack 3.9.0 16_win64_mkl conda-forge liblapacke 3.9.0 16_win64_mkl conda-forge libpng 1.6.38 h19919ed_0 conda-forge libsqlite 3.39.4 hcfcfb64_0 conda-forge libtiff 4.4.0 h8e97e67_4 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.13 hcfcfb64_4 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.4 py310h4a8f9c9_1 conda-forge openjpeg 2.5.0 hc9384bd_1 conda-forge openssl 3.0.5 hcfcfb64_2 conda-forge pillow 9.2.0 py310h52929f7_2 conda-forge pip 22.3 pyhd8ed1ab_0 conda-forge pthread-stubs 0.4 hcd874cb_1001 conda-forge pycparser 2.21 pyhd8ed1ab_0 conda-forge pyopenssl 22.1.0 pyhd8ed1ab_0 conda-forge pysocks 1.7.1 pyh0701188_6 conda-forge python 3.10.6 hcf16a7b_0_cpython conda-forge python_abi 3.10 2_cp310 conda-forge pytorch 1.13.0 py3.10_cpu_0 pytorch pytorch-mutex 1.0 cpu pytorch requests 2.28.1 pyhd8ed1ab_1 conda-forge setuptools 65.5.0 pyhd8ed1ab_0 conda-forge tbb 2021.6.0 h91493d7_1 conda-forge tk 8.6.12 h8ffe710_0 conda-forge torchaudio 0.13.0 py310_cpu pytorch torchvision 0.14.0 py310_cpu pytorch typing_extensions 4.4.0 pyha770c72_0 conda-forge tzdata 2022e h191b570_0 conda-forge ucrt 10.0.22621.0 h57928b3_0 conda-forge urllib3 1.26.11 pyhd8ed1ab_0 conda-forge vc 14.3 h3d8a991_9 conda-forge vs2015_runtime 14.32.31332 h1d6e394_9 conda-forge wheel 0.37.1 pyhd8ed1ab_0 conda-forge win_inet_pton 1.1.0 py310h5588dad_5 conda-forge 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 zstd 1.5.2 h7755175_4 conda-forge`

h-OUS-e avatar Oct 27 '22 12:10 h-OUS-e