badgerhong
badgerhong

Reputation: 21

SD Automatic 1111: src/tcmalloc.cc:283] Attempt to free invalid pointer 0x5a3426b059d0

Is anyone else running into issues running the Stable Diffusion 1.5~2.1 on Automatic1111 UI in Google Colab and seeing this error message? I think I messed up my environment testing out version 0.9; the error is "related to memory allocation and deallocation" and appear related to underlying libraries.

src/tcmalloc.cc:283] Attempt to free invalid pointer 0x5a3426b059d0 

I've already tried updating core libraries,

!pip install pyngrok --upgrade
!pip install gradio --upgrade

and when that didn't work, tried uninstalling all of them too:

import pkg_resources
import subprocess

# Get the list of installed distributions/packages
dists = [d for d in pkg_resources.working_set]

for dist in dists:
    cmd = f"pip uninstall -y {dist.project_name}"
    process = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    output, error = process.communicate()

    if output:
        print(output.decode())
    if error:
        print(error.decode())

I accidentally deleted the notebook with all my code, but even after copying over one of the managed Google Colab notebooks referenced by the A1111's Git, I still get the same error.

Here's a link to the A1111 UI Git: https://github.com/AUTOMATIC1111/stable-diffusion-webui

Please refer to the codebase in this notebook: https://colab.research.google.com/github/TheLastBen/fast-stable-diffusion/blob/main/fast_stable_diffusion_AUTOMATIC1111.ipynb

Anyone know how to resolve or happen know what's going on? Thanks in advance!

Upvotes: 0

Views: 2057

Answers (1)

badgerhong
badgerhong

Reputation: 21

I removed this line of code, and the UI started loading for me again:

%env LD_PRELOAD=libtcmalloc.so

EDIT: Just saw there's a discussion about this going on Git: https://github.com/TheLastBen/fast-stable-diffusion/issues/2343

Looks like additionally updating this code in the Requirements snippet is making it work for some:

!pip install --no-cache-dir open-clip-torch==2.20.0 -qq --no-deps

Upvotes: 0

Related Questions