Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some problem when downloading selective_scan #102

Open
boyiZheng99 opened this issue Mar 23, 2024 · 8 comments
Open

some problem when downloading selective_scan #102

boyiZheng99 opened this issue Mar 23, 2024 · 8 comments

Comments

@boyiZheng99
Copy link

Processing /users/zhengboy/try/VMamba-main/VMamba-main/kernels/selective_scan
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [26 lines of output]
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "/users/zhengboy/try/VMamba-main/VMamba-main/kernels/selective_scan/setup.py", line 139, in
ext_modules = get_ext()
File "/users/zhengboy/try/VMamba-main/VMamba-main/kernels/selective_scan/setup.py", line 108, in get_ext
ext_modules = [
File "/users/zhengboy/try/VMamba-main/VMamba-main/kernels/selective_scan/setup.py", line 109, in
CUDAExtension(
File "/MAHTI_TYKKY_eJlkD0x/miniconda/envs/env1/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1074, in CUDAExtension
library_dirs += library_paths(cuda=True)
File "/MAHTI_TYKKY_eJlkD0x/miniconda/envs/env1/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 1201, in library_paths
if (not os.path.exists(_join_cuda_home(lib_dir)) and
File "/MAHTI_TYKKY_eJlkD0x/miniconda/envs/env1/lib/python3.10/site-packages/torch/utils/cpp_extension.py", line 2407, in _join_cuda_home
raise OSError('CUDA_HOME environment variable is not set. '
OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.

  torch.__version__  = 2.2.1+cu121
  
  
  
  
  CUDA_HOME = None
  
  
  [end of output]

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

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
[ ERROR ] Installation failed
[ ERROR ] Set CW_DEBUG_KEEP_FILES env variable to keep build files
Terminated

@MzeroMiko
Copy link
Owner

It seems like you are in windows. you can refer to #95 for help.

@boyiZheng99
Copy link
Author

no,I used linux😭

@MzeroMiko
Copy link
Owner

no,I used linux😭

Then you have a really new structure with /users/zhengboy 😂 .
Can you show me the output of nvcc -V?

@boyiZheng99
Copy link
Author

no,I used linux😭

Then you have a really new structure with /users/zhengboy 😂 . Can you show me the output of nvcc -V?
This is nvcc-V:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_Sep_21_10:33:58_PDT_2022
Cuda compilation tools, release 11.8, V11.8.89
Build cuda_11.8.r11.8/compiler.31833905_0

and I met the new issue when I built selective_scan
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
╰─> [31 lines of output]
No CUDA runtime is found, using CUDA_HOME='/MAHTI_TYKKY_cl7NsA0/miniconda/envs/env1'

  torch.__version__  = 2.1.1+cu118
  
  
  
  
  CUDA_HOME = /MAHTI_TYKKY_cl7NsA0/miniconda/envs/env1
  
  
  running bdist_wheel
  /users/zhengboy/.local/lib/python3.10/site-packages/torch/utils/cpp_extension.py:502: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend.
    warnings.warn(msg.format('we could not find ninja.'))
  running build
  running build_ext
  /users/zhengboy/.local/lib/python3.10/site-packages/torch/utils/cpp_extension.py:424: UserWarning: There are no g++ version bounds defined for CUDA version 11.8
    warnings.warn(f'There are no {compiler_name} version bounds defined for CUDA version {cuda_str_version}')
  building 'selective_scan_cuda_core' extension
  creating build
  creating build/temp.linux-x86_64-cpython-310
  creating build/temp.linux-x86_64-cpython-310/csrc
  creating build/temp.linux-x86_64-cpython-310/csrc/selective_scan
  creating build/temp.linux-x86_64-cpython-310/csrc/selective_scan/cus
  gcc -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /MAHTI_TYKKY_cl7NsA0/miniconda/envs/env1/include -fPIC -O2 -isystem /MAHTI_TYKKY_cl7NsA0/miniconda/envs/env1/include -fPIC -I/users/zhengboy/try/VMamba-main/VMamba-main/kernels/selective_scan/csrc/selective_scan -I/users/zhengboy/.local/lib/python3.10/site-packages/torch/include -I/users/zhengboy/.local/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/users/zhengboy/.local/lib/python3.10/site-packages/torch/include/TH -I/users/zhengboy/.local/lib/python3.10/site-packages/torch/include/THC -I/MAHTI_TYKKY_cl7NsA0/miniconda/envs/env1/include -I/MAHTI_TYKKY_cl7NsA0/miniconda/envs/env1/include/python3.10 -c csrc/selective_scan/cus/selective_scan.cpp -o build/temp.linux-x86_64-cpython-310/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
  In file included from csrc/selective_scan/cus/selective_scan.cpp:5:
  /users/zhengboy/.local/lib/python3.10/site-packages/torch/include/ATen/cuda/CUDAContext.h:5:10: fatal error: cuda_runtime_api.h: No such file or directory
      5 | #include <cuda_runtime_api.h>
        |          ^~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  error: command '/appl/spack/v017/install-tree/gcc-8.5.0/gcc-11.2.0-zshp2k/bin/gcc' failed with exit code 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

@MzeroMiko
Copy link
Owner

I think the mismatch of cuda version is one of the reasons that leads to the problem.

In the first comment, we can see that the conda env recognize your env ad torch2.2+cu12.1. But nvcc shows the cuda is 11.8. And this confused the ninja.

Try to align the cuda outside and inside conda env, or avoid install cuda inside conda env and use the cuda located in /use/local instead.

@EvilGhostY
Copy link

You could try lowering the gcc version to 10.
sudo apt-get install gcc-10

sudo apt-get install g++-10

sudo ln -s /usr/bin/gcc-10 /usr/local/cuda/bin/gcc

@Elaineok
Copy link

Elaineok commented Jun 4, 2024

gcc (GCC) 10.1.0
cuda11.6
pytorch1.13.0
python3.8
The configuration is fine.
image

@XXN-1N
Copy link

XXN-1N commented Jun 6, 2024

gcc (GCC) 10.1.0 cuda11.6 pytorch1.13.0 python3.8 The configuration is fine. image

Should i degrade gcc and g++ together? i am not sure about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants