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

[Bug]: Updating pyTorch and Cuda leads to error in Xformers #15444

Closed
1 of 6 tasks
michaelbluth opened this issue Apr 5, 2024 · 2 comments
Closed
1 of 6 tasks

[Bug]: Updating pyTorch and Cuda leads to error in Xformers #15444

michaelbluth opened this issue Apr 5, 2024 · 2 comments
Labels
bug-report Report of a bug, yet to be confirmed

Comments

@michaelbluth
Copy link

michaelbluth commented Apr 5, 2024

Checklist

  • The issue exists after disabling all extensions
  • The issue exists on a clean installation of webui
  • The issue is caused by an extension, but I believe it is caused by a bug in the webui
  • The issue exists in the current version of the webui
  • The issue has not been reported before recently
  • The issue has been reported before but has not been fixed yet

What happened?

I updated Python --

Steps to update Python

  1. Download and install https://www.python.org/downloads/release/python-31011/

Previous version - 3.10.6
Current version - 3.10.11

and pyTorch --

Steps to update pyTorch :

  1. goto \stable-diffusion-webui\venv\Script
  2. .\activate
  3. pip install --force-reinstall torch torchvision --index-url https://download.pytorch.org/whl/cu121

Previous version - 2.0.1+cu118
New version - 2.2.2+cu121

Running Stable Diffusion now gives two errors. One command line and one popup.

Command Line :

WARNING:xformers:WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for:
    PyTorch 2.1.2+cu121 with CUDA 1201 (you have 2.2.2+cu121)
    Python  3.10.11 (you have 3.10.11)
  Please reinstall xformers (see https://github.com/facebookresearch/xformers#installing-xformers)
  Memory-efficient attention, SwiGLU, sparse and more won't be available.

Popup :

The procedure entry point
?requires_grad@TensorOptions@c10@@QEBA?AU12@V?$optional@ _N@2@@Z could not be located in the dynamic link library D:\stabledif\stable-diffusion-webui\venv\Lib\site-packages\xformers\__
C.pyd.

If I run Stable Diffusion now with --xformers it refuses to generate an image.

Steps to reproduce the problem

  1. Download and install https://www.python.org/downloads/release/python-31011/

Previous version - 3.10.6
Current version - 3.10.11

and pyTorch --

Steps to update pyTorch :

  1. goto \stable-diffusion-webui\venv\Script
  2. .\activate
  3. pip install --force-reinstall torch torchvision --index-url https://download.pytorch.org/whl/cu121

What should have happened?

pyTorch should have updated normally and xformers runs without errors

What browsers do you use to access the UI ?

Mozilla Firefox

Sysinfo

sysinfo-2024-04-05-18-36.json

Console logs

venv "D:\stabledif\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Version: v1.8.0
Commit hash: bef51aed032c0aaa5cfd80445bc4cf0d85b408b5
Launching Web UI with arguments:
WARNING:xformers:WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for:
    PyTorch 2.1.2+cu121 with CUDA 1201 (you have 2.2.2+cu121)
    Python  3.10.11 (you have 3.10.11)
  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
No module 'xformers'. Proceeding without it.

Additional information

No response

@michaelbluth michaelbluth added the bug-report Report of a bug, yet to be confirmed label Apr 5, 2024
@ak47T
Copy link

ak47T commented Apr 10, 2024

hi, I have the same issue, did you solve it?

@Gavin-Evans
Copy link

Gavin-Evans commented Apr 18, 2024

@michaelbluth @ak47T
now, xformers is available for pytorch2.2.2

soluing it by the following:
1.If xformers is installed, but incompatible, please uninstall it by pip uninstall xformers

2.see xformers, reinstall it, accourding to cu118 or cu121, and If pip3 doesn't work, using pip.

3.as for others, please reference #6594; Of course, you may not encounter this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Report of a bug, yet to be confirmed
Projects
None yet
Development

No branches or pull requests

3 participants