kaolin icon indicating copy to clipboard operation
kaolin copied to clipboard

RuntimeError: Error compiling objects for extension during installation of kaolin

Open yuyingyeh opened this issue 4 years ago • 14 comments

Hi, I followed the steps provided in README. I create a virtual environment and installed latest version PyTorch. When I execute python setup.py build_ext --inplace or python setup.py install, I encountered the following errors. I have tried both python 3.6 and python 3.7. The results are the same. My cuda version is 10.2, PyTorch is 1.5, NumPy is 1.18, ninja version is 1.10. The OS is Ubuntu 18.04. Thanks for your help!

[2/2] /usr/local/cuda/bin/nvcc -I/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/site-packages/torch/include -I/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/site-packages/torch/include/TH -I/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/site-packages/numpy/core/include -I/home/yyyeh/anaconda3/envs/kaolin/include/python3.7m -c -c /home/yyyeh/library/kaolin/kaolin/cuda/load_textures_cuda_kernel.cu -o /home/yyyeh/library/kaolin/build/temp.linux-x86_64-3.7/kaolin/cuda/load_textures_cuda_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -Wno-deprecated-declarations -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=load_textures -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=sm_75 -std=c++14 ninja: build stopped: subcommand failed. Traceback (most recent call last): File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1400, in _run_ninja_build check=True) File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/subprocess.py", line 512, in run output=stdout, stderr=stderr) 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 230, in cmdclass={'build_ext': KaolinBuildExtension} File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/site-packages/setuptools/init.py", line 144, in setup return distutils.core.setup(**attrs) File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/distutils/core.py", line 148, in setup dist.run_commands() File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 87, in run _build_ext.run(self) File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/distutils/command/build_ext.py", line 340, in run self.build_extensions() File "setup.py", line 89, in build_extensions super().build_extensions() File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 580, in build_extensions build_ext.build_extensions(self) File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/distutils/command/build_ext.py", line 449, in build_extensions self._build_extensions_serial() File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/distutils/command/build_ext.py", line 474, in _build_extensions_serial self.build_extension(ext) File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 208, in build_extension _build_ext.build_extension(self, ext) File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/distutils/command/build_ext.py", line 534, in build_extension depends=ext.depends) File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 423, in unix_wrap_ninja_compile with_cuda=with_cuda) File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1140, in _write_ninja_file_and_compile_objects error_prefix='Error compiling objects for extension') File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1413, in _run_ninja_build raise RuntimeError(message) RuntimeError: Error compiling objects for extension

yuyingyeh avatar Apr 21 '20 20:04 yuyingyeh

@yuyingyeh Does it work with pytorch version 1.4? We haven't tested builds with version 1.5 yet.

krrish94 avatar Apr 21 '20 20:04 krrish94

Since there is no official Conda installation for PyTorch 1.4, I rather install PyTorch 1.2. And now I can install kaolin successfully. However, when I tried to import kaolin, I met another error.

(kaolin) yyyeh@ubuntu:~/library$ python Python 3.6.10 | packaged by conda-forge | (default, Apr 6 2020, 14:52:36) [GCC 7.3.0] on linux Type "help", "copyright", "credits" or "license" for more information.

import kaolin as kal Traceback (most recent call last): File "", line 1, in File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.6/site-packages/kaolin-0.1.0-py3.6-linux-x86_64.egg/kaolin/init.py", line 17, in File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.6/site-packages/kaolin-0.1.0-py3.6-linux-x86_64.egg/kaolin/conversions/init.py", line 1, in File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.6/site-packages/kaolin-0.1.0-py3.6-linux-x86_64.egg/kaolin/conversions/meshconversions.py", line 20, in File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.6/site-packages/kaolin-0.1.0-py3.6-linux-x86_64.egg/kaolin/metrics/init.py", line 2, in File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.6/site-packages/kaolin-0.1.0-py3.6-linux-x86_64.egg/kaolin/metrics/point.py", line 16, in File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.6/site-packages/kaolin-0.1.0-py3.6-linux-x86_64.egg/kaolin/nnsearch.py", line 7, in File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.6/site-packages/kaolin-0.1.0-py3.6-linux-x86_64.egg/kaolin/nnsearch.py", line 6, in bootstrap File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.6/imp.py", line 343, in load_dynamic return _load(spec) ImportError: libtorch_cpu.so: cannot open shared object file: No such file or directory

Thanks for your help!

yuyingyeh avatar Apr 21 '20 21:04 yuyingyeh

Could you check if pytorch has been compiled using the GPU? torch.cuda.is_available()

krrish94 avatar Apr 21 '20 22:04 krrish94

Yes, it returns True.

I have also tried PyTorch 1.4 with cudatoolkit 10.1, and it returns the same error message.

yuyingyeh avatar Apr 21 '20 23:04 yuyingyeh

We have a Dockerfile in case of the install errors. This looks weird indeed; I'll see if I can repro.

krrish94 avatar Apr 22 '20 09:04 krrish94

I had similar problems. After downgrading Pytorch, it was not able to find the shared library. I then installed from scratch with Pytorch 1.4 in a new environment, and it worked. Hope it helps.

shapovalov avatar Apr 23 '20 15:04 shapovalov

@yuyingyeh This might've been due to a recent PR that broke compatibility. Could you try now? Also, there's a Dockerfile (https://github.com/NVIDIAGameWorks/kaolin/blob/master/Dockerfile) to repro.

krrish94 avatar Apr 24 '20 10:04 krrish94

When will kaolin support pytorch 1.5?

hiyyg avatar May 12 '20 00:05 hiyyg

Is there any estimated timeline for pytorch 1.5 + cuda 10.2 support?

eVen-gits avatar May 28 '20 08:05 eVen-gits

@krrish94 I can build the docker image from the Dockerfile. However, I encountered another issue #268.

yuyingyeh avatar Jun 01 '20 04:06 yuyingyeh

@eVen-gits I can successfully build kaolin with pytorch 1.6 and cuda 10.1.

hiyyg avatar Aug 11 '20 23:08 hiyyg

It would be great to see Kaolin updated to more recent versions of both Python and Pytorch... it's starting to fall behind in both areas.

I'm looking at using Kaolin on NASA projects, so I'd love to see it continue to be updated, please. :smiley:

MBrandt-NASA avatar Aug 25 '20 22:08 MBrandt-NASA

Hi, I followed the steps provided in README. I create a virtual environment and installed latest version PyTorch. When I execute python setup.py build_ext --inplace or python setup.py install, I encountered the following errors. I have tried both python 3.6 and python 3.7. The results are the same. My cuda version is 10.2, PyTorch is 1.5, NumPy is 1.18, ninja version is 1.10. The OS is Ubuntu 18.04. Thanks for your help!

[2/2] /usr/local/cuda/bin/nvcc -I/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/site-packages/torch/include -I/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/site-packages/torch/include/TH -I/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/site-packages/numpy/core/include -I/home/yyyeh/anaconda3/envs/kaolin/include/python3.7m -c -c /home/yyyeh/library/kaolin/kaolin/cuda/load_textures_cuda_kernel.cu -o /home/yyyeh/library/kaolin/build/temp.linux-x86_64-3.7/kaolin/cuda/load_textures_cuda_kernel.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options '-fPIC' -Wno-deprecated-declarations -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=load_textures -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=sm_75 -std=c++14 ninja: build stopped: subcommand failed. Traceback (most recent call last): File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1400, in _run_ninja_build check=True) File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/subprocess.py", line 512, in run output=stdout, stderr=stderr) 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 230, in cmdclass={'build_ext': KaolinBuildExtension} File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/site-packages/setuptools/init.py", line 144, in setup return distutils.core.setup(**attrs) File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/distutils/core.py", line 148, in setup dist.run_commands() File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 87, in run _build_ext.run(self) File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/distutils/command/build_ext.py", line 340, in run self.build_extensions() File "setup.py", line 89, in build_extensions super().build_extensions() File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 580, in build_extensions build_ext.build_extensions(self) File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/distutils/command/build_ext.py", line 449, in build_extensions self._build_extensions_serial() File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/distutils/command/build_ext.py", line 474, in _build_extensions_serial self.build_extension(ext) File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 208, in build_extension _build_ext.build_extension(self, ext) File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/distutils/command/build_ext.py", line 534, in build_extension depends=ext.depends) File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 423, in unix_wrap_ninja_compile with_cuda=with_cuda) File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1140, in _write_ninja_file_and_compile_objects error_prefix='Error compiling objects for extension') File "/home/yyyeh/anaconda3/envs/kaolin/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 1413, in _run_ninja_build raise RuntimeError(message) RuntimeError: Error compiling objects for extension

Hello, I just encountered the same installing errors as this. And cuda version is 11.1, Pytorch is 1.9.0, NumPy is 1.21.5. Could you tell me how to solve this issuev ?? Thanks very much! image

ToFirstday avatar Feb 25 '22 09:02 ToFirstday

@yuyingyeh Does it work with pytorch version 1.4? We haven't tested builds with version 1.5 yet.

Hello, I just encountered the same installing errors as this. And cuda version is 11.1, Pytorch is 1.9.0, NumPy is 1.21.5. Could you tell me how to solve this issuev ?? Thanks very much! image

ToFirstday avatar Feb 25 '22 12:02 ToFirstday

Closing for inactivity, most build issues should be resolved now

Caenorst avatar Dec 12 '22 23:12 Caenorst