Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6450 Discussions

encountering error with Stable diffusion + openvino and possible memory leak?

The_Chazz
Beginner
587 Views

Hello, I have having a bit of an issue with stable diffusion openvino.

 

I am getting my command shell filled with

 

torch._dynamo.symbolic_convert: [WARNING] C:\Users\----\Downloads\stable-diffusion-webui\venv\lib\site-packages\torch\nn\modules\linear.py <function Linear.forward at 0x000001C4CABA9BD0> [UserDefinedObjectVariable(LoraPatches), NNModuleVariable(), TensorVariable()] {} too many positional arguments

 

it also appears to be causing a memory leak as currently at the end of a generation of 20 steps with 20 hires steps my system is currently using 72.1GB/95.9GB system ram.

 

I followed https://github.com/openvinotoolkit/stable-diffusion-webui/wiki/Installation-on-Intel-Silicon

to get up and running.

PC info:

CPU Ryzen 9 x5950

96GB System Ram

Intel Arc A770

Windows 11 Pro 23H2

0 Kudos
4 Replies
Megat_Intel
Moderator
532 Views

Hi The_Chazz,

Thank you for reaching out to us.

 

For your information, I installed Stable Diffusion for OpenVINO™ following the same guide and I was able to run the txt2img with OpenVINO™ using my iGPU and did not encounter any errors. sd success .png

sd cmd .png

OS: Windows 11

Python: 3.10.6

GPU: Intel(R) UHD Graphics

torch: 2.1.0

 

There is a similar case where the error is caused due to the torch version incompatibility. Please check your torch version and try to install the torch version 2.1.0 and see if this fixes the "TensorVariable" issue. sd torch.png

 

Regarding the memory leak. I also observed the memory still being occupied after the image generation was completed. My Stable Diffusion program uses on average 3.5 GB of RAM and it stays that way. However, I noticed that the RAM usage goes down after a few minutes. Could you please try and wait for 5-10 minutes after the image generation is complete to see if the memory goes back to normal?

 

 

Regards,

Megat

 

0 Kudos
The_Chazz
Beginner
484 Views

thank you for your reply. can you provide instructions on how to upgrade torch to version 2.1.0+cpu? I am just an end user, and not really familiar with how to install dependencies etc.

 

thank you!

0 Kudos
Megat_Intel
Moderator
387 Views

Hi The_Chazz,

 

To install the torch version 2.1.0, follow the steps below:

  1. cd stable-diffusion-webui
  2. venv\Scripts\activate
  3. pip install torch==2.1.0

 

On the other hand, to check the torch version installed on your device, you can validate by running the command:

pip show torch

 

 

Regards,

Megat

0 Kudos
Megat_Intel
Moderator
242 Views

Hi The_Chazz,

Thank you for your question. This thread will no longer be monitored since we have provided a suggestion. If you need any additional information from Intel, please submit a new question. 



Regards,

Megat


0 Kudos
Reply