DarthAffe / StableDiffusion.NET

C# Wrapper for StableDiffusion.cpp
MIT License
60 stars 10 forks source link

Is there a way to set the maximum use of video memory? #6

Closed Kimcn closed 6 months ago

Kimcn commented 6 months ago

Thank you very much for the contribution of the author. I had a problem when using it.

CUDA error: out of memory current device: 0, in function ggml_cuda_pool_malloc_leg at D:\a\StableDiffusion.NET\StableDiffusion.NET\ggml\src\ggml-cuda.cu:8583 cudaMalloc((void **) &ptr, look_ahead_size) GGML_ASSERT: D:\a\StableDiffusion.NET\StableDiffusion.NET\ggml\src\ggml-cuda.cu:255: !"CUDA error"

I want to know if there is a way to set the maximum use video memory.

DarthAffe commented 6 months ago

No, there's no way to limit the memory usage.

You can trade some performance to reduce it by setting KeepVaeOnCPU in the ModelParameters or by quantizing the Model. Aside from that the only options are a smaller model or a reduced size of the generated image.

Kimcn commented 6 months ago

Thank you.