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

selective scan install failed #64

Closed
simzhangbest opened this issue Feb 29, 2024 · 9 comments
Closed

selective scan install failed #64

simzhangbest opened this issue Feb 29, 2024 · 9 comments

Comments

@simzhangbest
Copy link

Error1 : subprocess.CalledProcessError: Command '['ninja', '-v']' returned non-zero exit status 1.
Solution1: modify def _run_ninja_build(build_directory: str, verbose: bool, error_prefix: str) -> None: command = ['ninja', '-v'] to def _run_ninja_build(build_directory: str, verbose: bool, error_prefix: str) -> None: command = ['ninja', '--version']
ninja -v not supported.

Error2: ` g++ -pthread -B /root/miniconda3/envs/mamba/compiler_compat -shared -Wl,--allow-shlib-undefined -Wl,-rpath,/root/miniconda3/envs/mamba/lib -Wl,-rpath-link,/root/miniconda3/envs/mamba/lib -L/root/miniconda3/envs/mamba/lib -Wl,--allow-shlib-undefined -Wl,-rpath,/root/miniconda3/envs/mamba/lib -Wl,-rpath-link,/root/miniconda3/envs/mamba/lib -L/root/miniconda3/envs/mamba/lib /root/workspace/code/mamba_all/VMamba/kernels/selective_scan/build/temp.linux-x86_64-3.8/csrc/selective_scan/cus/selective_scan.o /root/workspace/code/mamba_all/VMamba/kernels/selective_scan/build/temp.linux-x86_64-3.8/csrc/selective_scan/cus/selective_scan_core_bwd.o /root/workspace/code/mamba_all/VMamba/kernels/selective_scan/build/temp.linux-x86_64-3.8/csrc/selective_scan/cus/selective_scan_core_fwd.o -L/root/miniconda3/envs/mamba/lib/python3.8/site-packages/torch/lib -L/usr/local/cuda/lib64 -lc10 -ltorch -ltorch_cpu -ltorch_python -lcudart -lc10_cuda -ltorch_cuda -o build/lib.linux-x86_64-3.8/selective_scan_cuda_core.cpython-38-x86_64-linux-gnu.so
g++: error: /root/workspace/code/mamba_all/VMamba/kernels/selective_scan/build/temp.linux-x86_64-3.8/csrc/selective_scan/cus/selective_scan.o: No such file or directory
g++: error: /root/workspace/code/mamba_all/VMamba/kernels/selective_scan/build/temp.linux-x86_64-3.8/csrc/selective_scan/cus/selective_scan_core_bwd.o: No such file or directory
g++: error: /root/workspace/code/mamba_all/VMamba/kernels/selective_scan/build/temp.linux-x86_64-3.8/csrc/selective_scan/cus/selective_scan_core_fwd.o: No such file or directory
error: command '/usr/bin/g++' 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`

Solution: ????

may anyone help?

@simzhangbest
Copy link
Author

torch.version = 2.0.0+cu118

@zhaoyangwei123
Copy link

建议在安装pytorch的时候采用conda install,这样会带着下载cudatoolkit,且该cudatoolkit与你安装的torch的cuda版本一致,如果使用pip install安装pytorch的话,请手动将cudatoolkit调整为与torch相对应的版本,否则就会报错。
比如,你现在应该利用nvcc -V查看cudatoolkit,看它是否是11.8(torch.version = 2.0.0+cu118),若不是则需要更正
It is recommended to use conda install when installing pytorch. This will download the cudatoolkit, and the cudatoolkit is consistent with the cuda version of the torch you installed. If you use pip install to install pytorch, please manually adjust the cudatoolkit to the version corresponding to the torch. , otherwise an error will be reported.
For example, you should now use nvcc -V to check cudatoolkit to see if it is 11.8 (torch.version = 2.0.0+cu118). If not, it needs to be corrected.

@simzhangbest
Copy link
Author

建议在安装pytorch的时候采用conda install,这样会带着下载cudatoolkit,且该cudatoolkit与你安装的torch的cuda版本一致,如果使用pip install安装pytorch的话,请手动将cudatoolkit调整为与torch相对应的版本,否则就会报错。 比如,你现在应该利用nvcc -V查看cudatoolkit,看它是否是11.8(torch.version = 2.0.0+cu118),若不是则需要更正 It is recommended to use conda install when installing pytorch. This will download the cudatoolkit, and the cudatoolkit is consistent with the cuda version of the torch you installed. If you use pip install to install pytorch, please manually adjust the cudatoolkit to the version corresponding to the torch. , otherwise an error will be reported. For example, you should now use nvcc -V to check cudatoolkit to see if it is 11.8 (torch.version = 2.0.0+cu118). If not, it needs to be corrected.

感谢你的回答

In [2]: torch.version
Out[2]: '2.0.0+cu118'

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

nvcc 和 torch 的cuda 版本是一致的

@simzhangbest
Copy link
Author

simzhangbest commented Mar 2, 2024

image

@MzeroMiko
Copy link
Owner

image

Can you show more detailed information?

@simzhangbest
Copy link
Author

image

Can you show more detailed information?

ok, I change a new machine, not use docker, and use conda to install , the installation is ok

@simzhangbest
Copy link
Author

use docker and pip are not ok for me, so I change a new machine ,it ok

@ZouCha2
Copy link

ZouCha2 commented Mar 30, 2024

建议在安装pytorch的时候采用conda install,这样会带着下载cudatoolkit,且该cudatoolkit与你安装的torch的cuda版本一致,如果使用pip install安装pytorch的话,请手动将cudatoolkit调整为与torch相对应的版本,否则就会报错。 比如,你现在应该利用nvcc -V查看cudatoolkit,看它是否是11.8(torch.version = 2.0.0+cu118),若不是则需要更正 It is recommended to use conda install when installing pytorch. This will download the cudatoolkit, and the cudatoolkit is consistent with the cuda version of the torch you installed. If you use pip install to install pytorch, please manually adjust the cudatoolkit to the version corresponding to the torch. , otherwise an error will be reported. For example, you should now use nvcc -V to check cudatoolkit to see if it is 11.8 (torch.version = 2.0.0+cu118). If not, it needs to be corrected.

你好,我是使用conda install 下载的pytorch和cudatoolkit torch.cuda.is_available()返回的结果是true,但是nvcc -V找不到命令。另外在运行pip install .时,会有没有设置CUDA_HOME的错误,但是我找了所有cuda对应的文件夹下面,没有找到bin文件(或许是说我不知道如何找到cuda并将它添加到环境变量中去),您可以帮帮我吗

@FRunyang
Copy link

torch.version = 2.0.0+cu118

image

我和你的问题一模一样,难道需要从 conda 重新安装 torch 吗?

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