Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Exception at ggml_free when lora is used in the prompt and free_sd_ctx called #175

Closed
@fszontagh

Description

@fszontagh

"Exception thrown at 0x00007FFABCBCC55C (ucrtbased.dll) in sd.ui.exe: 0xC0000005: Access violation reading location 0x000001E123A9C07C."

Which is occured at

void ggml_free(struct ggml_context * ctx)

at line 2355 in ggml.c
image

Which is called from ggml_extend.hpp at ggml_free

void free_params_buffer() {
        if (params_ctx != NULL) {
            ggml_free(params_ctx);
            params_ctx = NULL;
        }
...

which is called from the destructor of the GGMLModule

    ~GGMLModule() {
        free_params_buffer();
    }

Which is called from the LoraModel destructor (extended from GGMLModule)

Which is called from StableDiffusionGGML destructor:

    ~StableDiffusionGGML() {
        ggml_backend_free(backend);
    }

which is called from free_sd_ctx what i called to remove the model from the (v)ram

I tried the following situations:

  • sd_ctx is loaded, no lora defined in the prompt: free_sd_ctx is working as expected to multiple times after text2img
  • sd_ctx is loaded, added lora to the prompt, multiple text2img is okay
  • sd_ctx is loaded, added lora to the prompt, then lora removed from prompt, text2img produce the same effect with defined lora in prompt
  • sd_ctx is loaded, lora added to the prompt, txt2img done multiple times, bat can not free_sd_ctx

I think it's the same effect with the embeddings

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions