TerryPei/EfficientVMamba

Hi, thank you very much for your work, but i meet a installed problem

CYYJL opened this issue · 4 comments

Hello, thank you very much for your work, I am very interested in your work, but I have a problem in this step --"cd selective_scan && pip install . && pytest" , I would like to ask you how to solve it.
The following is a detailed error report.
`
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
╰─> [64 lines of output]

  torch.__version__  = 2.0.1+cu118
  
  
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-cpython-310
  creating build/lib.linux-x86_64-cpython-310/selective_scan
  copying selective_scan/selective_scan_interface.py -> build/lib.linux-x86_64-cpython-310/selective_scan
  copying selective_scan/__init__.py -> build/lib.linux-x86_64-cpython-310/selective_scan
  running build_ext
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "/mnt/d/AIPRO/EfficientVMamba-main/selective_scan/setup.py", line 108, in <module>
      setup(
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/__init__.py", line 103, in setup
      return distutils.core.setup(**attrs)
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
      return run_commands(dist)
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
      dist.run_commands()
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/dist.py", line 989, in run_command
      super().run_command(command)
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 364, in run
      self.run_command("build")
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/dist.py", line 989, in run_command
      super().run_command(command)
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/_distutils/command/build.py", line 131, in run
      self.run_command(cmd_name)
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/dist.py", line 989, in run_command
      super().run_command(command)
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/command/build_ext.py", line 88, in run
      _build_ext.run(self)
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
      self.build_extensions()
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 485, in build_extensions
      compiler_name, compiler_version = self._check_abi()
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 869, in _check_abi
      _, version = get_compiler_abi_compatibility_and_version(compiler)
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 337, in get_compiler_abi_compatibility_and_version
      if not check_compiler_ok_for_platform(compiler):
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 291, in check_compiler_ok_for_platform
      which = subprocess.check_output(['which', compiler], stderr=subprocess.STDOUT)
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/subprocess.py", line 421, in check_output
      return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
    File "/home/yjl/anaconda3/envs/Cell_SAM/lib/python3.10/subprocess.py", line 526, in run
      raise CalledProcessError(retcode, process.args,
  subprocess.CalledProcessError: Command '['which', 'g++']' returned non-zero exit status 1.
  [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
`

@CYYJL Hi, It's difficult to determine based on the error message alone, but it may be worth checking if g++ is installed based on the errors u provide. It could also be an issue with the setup version, as the setup.py of this code follows commit 5536959 of VMamba (older version).

Do you solve this problem? I have the same problem about this step.

I get a solution which could give some help.
It seems that my problem is caused by not installing CUDA correctly.
try echo $CUDA_HOME to find if there is a output.
if not, you need to find the CUDA path which is commonly installed in the directory /usr/local/cuda
after you find the cuda directory, for example \usr\local\cuda-11.8, you can configure the cuda environment factor with this codes:
export CUDA_HOME=/usr/local/cuda-11.8 export PATH=$PATH:$CUDA_HOME/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CUDA_HOME/lib64
After that you need to execute source ~/.bashrc for the configuration to take effect.

It works out for me.

Hi, this is indeed a CUDA path issue. The solution is just as you said.
You finish a great work. :)

Here is the complete process

export CUDA_HOME=/usr/local/cuda-11.8
export PATH=$PATH:$CUDA_HOME/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CUDA_HOME/lib64
cd
source .bashrc