MzeroMiko / VMamba

VMamba: Visual State Space Models,code is based on mamba

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Install error

Renaissance08 opened this issue · comments

Hi! I followed the instructions for installation, and after cd selective_scan && pip install .I'm getting the error like this

(torch) lmz@lmz-lmz:~/Teng/manipulation localization/VMamba-main$ cd kernels/selective_scan && pip install .
Processing /home/lmz/Teng/manipulation localization/VMamba-main/kernels/selective_scan
Preparing metadata (setup.py) ... done
Requirement already satisfied: torch in /home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages (from selective-scan==0.0.2) (1.13.1)
Requirement already satisfied: packaging in /home/lmz/anaconda3/envs/fsdet/lib/python3.8/site-packages (from selective-scan==0.0.2) (23.1)
Collecting ninja (from selective-scan==0.0.2)
Obtaining dependency information for ninja from https://files.pythonhosted.org/packages/6d/92/8d7aebd4430ab5ff65df2bfee6d5745f95c004284db2d8ca76dcbfd9de47/ninja-1.11.1.1-py2.py3-none-manylinux1_x86_64.manylinux_2_5_x86_64.whl.metadata
Using cached ninja-1.11.1.1-py2.py3-none-manylinux1_x86_64.manylinux_2_5_x86_64.whl.metadata (5.3 kB)
Requirement already satisfied: einops in /home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages (from selective-scan==0.0.2) (0.7.0)
Requirement already satisfied: typing_extensions in /home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages (from torch->selective-scan==0.0.2) (4.11.0)
Using cached ninja-1.11.1.1-py2.py3-none-manylinux1_x86_64.manylinux_2_5_x86_64.whl (307 kB)
Building wheels for collected packages: selective-scan
Building wheel for selective-scan (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [100 lines of output]

  torch.__version__  = 1.13.1
  
  
  
  
  CUDA_HOME = /usr/local/cuda-11.1
  
  
  running bdist_wheel
  running build
  running build_ext
  /home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/utils/cpp_extension.py:387: UserWarning: The detected CUDA version (11.1) has a minor version mismatch with the version that was used to compile PyTorch (11.7). Most likely this shouldn't be a problem.
    warnings.warn(CUDA_MISMATCH_WARN.format(cuda_str_version, torch.version.cuda))
  building 'selective_scan_cuda_core' extension
  creating /home/lmz/Teng/manipulation localization/VMamba-main/kernels/selective_scan/build
  creating /home/lmz/Teng/manipulation localization/VMamba-main/kernels/selective_scan/build/temp.linux-x86_64-cpython-38
  creating /home/lmz/Teng/manipulation localization/VMamba-main/kernels/selective_scan/build/temp.linux-x86_64-cpython-38/csrc
  creating /home/lmz/Teng/manipulation localization/VMamba-main/kernels/selective_scan/build/temp.linux-x86_64-cpython-38/csrc/selective_scan
  creating /home/lmz/Teng/manipulation localization/VMamba-main/kernels/selective_scan/build/temp.linux-x86_64-cpython-38/csrc/selective_scan/cus
  Emitting ninja build file /home/lmz/Teng/manipulation localization/VMamba-main/kernels/selective_scan/build/temp.linux-x86_64-cpython-38/build.ninja...
  Compiling objects...
  Allowing ninja to set a default number of workers... (overridable by setting the environment variable MAX_JOBS=N)
  [1/3] /usr/local/cuda-11.1/bin/nvcc  '-I/home/lmz/Teng/manipulation localization/VMamba-main/kernels/selective_scan/csrc/selective_scan' -I/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/include -I/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/include/TH -I/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda-11.1/include -I/home/lmz/anaconda3/envs/torch/include/python3.8 -c -c '/home/lmz/Teng/manipulation localization/VMamba-main/kernels/selective_scan/csrc/selective_scan/cus/selective_scan_core_bwd.cu' -o '/home/lmz/Teng/manipulation localization/VMamba-main/kernels/selective_scan/build/temp.linux-x86_64-cpython-38/csrc/selective_scan/cus/selective_scan_core_bwd.o' -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O3 -std=c++17 -U__CUDA_NO_HALF_OPERATORS__ -U__CUDA_NO_HALF_CONVERSIONS__ -U__CUDA_NO_BFLOAT16_OPERATORS__ -U__CUDA_NO_BFLOAT16_CONVERSIONS__ -U__CUDA_NO_BFLOAT162_OPERATORS__ -U__CUDA_NO_BFLOAT162_CONVERSIONS__ --expt-relaxed-constexpr --expt-extended-lambda --use_fast_math --ptxas-options=-v -lineinfo -gencode arch=compute_70,code=sm_70 -gencode arch=compute_80,code=sm_80 --threads 4 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=selective_scan_cuda_core -D_GLIBCXX_USE_CXX11_ABI=0
  FAILED: /home/lmz/Teng/manipulation localization/VMamba-main/kernels/selective_scan/build/temp.linux-x86_64-cpython-38/csrc/selective_scan/cus/selective_scan_core_bwd.o
  /usr/local/cuda-11.1/bin/nvcc  '-I/home/lmz/Teng/manipulation localization/VMamba-main/kernels/selective_scan/csrc/selective_scan' -I/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/include -I/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/include/TH -I/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda-11.1/include -I/home/lmz/anaconda3/envs/torch/include/python3.8 -c -c '/home/lmz/Teng/manipulation localization/VMamba-main/kernels/selective_scan/csrc/selective_scan/cus/selective_scan_core_bwd.cu' -o '/home/lmz/Teng/manipulation localization/VMamba-main/kernels/selective_scan/build/temp.linux-x86_64-cpython-38/csrc/selective_scan/cus/selective_scan_core_bwd.o' -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O3 -std=c++17 -U__CUDA_NO_HALF_OPERATORS__ -U__CUDA_NO_HALF_CONVERSIONS__ -U__CUDA_NO_BFLOAT16_OPERATORS__ -U__CUDA_NO_BFLOAT16_CONVERSIONS__ -U__CUDA_NO_BFLOAT162_OPERATORS__ -U__CUDA_NO_BFLOAT162_CONVERSIONS__ --expt-relaxed-constexpr --expt-extended-lambda --use_fast_math --ptxas-options=-v -lineinfo -gencode arch=compute_70,code=sm_70 -gencode arch=compute_80,code=sm_80 --threads 4 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=selective_scan_cuda_core -D_GLIBCXX_USE_CXX11_ABI=0
  nvcc fatal   : Unknown option '--threads'
  [2/3] /usr/local/cuda-11.1/bin/nvcc  '-I/home/lmz/Teng/manipulation localization/VMamba-main/kernels/selective_scan/csrc/selective_scan' -I/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/include -I/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/include/TH -I/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda-11.1/include -I/home/lmz/anaconda3/envs/torch/include/python3.8 -c -c '/home/lmz/Teng/manipulation localization/VMamba-main/kernels/selective_scan/csrc/selective_scan/cus/selective_scan_core_fwd.cu' -o '/home/lmz/Teng/manipulation localization/VMamba-main/kernels/selective_scan/build/temp.linux-x86_64-cpython-38/csrc/selective_scan/cus/selective_scan_core_fwd.o' -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O3 -std=c++17 -U__CUDA_NO_HALF_OPERATORS__ -U__CUDA_NO_HALF_CONVERSIONS__ -U__CUDA_NO_BFLOAT16_OPERATORS__ -U__CUDA_NO_BFLOAT16_CONVERSIONS__ -U__CUDA_NO_BFLOAT162_OPERATORS__ -U__CUDA_NO_BFLOAT162_CONVERSIONS__ --expt-relaxed-constexpr --expt-extended-lambda --use_fast_math --ptxas-options=-v -lineinfo -gencode arch=compute_70,code=sm_70 -gencode arch=compute_80,code=sm_80 --threads 4 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=selective_scan_cuda_core -D_GLIBCXX_USE_CXX11_ABI=0
  FAILED: /home/lmz/Teng/manipulation localization/VMamba-main/kernels/selective_scan/build/temp.linux-x86_64-cpython-38/csrc/selective_scan/cus/selective_scan_core_fwd.o
  /usr/local/cuda-11.1/bin/nvcc  '-I/home/lmz/Teng/manipulation localization/VMamba-main/kernels/selective_scan/csrc/selective_scan' -I/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/include -I/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/include/TH -I/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda-11.1/include -I/home/lmz/anaconda3/envs/torch/include/python3.8 -c -c '/home/lmz/Teng/manipulation localization/VMamba-main/kernels/selective_scan/csrc/selective_scan/cus/selective_scan_core_fwd.cu' -o '/home/lmz/Teng/manipulation localization/VMamba-main/kernels/selective_scan/build/temp.linux-x86_64-cpython-38/csrc/selective_scan/cus/selective_scan_core_fwd.o' -D__CUDA_NO_HALF_OPERATORS__ -D__CUDA_NO_HALF_CONVERSIONS__ -D__CUDA_NO_BFLOAT16_CONVERSIONS__ -D__CUDA_NO_HALF2_OPERATORS__ --expt-relaxed-constexpr --compiler-options ''"'"'-fPIC'"'"'' -O3 -std=c++17 -U__CUDA_NO_HALF_OPERATORS__ -U__CUDA_NO_HALF_CONVERSIONS__ -U__CUDA_NO_BFLOAT16_OPERATORS__ -U__CUDA_NO_BFLOAT16_CONVERSIONS__ -U__CUDA_NO_BFLOAT162_OPERATORS__ -U__CUDA_NO_BFLOAT162_CONVERSIONS__ --expt-relaxed-constexpr --expt-extended-lambda --use_fast_math --ptxas-options=-v -lineinfo -gencode arch=compute_70,code=sm_70 -gencode arch=compute_80,code=sm_80 --threads 4 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=selective_scan_cuda_core -D_GLIBCXX_USE_CXX11_ABI=0
  nvcc fatal   : Unknown option '--threads'
  [3/3] c++ -MMD -MF '/home/lmz/Teng/manipulation localization/VMamba-main/kernels/selective_scan/build/temp.linux-x86_64-cpython-38/csrc/selective_scan/cus/selective_scan.o'.d -pthread -B /home/lmz/anaconda3/envs/torch/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC '-I/home/lmz/Teng/manipulation localization/VMamba-main/kernels/selective_scan/csrc/selective_scan' -I/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/include -I/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/include/torch/csrc/api/include -I/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/include/TH -I/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/include/THC -I/usr/local/cuda-11.1/include -I/home/lmz/anaconda3/envs/torch/include/python3.8 -c -c '/home/lmz/Teng/manipulation localization/VMamba-main/kernels/selective_scan/csrc/selective_scan/cus/selective_scan.cpp' -o '/home/lmz/Teng/manipulation localization/VMamba-main/kernels/selective_scan/build/temp.linux-x86_64-cpython-38/csrc/selective_scan/cus/selective_scan.o' -O3 -std=c++17 -DTORCH_API_INCLUDE_EXTENSION_H '-DPYBIND11_COMPILER_TYPE="_gcc"' '-DPYBIND11_STDLIB="_libstdcpp"' '-DPYBIND11_BUILD_ABI="_cxxabi1011"' -DTORCH_EXTENSION_NAME=selective_scan_cuda_core -D_GLIBCXX_USE_CXX11_ABI=0
  cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
  ninja: build stopped: subcommand failed.
  Traceback (most recent call last):
    File "/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1900, in _run_ninja_build
      subprocess.run(
    File "/home/lmz/anaconda3/envs/torch/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 "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/home/lmz/Teng/manipulation localization/VMamba-main/kernels/selective_scan/setup.py", line 140, in <module>
      setup(
    File "/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/setuptools/__init__.py", line 107, in setup
      return distutils.core.setup(**attrs)
    File "/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup
      return run_commands(dist)
    File "/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
      dist.run_commands()
    File "/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/setuptools/dist.py", line 1234, in run_command
      super().run_command(command)
    File "/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/home/lmz/anaconda3/envs/fsdet/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 364, in run
      self.run_command("build")
    File "/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/setuptools/dist.py", line 1234, in run_command
      super().run_command(command)
    File "/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/setuptools/_distutils/command/build.py", line 131, in run
      self.run_command(cmd_name)
    File "/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/setuptools/dist.py", line 1234, in run_command
      super().run_command(command)
    File "/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 84, in run
      _build_ext.run(self)
    File "/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
      self.build_extensions()
    File "/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 843, in build_extensions
      build_ext.build_extensions(self)
    File "/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
      self._build_extensions_serial()
    File "/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
      self.build_extension(ext)
    File "/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/setuptools/command/build_ext.py", line 246, in build_extension
      _build_ext.build_extension(self, ext)
    File "/home/lmz/anaconda3/envs/fsdet/lib/python3.8/site-packages/Cython/Distutils/build_ext.py", line 135, in build_extension
      super(build_ext, self).build_extension(ext)
    File "/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/setuptools/_distutils/command/build_ext.py", line 548, in build_extension
      objects = self.compiler.compile(
    File "/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 658, in unix_wrap_ninja_compile
      _write_ninja_file_and_compile_objects(
    File "/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1573, in _write_ninja_file_and_compile_objects
      _run_ninja_build(
    File "/home/lmz/anaconda3/envs/torch/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1916, in _run_ninja_build
      raise RuntimeError(message) from e
  RuntimeError: Error compiling objects for extension
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for selective-scan
Running setup.py clean for selective-scan
Failed to build selective-scan
ERROR: Could not build wheels for selective-scan, which is required to install pyproject.toml-based projects

It seems that cuda11.1 does not support --threads, try using cuda version >= 11.2 or delete the --threads option.

It seems that cuda11.1 does not support --threads, try using cuda version >= 11.2 or delete the --threads option.

I'm a newbie, how do I remove the --threads parameter

I've updated the file setup.py, does that work now?

I've updated the file setup.py, does that work now?

Got it! Thank you!