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安装不了的问题 #65

Open
DawnMagnet opened this issue Jan 4, 2025 · 2 comments
Open

一帖解决所有selective-scan安装不了的问题 #65

DawnMagnet opened this issue Jan 4, 2025 · 2 comments

Comments

@DawnMagnet
Copy link

DawnMagnet commented Jan 4, 2025

为什么selective-scan这么难安装呢?因为其特殊性,用到了cuda中的诸多组件(例如cuda-tools,cuparse)等,安装漏一个就会出各种各样的编译错误。那么解决环境问题的最好方法是什么呢?

对了,就是Docker

下面奉上编译成功的Dockerfile

FROM nvcr.io/nvidia/cuda:12.4.1-cudnn-runtime-rockylinux9

RUN dnf install -y python3.12 python3.12-pip python3.12-devel && \
    dnf clean all

RUN pip3.12 install --upgrade pip && \
    pip3.12 install torch torchvision einops packaging ninja wheel

WORKDIR /sel
RUN python3.12 setup.py bdist_wheel

这只是一个例子,你需要什么样的python版本或者torch版本你可以自己指定,一定能编译成功,因为这个镜像是NVIDIA自己做的,里面各种组件是非常齐全的。

编译成功后得到的wheel,不需要任何特殊环境便可以直接安装,所以后续使用无需重新编译(如果你不修改selective-scan其中的代码的话),只需要使用pip安装这个wheel即可。
下面奉上我成功编译的

selective_scan-0.0.2-cp312-cp312-linux_x86_64.whl.zip

有任何问题欢迎找我讨论!

经过测试,torch2.5编译出来的包在2.3下也仍然可用

注:如需指定torch==2.3.0,一定要指定torchvision==0.18,否则可能会出错

@StanleySun233
Copy link

hi请问有windows环境下的编译解决方案吗?

@2746642262
Copy link

请问windows下有好的解决方案吗?

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

3 participants