yzqin / s4g-release

S4G: Amodal Single-view Single-Shot SE(3) Grasp Detection in Cluttered Scene
35 stars 6 forks source link

csrc/interpolate_kernel.cu(218): error: identifier "THArgCheck" is undefined #5

Closed kimanton closed 1 year ago

kimanton commented 1 year ago

I am interested in your work, but I can't proceed because when i am trying to build it according to step 4 of installation python setup.py build_ext --inplace, I get the following error:

/src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/csrc/grouping_kernel.cu(136): error: identifier "THArgCheck" is undefined
/src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/csrc/interpolate_kernel.cu(218): error: identifier "THArgCheck" is undefined
/src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/csrc/interpolate_kernel.cu(323): error: identifier "THArgCheck" is undefined

What is this "THArgCheck"? What header I need to include to fix it? Or maybe I need to rename it to something else?

I am using Ubuntu 20, with torch=1.13.1+cu116 and nvcc=11.6
I fixed the other similar problems, and can't find fix for this one only

Here is the complete log after python setup.py build_ext --inplace, if its relevant:

running build_ext building 'pn2_ext' extension creating /src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/build creating /src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/build/temp.linux-x86_64-3.8 creating /src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/build/temp.linux-x86_64-3.8/csrc Emitting ninja build file /src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/build/temp.linux-x86_64-3.8/build.ninja... Compiling objects... Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N) [1/5] /usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.8/dist-packages/torch/include -I/usr/local/lib/python3.8/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.8/dist-packages/torch/include/TH -I/usr/local/lib/python3.8/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.8 -c -c /src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/csrc/grouping_kernel.cu -o /src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/build/temp.linux-x86_64-3.8/csrc/grouping_kernel.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O2 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=pn2_ext -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=compute_75 -gencode=arch=compute_75,code=sm_75 -std=c++14 FAILED: /src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/build/temp.linux-x86_64-3.8/csrc/grouping_kernel.o /usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.8/dist-packages/torch/include -I/usr/local/lib/python3.8/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.8/dist-packages/torch/include/TH -I/usr/local/lib/python3.8/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.8 -c -c /src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/csrc/grouping_kernel.cu -o /src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/build/temp.linux-x86_64-3.8/csrc/grouping_kernel.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O2 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=pn2_ext -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=compute_75 -gencode=arch=compute_75,code=sm_75 -std=c++14 /src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/csrc/grouping_kernel.cu(136): error: identifier "THArgCheck" is undefined
1 error detected in the compilation of "/src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/csrc/grouping_kernel.cu". [2/5] /usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.8/dist-packages/torch/include -I/usr/local/lib/python3.8/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.8/dist-packages/torch/include/TH -I/usr/local/lib/python3.8/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.8 -c -c /src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/csrc/interpolate_kernel.cu -o /src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/build/temp.linux-x86_64-3.8/csrc/interpolate_kernel.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O2 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=pn2_ext -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=compute_75 -gencode=arch=compute_75,code=sm_75 -std=c++14 FAILED: /src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/build/temp.linux-x86_64-3.8/csrc/interpolate_kernel.o /usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.8/dist-packages/torch/include -I/usr/local/lib/python3.8/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.8/dist-packages/torch/include/TH -I/usr/local/lib/python3.8/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.8 -c -c /src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/csrc/interpolate_kernel.cu -o /src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/build/temp.linux-x86_64-3.8/csrc/interpolate_kernel.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O2 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=pn2_ext -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=compute_75 -gencode=arch=compute_75,code=sm_75 -std=c++14 /src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/csrc/interpolate_kernel.cu(218): error: identifier "THArgCheck" is undefined /src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/csrc/interpolate_kernel.cu(323): error: identifier "THArgCheck" is undefined 2 errors detected in the compilation of "/src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/csrc/interpolate_kernel.cu". [3/5] /usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.8/dist-packages/torch/include -I/usr/local/lib/python3.8/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.8/dist-packages/torch/include/TH -I/usr/local/lib/python3.8/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.8 -c -c /src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/csrc/ball_query_kernel.cu -o /src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/build/temp.linux-x86_64-3.8/csrc/ball_query_kernel.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O2 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=pn2_ext -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=compute_75 -gencode=arch=compute_75,code=sm_75 -std=c++14 [4/5] /usr/local/cuda/bin/nvcc -I/usr/local/lib/python3.8/dist-packages/torch/include -I/usr/local/lib/python3.8/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.8/dist-packages/torch/include/TH -I/usr/local/lib/python3.8/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.8 -c -c /src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/csrc/sampling_kernel.cu -o /src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/build/temp.linux-x86_64-3.8/csrc/sampling_kernel.o -DCUDA_NO_HALF_OPERATORS -DCUDA_NO_HALF_CONVERSIONS -DCUDA_NO_BFLOAT16_CONVERSIONS -DCUDA_NO_HALF2_OPERATORS --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O2 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=pn2_ext -D_GLIBCXX_USE_CXX11_ABI=0 -gencode=arch=compute_75,code=compute_75 -gencode=arch=compute_75,code=sm_75 -std=c++14 [5/5] c++ -MMD -MF /src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/build/temp.linux-x86_64-3.8/csrc/main.o.d -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.8/dist-packages/torch/include -I/usr/local/lib/python3.8/dist-packages/torch/include/torch/csrc/api/include -I/usr/local/lib/python3.8/dist-packages/torch/include/TH -I/usr/local/lib/python3.8/dist-packages/torch/include/THC -I/usr/local/cuda/include -I/usr/include/python3.8 -c -c /src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/csrc/main.cpp -o /src/s4g-release/inference/grasp_proposal/network_models/models/pointnet2_utils/build/temp.linux-x86_64-3.8/csrc/main.o -g -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=pn2_ext -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++14 ninja: build stopped: subcommand failed. Traceback (most recent call last): File "/usr/local/lib/python3.8/dist-packages/torch/utils/cpp_extension.py", line 1900, in _run_ninja_build subprocess.run( File "/usr/lib/python3.8/subprocess.py", line 516, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1. The above exception was the direct cause of the following exception: Traceback (most recent call last): File "setup.py", line 7, in setup( File "/usr/lib/python3/dist-packages/setuptools/init.py", line 144, in setup return distutils.core.setup(**attrs) File "/usr/lib/python3.8/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/lib/python3.8/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 87, in run _build_ext.run(self) File "/usr/lib/python3/dist-packages/Cython/Distutils/old_build_ext.py", line 186, in run _build_ext.build_ext.run(self) File "/usr/lib/python3.8/distutils/command/build_ext.py", line 340, in run self.build_extensions() File "/usr/local/lib/python3.8/dist-packages/torch/utils/cpp_extension.py", line 843, in build_extensions build_ext.build_extensions(self) File "/usr/lib/python3/dist-packages/Cython/Distutils/old_build_ext.py", line 195, in build_extensions _build_ext.build_ext.build_extensions(self) File "/usr/lib/python3.8/distutils/command/build_ext.py", line 449, in build_extensions self._build_extensions_serial() File "/usr/lib/python3.8/distutils/command/build_ext.py", line 474, in _build_extensions_serial self.build_extension(ext) File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 208, in build_extension _build_ext.build_extension(self, ext) File "/usr/lib/python3.8/distutils/command/build_ext.py", line 528, in build_extension objects = self.compiler.compile(sources, File "/usr/local/lib/python3.8/dist-packages/torch/utils/cpp_extension.py", line 658, in unix_wrap_ninja_compile _write_ninja_file_and_compile_objects( File "/usr/local/lib/python3.8/dist-packages/torch/utils/cpp_extension.py", line 1573, in _write_ninja_file_and_compile_objects _run_ninja_build( File "/usr/local/lib/python3.8/dist-packages/torch/utils/cpp_extension.py", line 1916, in _run_ninja_build raise RuntimeError(message) from e RuntimeError: Error compiling objects for extension

yzqin commented 1 year ago

Hi @kimanton,

From the error message above, I believe that this should be a issue if cuda version mismatch. The code of project was developed in 2019 where CUDA 11 is not available.

identifier "THArgCheck" is undefined seems that in new CUDA version, the THArgCheck variable is deprecated.

Maybe you can try to use CUDA 10.3 to build the PointNet module. If you find it hard to install CUDA 10 on Ubuntu 20, you can also try to use a nvcc docker to build the module and use the code outside the docker.

kimanton commented 1 year ago

Thank you for an advice! I will try docker with an older nvcc

kimanton commented 1 year ago

Hi again @yzqin So I was able to finish installation, but now I can't run the thing. I run it in a container with Ubuntu 18, CUDA 10.2, Python 3.6 It says this

File "grasp_proposal_test.py", line 8, in from grasp_proposal.cloud_processor.cloud_processor import CloudPreProcessor ModuleNotFoundError: No module named 'grasp_proposal'

I tried to add __init__.py to subfolders of grasp_proposal, didn't work

yzqin commented 1 year ago

Merry Christmas @kimanton ,

From the error message provides, it seems that the grasp_proposal module is not in the search path of the Python interpenetrate.

One simple fix can be add the path of s4g-release/inference into your PYTHONPATH before execute the program. For example, you can do the following:

cd s4g-release/inference
export PYTHONPATH=`pwd`:$PYTHONPATH
cd grasp_proposal
python grasp_proposal_test.py

Or if you are using some IDE like VSCode or Pycharm, you can also added the path s4g-release/inference into the IDE interpreter or append it to sys.path.

kimanton commented 1 year ago

@yzqin Thank you!