stable-diffusion-webui
stable-diffusion-webui copied to clipboard
[Bug]: xFormers can't load C++/CUDA extensions. xFormers was built for:
Is there an existing issue for this?
- [X] I have searched the existing issues and checked the recent builds/commits
What happened?
Never encountered that problem before the update. Obviously did not change/update anything else. Forcefully reinstalling xformers/torch+xformers as it's been recommended in similar threads does not solve the problem.
Launching Web UI with arguments: --xformers --opt-channelslast
WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for:
PyTorch 2.0.0+cu118 with CUDA 1108 (you have 1.13.1+cu117)
Python 3.10.10 (you have 3.10.6)
Solution?
Steps to reproduce the problem
- Clean installation
- Run it
- See the bug
What should have happened?
It should run as intended
Commit where the problem happens
probably the latest, hash is unknown due to the error
What Python version are you running on ?
Python 3.10.x
What platforms do you use to access the UI ?
Windows
What device are you running WebUI on?
Nvidia GPUs (RTX 20 above)
What browsers do you use to access the UI ?
Mozilla Firefox
Command Line Arguments
none
List of extensions
none
Console logs
-
Additional information
No response
I managed to get my latest commit but the error is still here. It says the right version of xformers was installed however it still does not work and shows me the warning.
venv "C:\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.6
Version: v1.2.1
Commit hash: 89f9faa63388756314e8a1d96cf86bf5e0663045
Installing xformers
Collecting xformers==0.0.17
Using cached xformers-0.0.17-cp310-cp310-win_amd64.whl (112.6 MB)
Installing collected packages: xformers
Successfully installed xformers-0.0.17
[notice] A new release of pip available: 22.2.1 -> 23.1.2
[notice] To update, run: C:\stable-diffusion-webui\venv\Scripts\python.exe -m pip install --upgrade pip
Installing requirements
Launching Web UI with arguments:--xformers
WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for:
PyTorch 2.0.0+cu118 with CUDA 1108 (you have 1.13.1+cu117)
Python 3.10.10 (you have 3.10.6)
Please reinstall xformers (see https://github.com/facebookresearch/xformers#installing-xformers)
Memory-efficient attention, SwiGLU, sparse and more won't be available.
Set XFORMERS_MORE_DETAILS=1 for more details
use --reinstall-torch
and --reinstall-xformers
or just deleter the venv so every thing is reinstalled
It does not solve the problem. I already tried all the solutions discussed in this repository. I reinstalled torch, xformers, deleted venv several times. Moreover, I changed nothing in my system but here I am, facing this error after the reinstall.
What should be fixed The script should not force the installation of xformers 0.17 for systems with torch 1.3, it should automatically download xformers 0.16 which is compatible with torch 1.13. Otherwise, it breaks things. Now you can force-install xformers 0.16 by adding arguments in webui.bat but ideally the right xformers version has to be chosen automatically.
Did you get this issue fixed? I'm having the same problem.
Hi! I had the same problem, I solved it with this issue https://github.com/facebookresearch/xformers/issues/664#issuecomment-1459986536
What should be fixed The script should not force the installation of xformers 0.17 for systems with torch 1.3, it should automatically download xformers 0.16 which is compatible with torch 1.13. Otherwise, it breaks things. Now you can force-install xformers 0.16 by adding arguments in webui.bat but ideally the right xformers version has to be chosen automatically.
What arguments do I add to force install a version cause the other solution didn't work for me. I have pytorch version 2.0.1+cu118 which is also incompatible cause it's too high.
What should be fixed The script should not force the installation of xformers 0.17 for systems with torch 1.3, it should automatically download xformers 0.16 which is compatible with torch 1.13. Otherwise, it breaks things. Now you can force-install xformers 0.16 by adding arguments in webui.bat but ideally the right xformers version has to be chosen automatically.
What arguments do I add to force install a version cause the other solution didn't work for me. I have pytorch version 2.0.1+cu118 which is also incompatible cause it's too high.
Hi, try this. Add set XFORMERS_PACKAGE=xformers==0.0.16
(change the version as you like) and set COMMANDLINE_ARGS=--xformers --reinstall-xformers
to webui-user.bat
. Don't forget to remove --reinstall-xformers
afterwards or it'll reinstall it every time.
Or if you are reinstalling it from scratch, try to add set TORCH_COMMAND=pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu117
set XFORMERS_PACKAGE=xformers==0.0.16
(change the versions as you like) to webui-user.bat
before the first run of this bat. It will force-install the versions of torch and xformers you specified.
P.S. You can also add --skip-version-check
to the bat file later on so it won't check it every time.
WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for: PyTorch 2.0..0+cu118 with CUDA 1108 (you have 1.13.1+cu117) 遇到这个问题我的解决方法是: (you have 1.13.1+cu117)这是你的系统内的版本, 重新安装 xFormers 可以按照以下步骤进行: 首先,打开命令行界面。 使用以下命令卸载当前已安装的 xFormers(如果已安装): x:\xxx\xxx\python(你的SD目录内的python文件夹),在上面键入CMD 然后在控制台输入以下命令 pip uninstall xformers 完成后打开启动器(我是秋叶的绘世) 高级选项 点进去后跟一键启动并排 有个环境维护,配置pyTorch点开,选择版本,与你的(you have 1.13.1+cu117)这一项版本一致的选择完点击安装即可解决.
WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for: PyTorch 2.0..0+cu118 with CUDA 1108 (you have 1.13.1+cu117) 遇到这个问题我的解决方法是: (you have 1.13.1+cu117)这是你的系统内的版本, 重新安装 xFormers 可以按照以下步骤进行: 首先,打开命令行界面。 使用以下命令卸载当前已安装的 xFormers(如果已安装): x:\xxx\xxx\python(你的SD目录内的python文件夹),在上面键入CMD 然后在控制台输入以下命令 pip uninstall xformers 完成后打开启动器(我是秋叶的绘世) 高级选项 点进去后跟一键启动并排 有个环境维护,配置pyTorch点开,选择版本,与你的(you have 1.13.1+cu117)这一项版本一致的选择完点击安装即可解决.
Use PyTorch 2.0..0+cu118 使用PyTorch 2.0..0+cu118版本 Change Mockin's Arg into set TORCH_COMMAND=pip install torch==2.0.0+cu118