traveller59 / second.pytorch

SECOND for KITTI/NuScenes object detection
MIT License
1.72k stars 721 forks source link

RuntimeError: ('compile failed with retcode', 2) #105

Closed lawrencekiba closed 5 years ago

lawrencekiba commented 5 years ago

Hi,

Attached is the error message. I am running on Ubuntu 16.04 on Pycharm.

nvcc -std=c++11 -c -o ../cc/nms/nms_kernel.cu.o ../cc/nms/nms_kernel.cu.cc -I/usr/local/cuda/include -x cu -Xcompiler -fPIC -arch=sm_53 --expt-relaxed-constexpr In file included from /usr/local/cuda/include/common_functions.h:50:0, from /usr/local/cuda/include/cuda_runtime.h:115, from :0: /usr/local/cuda/include/crt/common_functions.h:64:0: warning: "__CUDACC_VER__" redefined

define CUDACC_VER "CUDACC_VER is no longer supported. Use CUDACC_VER_MAJOR, CUDACC_VER_MINOR, and CUDACC_VER_BUILD instead."

^

:0:0: note: this is the location of the previous definition /usr/lib/gcc/x86_64-linux-gnu/5/include/mwaitxintrin.h(36): error: identifier "__builtin_ia32_monitorx" is undefined /usr/lib/gcc/x86_64-linux-gnu/5/include/mwaitxintrin.h(42): error: identifier "__builtin_ia32_mwaitx" is undefined /usr/include/c++/5/bits/stl_iterator_base_types.h(154): error: name followed by "::" must be a class or namespace name detected during: instantiation of class "std::__iterator_traits<_Iterator, void> [with _Iterator=int]" (163): here instantiation of class "std::iterator_traits<_Iterator> [with _Iterator=int]" /usr/include/boost/token_functions.hpp(359): here /usr/include/c++/5/bits/stl_iterator_base_types.h(155): error: name followed by "::" must be a class or namespace name detected during: instantiation of class "std::__iterator_traits<_Iterator, void> [with _Iterator=int]" (163): here instantiation of class "std::iterator_traits<_Iterator> [with _Iterator=int]" /usr/include/boost/token_functions.hpp(359): here /usr/include/c++/5/bits/stl_iterator_base_types.h(156): error: name followed by "::" must be a class or namespace name detected during: instantiation of class "std::__iterator_traits<_Iterator, void> [with _Iterator=int]" (163): here instantiation of class "std::iterator_traits<_Iterator> [with _Iterator=int]" /usr/include/boost/token_functions.hpp(359): here /usr/include/c++/5/bits/stl_iterator_base_types.h(157): error: name followed by "::" must be a class or namespace name detected during: instantiation of class "std::__iterator_traits<_Iterator, void> [with _Iterator=int]" (163): here instantiation of class "std::iterator_traits<_Iterator> [with _Iterator=int]" /usr/include/boost/token_functions.hpp(359): here /usr/include/c++/5/bits/stl_iterator_base_types.h(158): error: name followed by "::" must be a class or namespace name detected during: instantiation of class "std::__iterator_traits<_Iterator, void> [with _Iterator=int]" (163): here instantiation of class "std::iterator_traits<_Iterator> [with _Iterator=int]" /usr/include/boost/token_functions.hpp(359): here 7 errors detected in the compilation of "/tmp/tmpxft_00001e53_00000000-7_nms_kernel.cu.cpp1.ii". concurrent.futures.process._RemoteTraceback: """ Traceback (most recent call last): File "/media/PycharmProjects/second.pytorch/second/core/non_max_suppression/nms_cpu.py", line 10, in from second.core.non_max_suppression.nms import ( ModuleNotFoundError: No module named 'second.core.non_max_suppression.nms' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/miniconda3/envs/pointpillars/lib/python3.7/concurrent/futures/process.py", line 232, in _process_worker r = call_item.fn(*call_item.args, **call_item.kwargs) File "/home/miniconda3/envs/pointpillars/lib/python3.7/concurrent/futures/process.py", line 191, in _process_chunk return [fn(*args) for args in chunk] File "/home/miniconda3/envs/pointpillars/lib/python3.7/concurrent/futures/process.py", line 191, in return [fn(*args) for args in chunk] File "/media/PycharmProjects/second.pytorch/second/utils/buildtools/command.py", line 255, in compile_func raise RuntimeError("compile failed with retcode", ret.returncode) RuntimeError: ('compile failed with retcode', 2) """ The above exception was the direct cause of the following exception: Traceback (most recent call last): File "create_data.py", line 9, in from second.core import box_np_ops File "/media/PycharmProjects/second.pytorch/second/core/box_np_ops.py", line 7, in from second.core.non_max_suppression.nms_gpu import rotate_iou_gpu_eval File "/media/PycharmProjects/second.pytorch/second/core/non_max_suppression/__init__.py", line 1, in from second.core.non_max_suppression.nms_cpu import nms_jit, soft_nms_jit File "/media/PycharmProjects/second.pytorch/second/core/non_max_suppression/nms_cpu.py", line 18, in cuda=True) File "/media/PycharmProjects/second.pytorch/second/utils/buildtools/pybind11_build.py", line 113, in load_pb11 cmds, cwd, num_workers=num_workers, compiler=compiler) File "/media/PycharmProjects/second.pytorch/second/utils/buildtools/command.py", line 277, in compile_libraries if any([r.returncode != 0 for r in rets]): File "/media/PycharmProjects/second.pytorch/second/utils/buildtools/command.py", line 277, in if any([r.returncode != 0 for r in rets]): File "/home/miniconda3/envs/pointpillars/lib/python3.7/concurrent/futures/process.py", line 476, in _chain_from_iterable_of_lists for element in iterable: File "/home/miniconda3/envs/pointpillars/lib/python3.7/concurrent/futures/_base.py", line 586, in result_iterator yield fs.pop().result() File "/home/miniconda3/envs/pointpillars/lib/python3.7/concurrent/futures/_base.py", line 425, in result return self.__get_result() File "/home/miniconda3/envs/pointpillars/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result raise self._exception RuntimeError: ('compile failed with retcode', 2)

I have tried looking into #6 and #69 but both don't seem to help with my problem.

ghost commented 5 years ago

seems like a problem caused by versions of CUDA.

lawrencekiba commented 5 years ago

Hi, I have changed so that the CUDA points to version 9, now my retcode prints 1 which similar to other issues, yet both solutions don't work on my case. I'm running on Boost 1.58.

nvcc -std=c++11 -c -o ../cc/nms/nms_kernel.cu.o ../cc/nms/nms_kernel.cu.cc -I/usr/local/cuda-9.0/include -x cu -Xcompiler -fPIC -arch=sm_61 --expt-relaxed-constexpr /usr/local/include/boost/core/noncopyable.hpp(42): error: defaulted default constructor cannot be constexpr because the corresponding implicitly declared default constructor would not be constexpr 1 error detected in the compilation of "/tmp/tmpxft_0000106f_00000000-6_nms_kernel.cu.cpp1.ii". concurrent.futures.process._RemoteTraceback: """ Traceback (most recent call last): File "/media/PycharmProjects/second.pytorch/second/core/non_max_suppression/nms_cpu.py", line 10, in from second.core.non_max_suppression.nms import ( ModuleNotFoundError: No module named 'second.core.non_max_suppression.nms' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/miniconda3/envs/pointpillars/lib/python3.7/concurrent/futures/process.py", line 232, in _process_worker r = call_item.fn(*call_item.args, *call_item.kwargs) File "/home/miniconda3/envs/pointpillars/lib/python3.7/concurrent/futures/process.py", line 191, in _process_chunk return [fn(args) for args in chunk] File "/home/miniconda3/envs/pointpillars/lib/python3.7/concurrent/futures/process.py", line 191, in return [fn(*args) for args in chunk] File "/media/PycharmProjects/second.pytorch/second/utils/buildtools/command.py", line 255, in compile_func raise RuntimeError("compile failed with retcode", ret.returncode) RuntimeError: ('compile failed with retcode', 1) """ The above exception was the direct cause of the following exception: Traceback (most recent call last): File "create_data.py", line 9, in from second.core import box_np_ops File "/media/PycharmProjects/second.pytorch/second/core/box_np_ops.py", line 7, in from second.core.non_max_suppression.nms_gpu import rotate_iou_gpu_eval File "/media/PycharmProjects/second.pytorch/second/core/non_max_suppression/init.py", line 1, in from second.core.non_max_suppression.nms_cpu import nms_jit, soft_nms_jit File "/media/PycharmProjects/second.pytorch/second/core/non_max_suppression/nms_cpu.py", line 18, in cuda=True) File "/media/PycharmProjects/second.pytorch/second/utils/buildtools/pybind11_build.py", line 113, in load_pb11 cmds, cwd, num_workers=num_workers, compiler=compiler) File "/media/PycharmProjects/second.pytorch/second/utils/buildtools/command.py", line 277, in compile_libraries if any([r.returncode != 0 for r in rets]): File "/media/PycharmProjects/second.pytorch/second/utils/buildtools/command.py", line 277, in if any([r.returncode != 0 for r in rets]): File "/home/miniconda3/envs/pointpillars/lib/python3.7/concurrent/futures/process.py", line 476, in _chain_from_iterable_of_lists for element in iterable: File "/home/miniconda3/envs/pointpillars/lib/python3.7/concurrent/futures/_base.py", line 586, in result_iterator yield fs.pop().result() File "/home/miniconda3/envs/pointpillars/lib/python3.7/concurrent/futures/_base.py", line 425, in result return self.get_result() File "/home/miniconda3/envs/pointpillars/lib/python3.7/concurrent/futures/_base.py", line 384, in get_result raise self._exception RuntimeError: ('compile failed with retcode', 1)

lawrencekiba commented 5 years ago

Hi,

I have changed so that the CUDA points to version 9, now my retcode prints 1 which similar to other issues, yet both solutions don't work on my case. I'm running on Boost 1.58.

nvcc -std=c++11 -c -o ../cc/nms/nms_kernel.cu.o ../cc/nms/nms_kernel.cu.cc -I/usr/local/cuda-9.0/include -x cu -Xcompiler -fPIC -arch=sm_61 --expt-relaxed-constexpr /usr/local/include/boost/core/noncopyable.hpp(42): error: defaulted default constructor cannot be constexpr because the corresponding implicitly declared default constructor would not be constexpr 1 error detected in the compilation of "/tmp/tmpxft_0000106f_00000000-6_nms_kernel.cu.cpp1.ii". concurrent.futures.process._RemoteTraceback: """ Traceback (most recent call last): File "/media/PycharmProjects/second.pytorch/second/core/non_max_suppression/nms_cpu.py", line 10, in from second.core.non_max_suppression.nms import ( ModuleNotFoundError: No module named 'second.core.non_max_suppression.nms' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/miniconda3/envs/pointpillars/lib/python3.7/concurrent/futures/process.py", line 232, in _process_worker r = call_item.fn(*call_item.args, call_item.kwargs) File "/home/miniconda3/envs/pointpillars/lib/python3.7/concurrent/futures/process.py", line 191, in _process_chunk return [fn(args) for args in chunk] File "/home/miniconda3/envs/pointpillars/lib/python3.7/concurrent/futures/process.py", line 191, in return [fn(args) for args in chunk] File "/media/PycharmProjects/second.pytorch/second/utils/buildtools/command.py", line 255, in compile_func raise RuntimeError("compile failed with retcode", ret.returncode) RuntimeError: ('compile failed with retcode', 1) """ The above exception was the direct cause of the following exception: Traceback (most recent call last): File "create_data.py", line 9, in from second.core import box_np_ops File "/media/PycharmProjects/second.pytorch/second/core/box_np_ops.py", line 7, in from second.core.non_max_suppression.nms_gpu import rotate_iou_gpu_eval File "/media/PycharmProjects/second.pytorch/second/core/non_max_suppression/init**.py", line 1, in from second.core.non_max_suppression.nms_cpu import nms_jit, soft_nms_jit File "/media/PycharmProjects/second.pytorch/second/core/non_max_suppression/nms_cpu.py", line 18, in cuda=True) File "/media/PycharmProjects/second.pytorch/second/utils/buildtools/pybind11_build.py", line 113, in load_pb11 cmds, cwd, num_workers=num_workers, compiler=compiler) File "/media/PycharmProjects/second.pytorch/second/utils/buildtools/command.py", line 277, in compile_libraries if any([r.returncode != 0 for r in rets]): File "/media/PycharmProjects/second.pytorch/second/utils/buildtools/command.py", line 277, in if any([r.returncode != 0 for r in rets]): File "/home/miniconda3/envs/pointpillars/lib/python3.7/concurrent/futures/process.py", line 476, in _chain_from_iterable_of_lists for element in iterable: File "/home/miniconda3/envs/pointpillars/lib/python3.7/concurrent/futures/_base.py", line 586, in result_iterator yield fs.pop().result() File "/home/miniconda3/envs/pointpillars/lib/python3.7/concurrent/futures/_base.py", line 425, in result return self.get_result() File "/home/miniconda3/envs/pointpillars/lib/python3.7/concurrent/futures/_base.py", line 384, in get_result raise self._exception RuntimeError: ('compile failed with retcode', 1)

I have solved the issue above by modifying the C++ code so that the constructor does not default to Constexpr.

zhanhuijing commented 5 years ago

@lawrencekiba How do you resolve the "RuntimeError: ('compile failed with retcode', 2)" issue?