stable-diffusion-webui
stable-diffusion-webui copied to clipboard
[Bug]: Cannot locate TCMalloc
Is there an existing issue for this?
- [X] I have searched the existing issues and checked the recent builds/commits
What happened?
when i run webui.sh on centos server, it came out a error : Cannot locate TCMalloc (improves CPU memory usage)
Steps to reproduce the problem
- git pull
- ./webui.sh
What should have happened?
this error should not happen
Commit where the problem happens
5ab7f213
What platforms do you use to access the UI ?
No response
What browsers do you use to access the UI ?
No response
Command Line Arguments
eval "$(conda shell.bash hook)"
conda activate sdwebui
export COMMANDLINE_ARGS="--share --xformers --enable-insecure-extension-access"
List of extensions
Console logs
(base) [zjh@VM-0-2-centos stable-diffusion-webui]$ ./webui.sh
################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################
################################################################
Running on zjh user
################################################################
################################################################
Repo already cloned, using it as install directory
################################################################
################################################################
Create and activate python venv
################################################################
################################################################
Launching launch.py...
################################################################
Cannot locate TCMalloc (improves CPU memory usage)
Python 3.10.6 | packaged by conda-forge | (main, Aug 22 2022, 20:36:39) [GCC 10.4.0]
Commit hash: 5ab7f213bec2f816f9c5644becb32eb72c8ffb89
Installing requirements
Launching Web UI with arguments: --share --xformers --enable-insecure-extension-access
==============================================================================
You are running torch 1.13.1+cu117.
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.
==============================================================================
=================================================================================
You are running xformers 0.0.16rc425.
The program is tested to work with xformers 0.0.17.
To reinstall the desired version, run with commandline flag --reinstall-xformers.
Use --skip-version-check commandline argument to disable this check.
=================================================================================
Civitai Helper: Get Custom Model Folder
Civitai Helper: Load setting from: /home/zjh/stable-diffusion-webui/extensions/Stable-Diffusion-Webui-Civitai-Helper/setting.json
Civitai Helper: No setting file, use default
ControlNet v1.1.112
ControlNet v1.1.112
Loading weights [db220d90e5] from /home/zjh/stable-diffusion-webui/models/Stable-diffusion/chilloutmix-Ni-non-ema-fp32.safetensors
Creating model from config: /home/zjh/stable-diffusion-webui/configs/v1-inference.yaml
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
Applying xformers cross attention optimization.
Textual inversion embeddings loaded(0):
Model loaded in 3.5s (load weights from disk: 0.2s, create model: 0.5s, apply weights to model: 0.7s, apply half(): 0.2s, load VAE: 1.3s, move model to device: 0.6s).
Running on local URL: http://127.0.0.1:7860
Running on public URL: https://77e0ebb4f66b51594b.gradio.live
This share link expires in 72 hours. For free permanent hosting and GPU upgrades (NEW!), check out Spaces: https://huggingface.co/spaces
Startup time: 9.7s (import torch: 0.9s, import gradio: 1.1s, import ldm: 0.4s, other imports: 0.7s, load scripts: 0.8s, load SD checkpoint: 3.6s, create ui: 0.6s, gradio launch: 1.5s).
Additional information
No response
Did you install TCMalloc from your OS repositories?
Here is mine on Ubuntu
(venv) dsalvat1@leviathan:~/stable-diffusion-webui$ dpkg -l |grep malloc
ii libgoogle-perftools-dev:amd64 2.9.1-0ubuntu3 amd64 libraries for CPU and heap analysis, plus an efficient thread-caching malloc
ii libgoogle-perftools4:amd64 2.9.1-0ubuntu3 amd64 libraries for CPU and heap analysis, plus an efficient thread-caching malloc
ii libtcmalloc-minimal4:amd64 2.9.1-0ubuntu3 amd64 efficient thread-caching malloc
On my system the reason for this was that ldconfig
(in the Debian package libc-bin
), despite being installed, was not found. It is installed in /usr/sbin/ldconfig
and /usr/sbin
is not in the PATH
if webui.sh
is started as normal user.
(ldconfig
is internally used to locate libtcmalloc.so.4
).
On Ubuntu-22.04 with WSL2, installing google-perftools improved the situation sudo apt install --no-install-recommends google-perftools
Did you install TCMalloc from your OS repositories?
Here is mine on Ubuntu
(venv) dsalvat1@leviathan:~/stable-diffusion-webui$ dpkg -l |grep malloc ii libgoogle-perftools-dev:amd64 2.9.1-0ubuntu3 amd64 libraries for CPU and heap analysis, plus an efficient thread-caching malloc ii libgoogle-perftools4:amd64 2.9.1-0ubuntu3 amd64 libraries for CPU and heap analysis, plus an efficient thread-caching malloc ii libtcmalloc-minimal4:amd64 2.9.1-0ubuntu3 amd64 efficient thread-caching malloc
this is helpful in ubuntu20.04: sudo apt-get install libgoogle-perftools4 libtcmalloc-minimal4 -y
On my system the reason for this was that
ldconfig
(in the Debian packagelibc-bin
), despite being installed, was not found. It is installed in/usr/sbin/ldconfig
and/usr/sbin
is not in thePATH
ifwebui.sh
is started as normal user. (ldconfig
is internally used to locatelibtcmalloc.so.4
).
Hi, can you tell me how to solve this, thank you.
Hi, can you tell me how to solve this, thank you.
I added the line
PATH=$PATH:/usr/sbin
to webui-user.sh
.
sudo apt install --no-install-recommends google-perftools
thanks, this is worked for me !
Hi, can you tell me how to solve this, thank you.
I added the line
PATH=$PATH:/usr/sbin
to
webui-user.sh
.
Thank you very much. This solved the problem in Debian.
If you are in the Centos system, try performing the following actions
sudo yum install gperftools
sudo vi /etc/profile
export LD_LIBRARY_PATH=/usr/local/lib
source /etc/profile
This is not an error, it's just a warning that tcmalloc isn't being used.
Anyway, closing because there's a bunch of solutions in this thread, mainly "installing tcmalloc". 😁
On Archlinux: pacman -S gperftools
Using TCMalloc: libtcmalloc_minimal.so.4
Did you install TCMalloc from your OS repositories? Here is mine on Ubuntu
(venv) dsalvat1@leviathan:~/stable-diffusion-webui$ dpkg -l |grep malloc ii libgoogle-perftools-dev:amd64 2.9.1-0ubuntu3 amd64 libraries for CPU and heap analysis, plus an efficient thread-caching malloc ii libgoogle-perftools4:amd64 2.9.1-0ubuntu3 amd64 libraries for CPU and heap analysis, plus an efficient thread-caching malloc ii libtcmalloc-minimal4:amd64 2.9.1-0ubuntu3 amd64 efficient thread-caching malloc
this is helpful in ubuntu20.04: sudo apt-get install libgoogle-perftools4 libtcmalloc-minimal4 -y
Great. This works for me.
I had to install these packages on open suse libtcmalloc4 libgthread-2_0-0
I had to install these packages on open suse
libtcmalloc4 libgthread-2_0-0
hey, thank you
Just curious, do I need to re-install stable-diffusion-webui after I installed TCMalloc, because it already built with GCC without it? Or can I just install TCMalloc after installing stable-diffusion-webui ?
Just curious, do I need to re-install stable-diffusion-webui after I installed TCMalloc, because it already built with GCC without it? Or can I just install TCMalloc after installing stable-diffusion-webui ?
You do not need to reinstall stable-diffusion-webui, it is not a compiled binary. The tcmalloc reference is initialized in webui.sh and was introduced in commit 8af4b3b
In openSUSE 15.5 change line in webui.sh TCMALLOC="$(PATH=/usr/sbin:$PATH ldconfig -p | grep -Po "libtcmalloc(_minimal|).so.\d" | head -n 1)" to TCMALLOC="$(PATH=/sbin:$PATH ldconfig -p | grep -Po "libtcmalloc(_minimal|).so.\d" | head -n 1)"
For Debian: sudo apt install libtcmalloc-minimal4