Thinklab-SJTU / Bench2DriveZoo

BEVFormer, UniAD, VAD in Closed-Loop CARLA Evaluation with World Model RL Expert Think2Drive
Other
161 stars 12 forks source link

按照INSTALL.md安装环境时mmcv编译失败 #23

Closed AvinsWang closed 3 months ago

AvinsWang commented 3 months ago

感谢作者的工作,

按照INSTALL.md安装环境时mmcv编译失败, 在步骤6 pip install -v -e . 出现以下错误, 是哪一步配置出现问题了吗, 帮忙看一下.

INSTALL.md没有指出具体的pytorch版本, 按照issues4里所说是支持最新版本pytorch的, 如果不是方便告知下具体版本吗?

方便提供一下docker file/docker image, 这个环境确实不太好安装

下面的两个错误是在先后执行 pip install -v -e . 出现的(其他设置不变), 为什么两次错误信息不一样

torch                     2.4.0+cu118
torchaudio                2.4.0+cu118
torchmetrics              0.11.4
torchvision               0.19.0+cu118
export PATH=/usr/bin/gcc/bin:$PATH
export CUDA_HOME=/root/miniconda3/envs/b2d_zoo
[23/82] c++ -MMD -MF /data/user/code/bev/Bench2DriveZoo/build/temp.linux-x86_64-cpython-38/mmcv/ops/csrc/pytorch/cpu/nms_rotated.o.d -pthread -B /root/miniconda3/envs/b2d_zoo/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DMMCV_WITH_CUDA -I/data/user/code/bev/Bench2DriveZoo/mmcv/ops/csrc/common -
I/data/user/code/bev/Bench2DriveZoo/mmcv/ops/csrc/common/cuda -I/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include -I/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/TH -I/root/miniconda3/envs/b2d_zoo/lib/python3.8/site
-packages/torch/include/THC -I/root/miniconda3/envs/b2d_zoo/include -I/root/miniconda3/envs/b2d_zoo/include/python3.8 -c -c /data/user/code/bev/Bench2DriveZoo/mmcv/ops/csrc/pytorch/cpu/nms_rotated.cpp -o /data/user/code/bev/Bench2DriveZoo/build/temp.linux-x86_64-cpython-38/mmcv/ops/csrc/pytorch/cpu/nms_rotated.o -std=c++17 -DTORCH_API_INCLUDE_EXTENSION_H '
-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_ext -D_GLIBCXX_USE_CXX11_ABI=0
    cc1plus: warning: command line option _-Wstrict-prototypes_ is valid for C/ObjC but not for C++
    In file included from /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/ATen/ATen.h:11,
                     from /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
                     from /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
                     from /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
                     from /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:4,
                     from /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
                     from /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
                     from /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/all.h:9,
                     from /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/torch/extension.h:5,
                     from /data/user/code/bev/Bench2DriveZoo/mmcv/ops/csrc/common/pytorch_cpp_helper.hpp:3,
                     from /data/user/code/bev/Bench2DriveZoo/mmcv/ops/csrc/pytorch/cpu/nms_rotated.cpp:5:
    /data/user/code/bev/Bench2DriveZoo/mmcv/ops/csrc/pytorch/cpu/nms_rotated.cpp: In lambda function:
    /data/user/code/bev/Bench2DriveZoo/mmcv/ops/csrc/pytorch/cpu/nms_rotated.cpp:62:40: warning: _at::DeprecatedTypeProperties& at::Tensor::type() const_ is deprecated: Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from
 Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device(). [-Wdeprecated-declarations]
       62 |   AT_DISPATCH_FLOATING_TYPES(dets.type(), "nms_rotated", [&] {
          |                                        ^
    /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/ATen/Dispatch.h:215:28: note: in definition of macro _AT_DISPATCH_SWITCH_
      215 |     const auto& the_type = TYPE;                                            \
          |                            ^~~~
    /data/user/code/bev/Bench2DriveZoo/mmcv/ops/csrc/pytorch/cpu/nms_rotated.cpp:62:3: note: in expansion of macro _AT_DISPATCH_FLOATING_TYPES_
       62 |   AT_DISPATCH_FLOATING_TYPES(dets.type(), "nms_rotated", [&] {
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/ATen/core/Tensor.h:3,
                     from /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/ATen/Tensor.h:3,
                     from /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/function_hook.h:3,
                     from /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/cpp_hook.h:2,
                     from /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/variable.h:6,
                     from /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/torch/csrc/autograd/autograd.h:3,
                     from /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/autograd.h:3,
                     from /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/all.h:7,
                     from /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/torch/extension.h:5,
                     from /data/user/code/bev/Bench2DriveZoo/mmcv/ops/csrc/common/pytorch_cpp_helper.hpp:3,
                     from /data/user/code/bev/Bench2DriveZoo/mmcv/ops/csrc/pytorch/cpu/nms_rotated.cpp:5:
    /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/ATen/core/TensorBody.h:225:30: note: declared here
      225 |   DeprecatedTypeProperties & type() const {
          |                              ^~~~
    In file included from /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/ATen/ATen.h:11,
                     from /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/types.h:3,
                     from /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader_options.h:4,
                     from /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/base.h:3,
                     from /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader/stateful.h:4,
                     from /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data/dataloader.h:3,
                     from /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/data.h:3,
                     from /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/torch/csrc/api/include/torch/all.h:9,
                     from /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/torch/extension.h:5,
                     from /data/user/code/bev/Bench2DriveZoo/mmcv/ops/csrc/common/pytorch_cpp_helper.hpp:3,
                     from /data/user/code/bev/Bench2DriveZoo/mmcv/ops/csrc/pytorch/cpu/nms_rotated.cpp:5:
    /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/ATen/Dispatch.h:218:56: warning: _c10::ScalarType detail::scalar_type(const at::DeprecatedTypeProperties&)_ is deprecated: passing at::DeprecatedTypeProperties to an AT_DISPATCH macro is deprecated, pass an at::ScalarType instead [-Wdeprecated-declarations]
      218 |     at::ScalarType _st = ::detail::scalar_type(the_type);
/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/ATen/Dispatch.h:237:3: note: in expansion of macro _AT_DISPATCH_SWITCH_
      237 |   AT_DISPATCH_SWITCH(TYPE, NAME, AT_DISPATCH_CASE_FLOATING_TYPES(__VA_ARGS__))
          |   ^~~~~~~~~~~~~~~~~~
    /data/user/code/bev/Bench2DriveZoo/mmcv/ops/csrc/pytorch/cpu/nms_rotated.cpp:62:3: note: in expansion of macro _AT_DISPATCH_FLOATING_TYPES_
       62 |   AT_DISPATCH_FLOATING_TYPES(dets.type(), "nms_rotated", [&] {
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
    /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/ATen/Dispatch.h:109:23: note: declared here
      109 | inline at::ScalarType scalar_type(const at::DeprecatedTypeProperties& t) {
          |                       ^~~~~~~~~~~
    /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/ATen/Dispatch.h:218:56: warning: _c10::ScalarType detail::scalar_type(const at::DeprecatedTypeProperties&)_ is deprecated: passing at::DeprecatedTypeProperties to an AT_DISPATCH macro is deprecated, pass an at::ScalarType instead [-Wdeprecated-declarations]
      218 |     at::ScalarType _st = ::detail::scalar_type(the_type);                   \
          |                                                        ^
    /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/ATen/Dispatch.h:237:3: note: in expansion of macro _AT_DISPATCH_SWITCH_
      237 |   AT_DISPATCH_SWITCH(TYPE, NAME, AT_DISPATCH_CASE_FLOATING_TYPES(__VA_ARGS__))
          |   ^~~~~~~~~~~~~~~~~~
    /data/user/code/bev/Bench2DriveZoo/mmcv/ops/csrc/pytorch/cpu/nms_rotated.cpp:62:3: note: in expansion of macro _AT_DISPATCH_FLOATING_TYPES_
       62 |   AT_DISPATCH_FLOATING_TYPES(dets.type(), "nms_rotated", [&] {
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
    /root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/ATen/Dispatch.h:109:23: note: declared here
      109 | inline at::ScalarType scalar_type(const at::DeprecatedTypeProperties& t) {
          |                       ^~~~~~~~~~~
    ninja: build stopped: subcommand failed.
    Traceback (most recent call last):
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 2105, in _run_ninja_build
        subprocess.run(
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/subprocess.py", line 516, in run
        raise CalledProcessError(retcode, process.args,
    subprocess.CalledProcessError: Command '['ninja', '-v', '-j', '15']' returned non-zero exit status 1.

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last):
      File "<string>", line 2, in <module>
      File "<pip-setuptools-caller>", line 34, in <module>
      File "/data/user/code/bev/Bench2DriveZoo/setup.py", line 181, in <module>
        setup(
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/__init__.py", line 108, in setup
        return distutils.core.setup(**attrs)
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 184, in setup
        return run_commands(dist)
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
        dist.run_commands()
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 970, in run_commands
        self.run_command(cmd)
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/dist.py", line 945, in run_command
        super().run_command(command)
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 989, in run_command
        cmd_obj.run()
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/command/develop.py", line 36, in run
        self.install_for_development()
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/command/develop.py", line 113, in install_for_development
        self.run_command('build_ext')
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
        self.distribution.run_command(command)
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/dist.py", line 945, in run_command
        super().run_command(command)
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 989, in run_command
        cmd_obj.run()
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 93, in run
        _build_ext.run(self)
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 359, in run
        self.build_extensions()
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 866, in build_extensions
        build_ext.build_extensions(self)
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 479, in build_extensions
        self._build_extensions_serial()
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 505, in _build_extensions_serial
self.build_extension(ext)
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 254, in build_extension
        _build_ext.build_extension(self, ext)
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/Cython/Distutils/build_ext.py", line 135, in build_extension
        super(build_ext, self).build_extension(ext)
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 560, in build_extension
        objects = self.compiler.compile(
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 679, in unix_wrap_ninja_compile
        _write_ninja_file_and_compile_objects(
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1785, in _write_ninja_file_and_compile_objects
        _run_ninja_build(
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 2121, in _run_ninja_build
        raise RuntimeError(message) from e
    RuntimeError: Error compiling objects for extension
    error: subprocess-exited-with-error

    _ python setup.py develop did not run successfully.
    _ exit code: 1
    __> See above for output.

    note: This error originates from a subprocess, and is likely not a problem with pip.
    full command: /root/miniconda3/envs/b2d_zoo/bin/python -c '
    exec(compile('"'"''"'"''"'"'
    # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
    #
    # - It imports setuptools before invoking setup.py, to enable projects that directly
    #   import from `distutils.core` to work with newer packaging standards.
    # - It provides a clear error message when setuptools is not installed.
    # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
    #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
    #     manifest_maker: standard file '"'"'-c'"'"' not found".
    # - It generates a shim setup.py, for handling setup.cfg-only projects.
    import os, sys, tokenize

    try:
        import setuptools
    except ImportError as error:
        print(
            "ERROR: Can not execute `setup.py` since setuptools is not available in "
            "the build environment.",
            file=sys.stderr,
        )
        sys.exit(1)

    __file__ = %r
    sys.argv[0] = __file__

    if os.path.exists(__file__):
        filename = __file__
        with tokenize.open(__file__) as f:
            setup_py_code = f.read()
    else:
        filename = "<auto-generated setuptools caller>"
        setup_py_code = "from setuptools import setup; setup()"

    exec(compile(setup_py_code, filename, "exec"))
    '"'"''"'"''"'"' % ('"'"'/data/user/code/bev/Bench2DriveZoo/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' develop --no-deps
    cwd: /data/user/code/bev/Bench2DriveZoo/
error: subprocess-exited-with-error

_ python setup.py develop did not run successfully.
_ exit code: 1
__> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

再次运行报错

[15/67] c++ -MMD -MF /data/user/code/bev/Bench2DriveZoo/build/temp.linux-x86_64-cpython-38/mmcv/ops/csrc/pytorch/cpu/roi_align_rotated.o.d -pthread -B /root/miniconda3/envs/b2d_zoo/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DMMCV_WITH_CUDA -I/data/user/code/bev/Bench2DriveZoo/mmcv/ops/csrc/co
mmon -I/data/user/code/bev/Bench2DriveZoo/mmcv/ops/csrc/common/cuda -I/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include -I/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/include/TH -I/root/miniconda3/envs/b2d_zoo/lib/python3.
8/site-packages/torch/include/THC -I/root/miniconda3/envs/b2d_zoo/include -I/root/miniconda3/envs/b2d_zoo/include/python3.8 -c -c /data/user/code/bev/Bench2DriveZoo/mmcv/ops/csrc/pytorch/cpu/roi_align_rotated.cpp -o /data/user/code/bev/Bench2DriveZoo/build/temp.linux-x86_64-cpython-38/mmcv/ops/csrc/pytorch/cpu/roi_align_rotated.o -std=c++17 -DTORCH_API_INC
LUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=_ext -D_GLIBCXX_USE_CXX11_ABI=0
cc1plus: warning: command line option -Wstrict-prototypes is valid for C/ObjC but not for C++
/data/user/code/bev/Bench2DriveZoo/mmcv/ops/csrc/pytorch/cpu/roi_align_rotated.cpp: In function void ROIAlignRotatedBackwardCPULauncher(at::Tensor, at::Tensor, at::Tensor, int, int, float, int, bool, bool):
/data/user/code/bev/Bench2DriveZoo/mmcv/ops/csrc/pytorch/cpu/roi_align_rotated.cpp:398:7: warning: unused variable output_size [-Wunused-variable]
398 |   int output_size = grad_output.numel();
|       ^~~~~~~~~~~
/data/user/code/bev/Bench2DriveZoo/mmcv/ops/csrc/pytorch/cpu/roi_align_rotated.cpp: In function void roi_align_rotated_backward_cpu(at::Tensor, at::Tensor, at::Tensor, int, int, float, int, bool, bool):
/data/user/code/bev/Bench2DriveZoo/mmcv/ops/csrc/pytorch/cpu/roi_align_rotated.cpp:435:7: warning: unused variable num_rois [-Wunused-variable]
435 |   int num_rois = rois.size(0);
|       ^~~~~~~~
ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 2105, in _run_ninja_build
subprocess.run(
File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/subprocess.py", line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ninja', '-v', '-j', '15']' returned non-zero exit status 1.
The above exception was the direct cause of the following exception:

    Traceback (most recent call last):
      File "<string>", line 2, in <module>
      File "<pip-setuptools-caller>", line 34, in <module>
      File "/data/user/code/bev/Bench2DriveZoo/setup.py", line 181, in <module>
        setup(
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/__init__.py", line 108, in setup
        return distutils.core.setup(**attrs)
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 184, in setup
        return run_commands(dist)
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
        dist.run_commands()
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 970, in run_commands
        self.run_command(cmd)
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/dist.py", line 945, in run_command
        super().run_command(command)
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 989, in run_command
        cmd_obj.run()
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/command/develop.py", line 36, in run
        self.install_for_development()
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/command/develop.py", line 113, in install_for_development
        self.run_command('build_ext')
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
        self.distribution.run_command(command)
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/dist.py", line 945, in run_command
        super().run_command(command)
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 989, in run_command
        cmd_obj.run()
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 93, in run
        _build_ext.run(self)
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 359, in run
        self.build_extensions()
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 866, in build_extensions
        build_ext.build_extensions(self)
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 479, in build_extensions
        self._build_extensions_serial()
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 505, in _build_extensions_serial
        self.build_extension(ext)
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 254, in build_extension
        _build_ext.build_extension(self, ext)
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/Cython/Distutils/build_ext.py", line 135, in build_extension
        super(build_ext, self).build_extension(ext)
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 560, in build_extension
        objects = self.compiler.compile(
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 679, in unix_wrap_ninja_compile
        _write_ninja_file_and_compile_objects(
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1785, in _write_ninja_file_and_compile_objects
        _run_ninja_build(
      File "/root/miniconda3/envs/b2d_zoo/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 2121, in _run_ninja_build
        raise RuntimeError(message) from e
    RuntimeError: Error compiling objects for extension
    error: subprocess-exited-with-error

    _ python setup.py develop did not run successfully.
    _ exit code: 1
    __> See above for output.

    note: This error originates from a subprocess, and is likely not a problem with pip.
    full command: /root/miniconda3/envs/b2d_zoo/bin/python -c '
    exec(compile('"'"''"'"''"'"'
    # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
    #
    # - It imports setuptools before invoking setup.py, to enable projects that directly
    #   import from `distutils.core` to work with newer packaging standards.
    # - It provides a clear error message when setuptools is not installed.
    # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
    #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
    #     manifest_maker: standard file '"'"'-c'"'"' not found".
    # - It generates a shim setup.py, for handling setup.cfg-only projects.
    import os, sys, tokenize

    try:
        import setuptools
    except ImportError as error:
        print(
            "ERROR: Can not execute `setup.py` since setuptools is not available in "
            "the build environment.",
            file=sys.stderr,
        )
        sys.exit(1)

    __file__ = %r
    sys.argv[0] = __file__

    if os.path.exists(__file__):
        filename = __file__
        with tokenize.open(__file__) as f:
            setup_py_code = f.read()
    else:
        filename = "<auto-generated setuptools caller>"
        setup_py_code = "from setuptools import setup; setup()"

    exec(compile(setup_py_code, filename, "exec"))
    '"'"''"'"''"'"' % ('"'"'/data/user/code/bev/Bench2DriveZoo/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' develop --no-deps
    cwd: /data/user/code/bev/Bench2DriveZoo/
error: subprocess-exited-with-error

_ python setup.py develop did not run successfully.
_ exit code: 1
__> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
jiaxiaosong1002 commented 3 months ago

@AvinsWang CUDA_HOME should the path of cuda-11.8. For example, /usr/local/cuda-11.8. Make sure you have installed cuda-11.8 from nvidia official site.

AvinsWang commented 3 months ago

@jiaxiaosong1002 在官网下载并安装cuda-11.8后编译成功. 之前使用的nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu20.04镜像, 设置export CUDA_HOME=/usr/local/cuda后编译仍失败, 应该是runtime而不是develop版本导致的. 感谢!