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]: Cannot locate TCMalloc #10117

Closed
1 task done
RiverBankChild opened this issue May 5, 2023 · 17 comments
Closed
1 task done

[Bug]: Cannot locate TCMalloc #10117

RiverBankChild opened this issue May 5, 2023 · 17 comments
Labels
bug-report Report of a bug, yet to be confirmed

Comments

@RiverBankChild
Copy link

Is there an existing issue for this?

  • 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)
1683283094278

Steps to reproduce the problem

  1. git pull
  2. ./webui.sh

What should have happened?

this error should not happen

Commit where the problem happens

5ab7f21

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

1683283368017

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

@RiverBankChild RiverBankChild added the bug-report Report of a bug, yet to be confirmed label May 5, 2023
@dpsalvatierra
Copy link

dpsalvatierra commented May 5, 2023

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

@phispi
Copy link

phispi commented May 5, 2023

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.
(ldconfigis internally used to locate libtcmalloc.so.4).

@acncagua
Copy link
Contributor

acncagua commented May 5, 2023

On Ubuntu-22.04 with WSL2, installing google-perftools improved the situation
sudo apt install --no-install-recommends google-perftools

@QureL
Copy link

QureL commented May 7, 2023

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

@LUisCArlosRO
Copy link

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. (ldconfigis internally used to locate libtcmalloc.so.4).

Hi, can you tell me how to solve this, thank you.

@phispi
Copy link

phispi commented May 15, 2023

Hi, can you tell me how to solve this, thank you.

I added the line

PATH=$PATH:/usr/sbin

to webui-user.sh.

@frostdecker99
Copy link

sudo apt install --no-install-recommends google-perftools

thanks, this is worked for me !

@LUisCArlosRO
Copy link

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.

@cuihp
Copy link

cuihp commented Jun 1, 2023

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

@akx
Copy link
Collaborator

akx commented Jun 14, 2023

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". 😁

@akx akx closed this as completed Jun 14, 2023
@woaiseeit
Copy link

On Archlinux: pacman -S gperftools

Using TCMalloc: libtcmalloc_minimal.so.4

@marks202309
Copy link

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.

@ademar111190
Copy link

I had to install these packages on open suse libtcmalloc4 libgthread-2_0-0

@hkpD
Copy link

hkpD commented Oct 14, 2023

I had to install these packages on open suse libtcmalloc4 libgthread-2_0-0

hey, thank you

@didibus
Copy link

didibus commented Oct 14, 2023

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 ?

@nero-dv
Copy link
Contributor

nero-dv commented Oct 24, 2023

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

@p0lfilt3r
Copy link

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)"

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

17 participants