Repository: stable-diffusion-webui
Issue: [Bug]: xformers fails to import while module fails to be detected after force reinstall download
Labels: bug-report

### Checklist

- [ ] The issue exists after disabling all extensions
- [X] 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
- [X] 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?

User did a clean install on my Pop_OS machine after fully updating it. After a fresh install User added xformers to my starting arguments. Xformers module failed to be detected. User applied starting arguments to reinstall xfomers. 

This gererated the following unusual text code: 
Launching Web UI with arguments: 
/home/user/Programs/A1111 WebUI/stable-diffusion-webui/venv/lib/python3.10/site-packages/timm/models/layers/__init__.py:48: FutureWarning: Importing from timm.models.layers is deprecated, please import via timm.layers
  warnings.warn(f"Importing from {__name__} is deprecated, please import via timm.layers", FutureWarning)
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
Loading weights [6ce0161689] from /home/user/Programs/A1111 WebUI/stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.safetensors
Running on local URL:  http://127.0.0.1:7860

There is a second outcome the prints errors in the program code but I cannot reproduce currently

### Steps to reproduce the problem

1)User does a clean install on my Pop_OS machine after fully updating it. 
2)After a fresh install User adds xformers to my starting arguments. 
3)User applies starting arguments to reinstall xfomers. 


### What should have happened?

WebUI should detect and load xformers module

### What browsers do you use to access the UI ?

Mozilla Firefox

### Sysinfo

[sysinfo-2024-12-09-03-30.json](https://github.com/user-attachments/files/18056028/sysinfo-2024-12-09-03-30.json)

### Console logs

```Shell
################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye), Fedora 34+ and openSUSE Leap 15.4 or newer.
################################################################

################################################################
Running on User user
################################################################

################################################################
Create and activate python venv
################################################################

################################################################
Launching launch.py...
################################################################
glibc version is 2.35
Check TCMalloc: libtcmalloc_minimal.so.4
libtcmalloc_minimal.so.4 is linked with libc.so,execute LD_PRELOAD=/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4
Python 3.10.12 (main, Nov  6 2024, 20:22:13) [GCC 11.4.0]
Version: v1.10.1
Commit hash: 82a973c04367123ae98bd9abdf80d9eda9b910e2
Launching Web UI with arguments: 
/home/user/Programs/A1111 WebUI/stable-diffusion-webui/venv/lib/python3.10/site-packages/timm/models/layers/__init__.py:48: FutureWarning: Importing from timm.models.layers is deprecated, please import via timm.layers
  warnings.warn(f"Importing from {__name__} is deprecated, please import via timm.layers", FutureWarning)
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
Loading weights [6ce0161689] from /home/user/Programs/A1111 WebUI/stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.safetensors
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Creating model from config: /home/user/Programs/A1111 WebUI/stable-diffusion-webui/configs/v1-inference.yaml
Startup time: 6.9s (prepare environment: 1.4s, import torch: 2.1s, import gradio: 0.5s, setup paths: 1.2s, initialize shared: 0.3s, other imports: 0.3s, load scripts: 0.4s, create ui: 0.3s, gradio launch: 0.3s).
/home/user/Programs/A1111 WebUI/stable-diffusion-webui/venv/lib/python3.10/site-packages/huggingface_hub/file_download.py:797: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
  warnings.warn(
ERROR: ld.so: object '/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Gtk-Message: 21:53:05.723: Failed to load module "canberra-gtk-module"
Gtk-Message: 21:53:05.724: Failed to load module "canberra-gtk-module"
Applying attention optimization: Doggettx... done.
Model loaded in 2.8s (load weights from disk: 0.4s, create model: 0.4s, apply weights to model: 1.8s, calculate empty prompt: 0.1s).
```


### Additional information

There is a second outcome the prints errors in the programs code but I cannot reproduce this currently. I read thru it. xformers is failing to be imported as a library in one of the scripts.