AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
136.17k stars 25.96k forks source link

[Bug]: ./webui.sh: line 254: 15996 Segmentation fault (core dumped) "${python_cmd}" "${LAUNCH_SCRIPT}" "$@" #12500

Open KEDI103 opened 11 months ago

KEDI103 commented 11 months ago

Is there an existing issue for this?

What happened?

Launching Web UI with arguments: 
./webui.sh: line 254: 15996 Segmentation fault      (core dumped) "${python_cmd}" "${LAUNCH_SCRIPT}" "$@"

Screenshot from 2023-08-13 01-42-11

Steps to reproduce the problem

Just download lastest dev and run get this

What should have happened?

./webui.sh 

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################

################################################################
Running on b_cansin user
################################################################

################################################################
Repo already cloned, using it as install directory
################################################################

################################################################
python venv already activate or run without venv: /media/b_cansin/ai/ai/stable-diffusion-webui/venv
################################################################

################################################################
Launching launch.py...
################################################################
Using TCMalloc: libtcmalloc_minimal.so.4
fatal: No names found, cannot describe anything.
Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]
Version: 1.5.1
Commit hash: 7ba3923d5b494b7756d0b12f33acb3716d830b9a
Installing requirements

Installing requirements 1 for Infinite-Zoom

Launching Web UI with arguments: 
2023-08-13 01:44:23.237055: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
no module 'xformers'. Processing without...
No SDP backend available, likely because you are running in pytorch versions < 2.0. In fact, you are using PyTorch 1.13.1+rocm5.2. You might want to consider upgrading.
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
==============================================================================
You are running torch 1.13.1+rocm5.2.
The program is tested to work with torch 2.0.0.
To reinstall the desired version, run with commandline flag --reinstall-torch.
Beware that this will cause a lot of large files to be downloaded, as well as
there are reports of issues with training tab on the latest version.

Use --skip-version-check commandline argument to disable this check.
==============================================================================
*** Error loading script: postprocessing_pixelization.py
    Traceback (most recent call last):
      File "/media/b_cansin/ai/ai/stable-diffusion-webui/modules/scripts.py", line 319, in load_scripts
        script_module = script_loading.load_module(scriptfile.path)
      File "/media/b_cansin/ai/ai/stable-diffusion-webui/modules/script_loading.py", line 10, in load_module
        module_spec.loader.exec_module(module)
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "/media/b_cansin/ai/ai/stable-diffusion-webui/scripts/postprocessing_pixelization.py", line 13, in <module>
        from pixelization.models.networks import define_G
    ModuleNotFoundError: No module named 'pixelization'

---
*** Error loading script: xy_grid.py
    Traceback (most recent call last):
      File "/media/b_cansin/ai/ai/stable-diffusion-webui/modules/scripts.py", line 319, in load_scripts
        script_module = script_loading.load_module(scriptfile.path)
      File "/media/b_cansin/ai/ai/stable-diffusion-webui/modules/script_loading.py", line 10, in load_module
        module_spec.loader.exec_module(module)
      File "<frozen importlib._bootstrap_external>", line 883, in exec_module
      File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
      File "/media/b_cansin/ai/ai/stable-diffusion-webui/scripts/xy_grid.py", line 15, in <module>
        from modules.processing import process_images, Processed, get_correct_sampler, StableDiffusionProcessingTxt2Img
    ImportError: cannot import name 'get_correct_sampler' from 'modules.processing' (/media/b_cansin/ai/ai/stable-diffusion-webui/modules/processing.py)

---
Loading weights [879db523c3] from /media/b_cansin/ai/ai/stable-diffusion-webui/models/Stable-diffusion/dreamshaper_8/dreamshaper_8.safetensors
Creating model from config: /media/b_cansin/ai/ai/stable-diffusion-webui/configs/v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Model loaded in 56.1s (load weights from disk: 3.0s, create model: 1.3s, apply weights to model: 26.4s, apply half(): 1.9s, load VAE: 2.8s, move model to device: 0.8s, load textual inversion embeddings: 1.1s, calculate empty prompt: 18.7s).
2023-08-13 01:45:58,301 - ControlNet - INFO - ControlNet v1.1.234
ControlNet preprocessor location: /media/b_cansin/ai/ai/stable-diffusion-webui/extensions/sd-webui-controlnet/annotator/downloads
2023-08-13 01:45:58,989 - ControlNet - INFO - ControlNet v1.1.234
Hypernetwork-MonkeyPatch-Extension found!
Applying attention optimization: Doggettx... done.
[VRAMEstimator] Loaded benchmark data.
*Deforum ControlNet support: enabled*
MIOpen(HIP): Warning [SQLiteBase] Missing system database file: gfx906_60.kdb Performance may degrade. Please follow instructions to install: https://github.com/ROCmSoftwarePlatform/MIOpen#installing-miopen-kernels-package
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Startup time: 155.4s (prepare environment: 35.8s, launcher: 0.8s, import torch: 24.5s, import gradio: 3.1s, setup paths: 5.5s, import ldm: 0.1s, other imports: 4.2s, setup codeformer: 0.6s, list SD models: 3.0s, load scripts: 68.2s, create ui: 8.7s, gradio launch: 0.5s, app_started_callback: 0.1s).

Version or Commit where the problem happens

7ba3923d5b494b7756d0b12f33acb3716d830b9a

What Python version are you running on ?

Python 3.10.x

What platforms do you use to access the UI ?

Linux

What device are you running WebUI on?

AMD GPUs (RX 6000 above)

Cross attention optimization

Doggettx

What browsers do you use to access the UI ?

Mozilla Firefox

Command Line Arguments

Launching Web UI with arguments:

List of extensions

Screenshot from 2023-08-13 01-47-46

Console logs

./webui.sh 

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################

################################################################
Running on b_cansin user
################################################################

################################################################
Repo already cloned, using it as install directory
################################################################

################################################################
python venv already activate or run without venv: /media/b_cansin/ai/ai/stable-diffusion-webui/venv
################################################################

################################################################
Launching launch.py...
################################################################
Using TCMalloc: libtcmalloc_minimal.so.4
fatal: No names found, cannot describe anything.
Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0]
Version: 1.5.1
Commit hash: 7ba3923d5b494b7756d0b12f33acb3716d830b9a
Installing requirements

Installing requirements 1 for Infinite-Zoom

Launching Web UI with arguments: 
./webui.sh: line 254: 15996 Segmentation fault      (core dumped) "${python_cmd}" "${LAUNCH_SCRIPT}" "$@"

Additional information

Only I can open webui with Version: 1.5.1 Commit hash: 7ba3923d5b494b7756d0b12f33acb3716d830b9a

Also I can still open invoke ai in same pc and not giving me python error.

catboxanon commented 11 months ago

Version: 1.5.1 Commit hash: https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/7ba3923d5b494b7756d0b12f33acb3716d830b9a

You're not on the correct version. That commit is from last November. It's 9 months old. That is not at all version 1.5.1.

All your console logs refer to that commit as well, so you're likely just on a very out of date version.

shogeki commented 11 months ago

Try adding this to webui-user.sh:

export HIP_VISIBLE_DEVICES="0" export AMDGPU_TARGETS="gfx1030" export HSA_OVERRIDE_GFX_VERSION='10.3.0'

Also, I have an AMD CPU that has IGD (G-series) and also have an AMD graphics card, I get Seg Fault with both enabled, the only way I can seem to run this is by disabling the IGD in BIOS.

Louanes1 commented 11 months ago

I'm running into the same error message : "webui.sh: line 254: 2819482 Killed "${python_cmd}" "${LAUNCH_SCRIPT}" "$@"

I did the installation on wsl ubuntu 20.04 and using python 3.10.9 Nvidia GPU 3090

Im using pyenv to manage my python distributions and create my own virtualenvs. So I had to change, in the webui-user.sh the python command : "python3" to "python" then I launch the webui.sh from my virtualenv.

This setup was working fine when I was using sd 1.5 but now that I am experimenting with SD-XL, I pulled the automatic1111 version 1.5.1 and this error keeps popping.

KEDI103 commented 11 months ago

Also sometimes that error convert to this

b_cansin@b-cansin-ubuntu:/media/b_cansin/ai/ai/stable-diffusion-webui$ ./webui.sh

################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################

################################################################
Running on b_cansin user
################################################################

################################################################
Repo already cloned, using it as install directory
################################################################

################################################################
Create and activate python venv
################################################################

################################################################
Launching launch.py...
################################################################
Using TCMalloc: libtcmalloc_minimal.so.4
./webui.sh: line 248: /media/b_cansin/ai/ai/stable-diffusion-webui/venv/bin/python3: cannot execute binary file: Exec format error

Than I need to delete venv

KEDI103 commented 11 months ago

also I found problem this if I run with this its never working again until venv deleted and recreated. PYTORCH_HIP_ALLOC_CONF=garbage_collection_threshold:0.9,max_split_size_mb:512 python launch.py --precision full --no-half --opt-sub-quad-attention --listen

no-define commented 10 months ago

I'm running into the same error message : "webui.sh: line 254: 2819482 Killed "${python_cmd}" "${LAUNCH_SCRIPT}" "$@"

I did the installation on wsl ubuntu 20.04 and using python 3.10.9 Nvidia GPU 3090

Im using pyenv to manage my python distributions and create my own virtualenvs. So I had to change, in the webui-user.sh the python command : "python3" to "python" then I launch the webui.sh from my virtualenv.

This setup was working fine when I was using sd 1.5 but now that I am experimenting with SD-XL, I pulled the automatic1111 version 1.5.1 and this error keeps popping.

hi, did you solved this ? I'm facing the same error

peseki commented 10 months ago

Started happening to me since i ran package upgrade

1701210370 commented 9 months ago

I'm running into the same error message : "webui.sh: line 254: 2819482 Killed "${python_cmd}" "${LAUNCH_SCRIPT}" "$@" I did the installation on wsl ubuntu 20.04 and using python 3.10.9 Nvidia GPU 3090 Im using pyenv to manage my python distributions and create my own virtualenvs. So I had to change, in the webui-user.sh the python command : "python3" to "python" then I launch the webui.sh from my virtualenv. This setup was working fine when I was using sd 1.5 but now that I am experimenting with SD-XL, I pulled the automatic1111 version 1.5.1 and this error keeps popping.

hi, did you solved this ? I'm facing the same error

I solved the "Segmentation Fault" error by commenting this line as I found code exit in this line, or you can put this line into line 342 where it is used

image
Areshkew commented 9 months ago

Same error here :c RX 580 8 gb

esanscoopsers commented 9 months ago

I am also having this issue on a 6700 XT on Garuda (arch). Is this being worked on?

asp100m commented 7 months ago

Same error here but only happened in docker container. I tried ubuntu, opensuse and centos images, all gave a segfault from protobuf's _message shared object. PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION='python' ./webui.sh This workaround just works for me, but I'm not sure about the performance penalty.

ccl-private commented 7 months ago

@asp100m works for me too, thank you.

INDEX108 commented 6 months ago

@asp100m it works!

tafli commented 6 months ago

Same here with a Radeon 7800 XT on Manjaro Linux. Radeon 6750 XT worked.