openvinotoolkit / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
247 stars 39 forks source link

[Bug]: SD doesn't see & use Intel GPU Arc A770 at all #100

Closed AndrewRainfall closed 4 months ago

AndrewRainfall commented 4 months ago

Is there an existing issue for this?

What happened?

Hi! Recently I bought Intel Arc A770 solely to run SD. I installed this OpenVINO version, but for some reason it doesn't see & doesn't use my GPU at all.

I have "Accelerate with OpenVINO" dropdown script & selected GPU in it. But I'm not sure what options should I choose.

During image generation my CPU load is about 70% while GPU is at 5%, so it's not CPU bottleneck. It's not GPU problem either cuz it works fine in games & other tasks. GPU drivers are up to date.

Can't find any solution to this problem for hours now.

Steps to reproduce the problem

1) Before buying new GPU I already had Stable Diffusion for AMD & Fooocus (they are still installed, but I haven't tested them with an Intel GPU yet). 2) Removed old AMD GPU, install new Intel GPU (Arc A770). Installed latest GPU drivers. 3) Installed OpenVINO Stable Diffusion. It didn't lauch because there were too many letters in the installation path, so I moved it to drive C and everything worked. 4) Made a mklink to another drive with models to save space on C drive (I did this before with AMD Stable Diffusion and everything was fine) 5) Fixed "Fatal: detected dubious ownership in repository" with this "takeown /F "DriveLetter:\Whatever\Folder\You\Cloned\It\To\stable-diffusion-webui" /R /D Y" 6) Launched OpenVINO Stable Diffusion and found that it was not using the GPU. 7) Started to search for a solution. Runned first-time-runner bat, but it didn't help. I didn't find anything usefull, so I wrote here.

What should have happened?

Fast image generation with GPU

Sysinfo

sysinfo-2024-02-20-19-14.txt

What browsers do you use to access the UI ?

Google Chrome

Console logs

venv "C:\stable-diffusion-webui\venv\Scripts\Python.exe"
fatal: No names found, cannot describe anything.
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: 1.6.0
Commit hash: 44006297e03a07f28505d54d6ba5fd55e0c1292d
Launching Web UI with arguments: --skip-torch-cuda-test --precision full --no-half
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
Warning: caught exception 'Torch not compiled with CUDA enabled', memory monitor disabled
Loading weights [41b6846108] from C:\stable-diffusion-webui\models\Stable-diffusion\cyberrealistic_v41BackToBasics.safetensors
Running on local URL:  http://127.0.0.1:7860

To create a public link, set `share=True` in `launch()`.
Creating model from config: C:\stable-diffusion-webui\configs\v1-inference.yaml
Startup time: 14.6s (prepare environment: 0.4s, import torch: 6.3s, import gradio: 1.5s, setup paths: 1.4s, initialize shared: 0.2s, other imports: 0.8s, setup codeformer: 0.2s, load scripts: 2.4s, create ui: 0.7s, gradio launch: 0.7s).
Applying attention optimization: InvokeAI... done.
Model loaded in 3.6s (load weights from disk: 1.0s, create model: 0.6s, apply weights to model: 1.2s, apply float(): 0.5s, calculate empty prompt: 0.3s).
4x-UltraSharp
  8%|██████▏                                                                            | 3/40 [03:12<39:30, 64.06s/it]
Total progress:   6%|████

Additional information

I don't have Resizable BAR enabled but I doubt that it's the problem.

cavusmustafa commented 4 months ago

Hi, thank you for reporting the issue. If you run the inference for a second time, do you still see that it is not using GPU? Also, there should be folder in the webui working directory called "cache" which was generated after the first time it is executed. Could you delete this folder and try again?

If still it does not work on GPU, can you check if the generated "cache" folder has any ".xml" and ".bin" files in "cache/model"? Are you able to run the commend below with the xml file found in "cache/model":

benchmark_app -m .xml -api sync -niter 2 -d GPU

AndrewRainfall commented 4 months ago

Upd.: I did cmd --> pip install --pre openvino After that I updated pip as it was adviced in cmd

Now it works

Upd.: but only with 1.5 models. SDXL still ignores GPU.