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

Trouble about compiling spconv and pointgroup_ops #60

Open
SARIHUST opened this issue Sep 20, 2022 · 3 comments
Open

Trouble about compiling spconv and pointgroup_ops #60

SARIHUST opened this issue Sep 20, 2022 · 3 comments

Comments

@SARIHUST
Copy link

SARIHUST commented Sep 20, 2022

Hi there, I was trying to run your code on our lab's public server and met some issues in the compiling step.
I tried to follow your instructions to install gcc-5.4 for spconv, however I met the following error:

ERROR conda.core.link:_execute(730): An error occurred while installing package 'daleydeng::gcc-5-5.4.0-2'.
Rolling back transaction: done

LinkError: post-link script failed for package daleydeng::gcc-5-5.4.0-2
location of failed script: /home/wanghanhui/.conda/envs/pointgroup_whh/bin/.gcc-5-post-link.sh

I don't know how to fix this problem. However, I decided to move on and see if I could ignore this error and skip this step.
When I tried python setup.py bdist_wheel, I again met errors:

running bdist_wheel
running build
running build_py
running build_ext
/home/wanghanhui/code/PointGroup/lib/spconv/build/lib.linux-x86_64-cpython-37
Release
CMake Error at /home/wanghanhui/.conda/envs/pointgroup_whh/lib/python3.7/site-packages/cmake/data/share/cmake-3.24/Modules/CMakeDetermineCUDACompiler.cmake:277 (message):
  CMAKE_CUDA_ARCHITECTURES must be non-empty if set.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)


-- Configuring incomplete, errors occurred!
See also "/home/wanghanhui/code/PointGroup/lib/spconv/build/temp.linux-x86_64-cpython-37/CMakeFiles/CMakeOutput.log".
See also "/home/wanghanhui/code/PointGroup/lib/spconv/build/temp.linux-x86_64-cpython-37/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
  File "setup.py", line 86, in <module>
    zip_safe=False,
  File "/home/wanghanhui/.conda/envs/pointgroup_whh/lib/python3.7/site-packages/setuptools/__init__.py", line 87, in setup
    return distutils.core.setup(**attrs)
  File "/home/wanghanhui/.conda/envs/pointgroup_whh/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
  File "/home/wanghanhui/.conda/envs/pointgroup_whh/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/home/wanghanhui/.conda/envs/pointgroup_whh/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 973, in run_commands
    self.run_command(cmd)
  File "/home/wanghanhui/.conda/envs/pointgroup_whh/lib/python3.7/site-packages/setuptools/dist.py", line 1217, in run_command
    super().run_command(command)
  File "/home/wanghanhui/.conda/envs/pointgroup_whh/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 992, in run_command
    cmd_obj.run()
  File "/home/wanghanhui/.conda/envs/pointgroup_whh/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 299, in run
    self.run_command('build')
  File "/home/wanghanhui/.conda/envs/pointgroup_whh/lib/python3.7/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
    self.distribution.run_command(command)
  File "/home/wanghanhui/.conda/envs/pointgroup_whh/lib/python3.7/site-packages/setuptools/dist.py", line 1217, in run_command
    super().run_command(command)
  File "/home/wanghanhui/.conda/envs/pointgroup_whh/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 992, in run_command
    cmd_obj.run()
  File "/home/wanghanhui/.conda/envs/pointgroup_whh/lib/python3.7/site-packages/setuptools/command/build.py", line 24, in run
    super().run()
  File "/home/wanghanhui/.conda/envs/pointgroup_whh/lib/python3.7/site-packages/setuptools/_distutils/command/build.py", line 132, in run
    self.run_command(cmd_name)
  File "/home/wanghanhui/.conda/envs/pointgroup_whh/lib/python3.7/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command
    self.distribution.run_command(command)
  File "/home/wanghanhui/.conda/envs/pointgroup_whh/lib/python3.7/site-packages/setuptools/dist.py", line 1217, in run_command
    super().run_command(command)
  File "/home/wanghanhui/.conda/envs/pointgroup_whh/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 992, in run_command
    cmd_obj.run()
  File "setup.py", line 39, in run
    self.build_extension(ext)
  File "setup.py", line 69, in build_extension
    subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
  File "/home/wanghanhui/.conda/envs/pointgroup_whh/lib/python3.7/subprocess.py", line 328, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/home/wanghanhui/code/PointGroup/lib/spconv', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/wanghanhui/code/PointGroup/lib/spconv/build/lib.linux-x86_64-cpython-37/spconv', '-DCMAKE_PREFIX_PATH=/home/wanghanhui/.conda/envs/pointgroup_whh/lib/python3.7/site-packages/torch', '-DPYBIND11_PYTHON_VERSION=3.7', '-DSPCONV_BuildTests=OFF', '-DCMAKE_CUDA_FLAGS="--expt-relaxed-constexpr"', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.

I continued to ignore these errors, hoping that they won't cause more trouble in the future. I went on to compile pointgroup_ops, and met the error:


running develop
/home/wanghanhui/.conda/envs/pointgroup_whh/lib/python3.7/site-packages/setuptools/command/easy_install.py:147: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  EasyInstallDeprecationWarning,
/home/wanghanhui/.conda/envs/pointgroup_whh/lib/python3.7/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  setuptools.SetuptoolsDeprecationWarning,
running egg_info
writing PG_OP.egg-info/PKG-INFO
writing dependency_links to PG_OP.egg-info/dependency_links.txt
writing top-level names to PG_OP.egg-info/top_level.txt
reading manifest file 'PG_OP.egg-info/SOURCES.txt'
writing manifest file 'PG_OP.egg-info/SOURCES.txt'
running build_ext
building 'PG_OP' extension
/usr/local/cuda/bin/nvcc -I/home/wanghanhui/.conda/envs/pointgroup_whh/lib/python3.7/site-packages/torch/include -I/home/wanghanhui/.conda/envs/pointgroup_whh/lib/python3.7/site-packages/torch/include/torch/csrc/api/include -I/home/wanghanhui/.conda/envs/pointgroup_whh/lib/python3.7/site-packages/torch/include/TH -I/home/wanghanhui/.conda/envs/pointgroup_whh/lib/python3.7/site-packages/torch/include/THC -I/usr/local/cuda/include -I/home/wanghanhui/.conda/envs/pointgroup_whh/include/python3.7m -c src/cuda.cu -o build/temp.linux-x86_64-cpython-37/src/cuda.o -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --compiler-options '-fPIC' -O2 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=PG_OP -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++11
In file included from src/cuda.cu:2:
src/datatype/datatype.h:7:10: fatal error: google/dense_hash_map: no such file or directory
    7 | #include <google/dense_hash_map>
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
error: command '/usr/local/cuda/bin/nvcc' failed with exit code 1

I noticed that you mentioned to run python setup.py build_ext --include-dirs=$INCLUDE_PATH$ when seeing these kind of error. However, I am not sure with what I should put in place of $INCLUDE_PATH$, should it be "google/dense_hash_map" or anything else(it seems that putting this doesn't work out)?

@Tianhaowei2001
Copy link

I have met the same problem. Did you find the solution now, buddy?

@VisionOra
Copy link

Getting the same problem. Any solution for this?

@SARIHUST
Copy link
Author

@Tianhaowei2001 @SohaibAnwaar
Here's my final solution.
I used a docker container to gain root access. For spconv compilation, I simply used gcc-7.5 and it was ok.
If you get fatal error: boost/geometry.hpp: No such file or directory, you can try sudo apt install libboost-all-dev to solve the problem.
If you get error: no matching function for call to 'torch::jit::RegisterOperators::....', it seems that this is because spconv used an older pytorch version. You can modify torch::jit::RegistorOperators to torch::RegisterOperators in the file spconv/src/spconv/all.cc.
As for pointgroup_ops, my main problem was fatal error: google/dence_hash_map: No such file or directory, if you also meet this problem, you can solve it by using sudo apt install libsparsehash-dev (at least it solved mine).
I hope this will help you with your problems.

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

3 participants