Repository: stable-diffusion-webui
Issue: [Bug]: Segmentation fault while loading model during webui.sh or launch.py execution on Ubuntu22.04 LTS with nivida A4000 and cuda_11.7
Labels: bug-report

### Checklist

- [X] 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
- [X] The issue has not been reported before recently
- [ ] The issue has been reported before but has not been fixed yet

### What happened?

Segmentation fault while loading model during webui.sh or launch.py execution in webui v1.9.4 on Ubuntu22.04 LTS with nivida A4000 and cuda_11.7.

### Steps to reproduce the problem

1. git clone stable-diffusion-webui
2. cd stable-diffusion-webui
3. apt install google-perftools and export LD_PRELOAD=/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4
4. excute ./webui.sh
5. segmentation fault

### What should have happened?

Normal launch webui.

### What browsers do you use to access the UI ?

Google Chrome

### Sysinfo

[sysinfo-2024-06-07-01-39.json](https://github.com/user-attachments/files/15688543/sysinfo-2024-06-07-01-39.json)


### Console logs

```Shell
(sd) hawk@R740:~/sd/stable-diffusion-webui$ ./webui.sh 

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye), Fedora 34+ and openSUSE Leap 15.4 or newer.
################################################################

################################################################
Running on hawk user
################################################################

################################################################
Repo already cloned, using it as install directory
################################################################

################################################################
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.6 (main, Oct 24 2022, 16:07:47) [GCC 11.2.0]
Version: v1.9.4
Commit hash: feee37d75f1b168768014e4634dcb156ee649c05
Launching Web UI with arguments: --listen --theme dark --enable-insecure-extension-access --disable-safe-unpickle --no-hashing --xformers --medvram --skip-torch-cuda-test
Loading weights [6ce0161689] from /home/hawk/sd/stable-diffusion-webui/models/Stable-diffusion/v1-5-pruned-emaonly.safetensors
Running on local URL:  http://0.0.0.0:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 8.4s (prepare environment: 0.2s, import torch: 3.4s, import gradio: 0.8s, setup paths: 1.8s, initialize shared: 0.2s, other imports: 0.7s, load scripts: 0.6s, create ui: 0.5s, gradio launch: 0.2s).
Creating model from config: /home/hawk/sd/stable-diffusion-webui/configs/v1-inference.yaml
/home/hawk/sd/stable-diffusion-webui/venv/lib/python3.10/site-packages/huggingface_hub/file_download.py:1132: 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(
Applying attention optimization: xformers... done.
Model loaded in 4.2s (load weights from disk: 0.7s, create model: 0.7s, apply weights to model: 1.7s, apply half(): 0.7s, calculate empty prompt: 0.2s).
./webui.sh: 第 297 行： 67284 段错误               （核心已转储） "${python_cmd}" -u "${LAUNCH_SCRIPT}" "$@"
```


### Additional information

I have installed google-pertftools,xformers