Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: stable diffusion not using gpu #16843

Open
6 tasks
Aivoice96 opened this issue Feb 14, 2025 · 9 comments
Open
6 tasks

[Bug]: stable diffusion not using gpu #16843

Aivoice96 opened this issue Feb 14, 2025 · 9 comments

Comments

@Aivoice96
Copy link

Checklist

  • The issue exists after disabling all extensions
  • The issue exists on a clean installation of webui
  • The issue is caused by an extension, but I believe it is caused by a bug in the webui
  • The issue exists in the current version of the webui
  • The issue has not been reported before recently
  • The issue has been reported before but has not been fixed yet

What happened?

When using stable diffusion, the gpu of my rtx 3060 is not used, and when opening task manager, it does not appear when extracting images that it is being used ,, I want to use the gpu more since I have 12 GB of vram
Is there a solution to using the gpu so that I can appreciate the fastest image extraction process ؟

Image

Steps to reproduce the problem

1

What should have happened?

1

What browsers do you use to access the UI ?

No response

Sysinfo

1

Console logs

1

Additional information

1

@Aivoice96 Aivoice96 added the bug-report Report of a bug, yet to be confirmed label Feb 14, 2025
@w-e-w w-e-w removed the bug-report Report of a bug, yet to be confirmed label Feb 15, 2025
@w-e-w
Copy link
Collaborator

w-e-w commented Feb 15, 2025

when opening task manager, it does not appear when extracting images that it is being used

task manager not showing GPU 3D activity is could be normal

seems to be related to the driver version

most likely it's using GPU but you just don't realize it

assuming that the screenshot was taken immediately after the image generation finishes

if your instance is indeed NOT using GPU then it should be using CPU, but as you can see there is not spike in CPU activity, so it's most likely using GPU

your post does not contain any other information that would indicate whether or not it is using GPU
no sysinfo.json no logs no time takes to complet the job

if you wish someone to look into this further provide more information

@Aivoice96
Copy link
Author

Aivoice96 commented Feb 15, 2025

your post does not contain any other information that would indicate whether or not it is using GPU no sysinfo.json no logs no time takes to complet the job

if you wish someone to look into this further provide more information

how could i contain the log ,, through terminal screen ?
@w-e-w

@Aivoice96
Copy link
Author

Image
@w-e-w
is this log ?

@w-e-w
Copy link
Collaborator

w-e-w commented Feb 15, 2025

I have a 13700k CPU, if I use CPU to generating 512x512 image with sd1.5
the speed is around 0.28 it/s

assuming that you're generating with similar settings
3.8 it/s is 13 times faster then 0.28 it/s

you are using GPU

@Aivoice96
Copy link
Author

I have a 13700k CPU, if I use CPU to generating 512x512 image with sd1.5 the speed is around 0.28 it/s

assuming that you're generating with similar settings 3.8 it/s is 13 times faster then 0.28 it/s

you are using GPU

@w-e-w but it's not show on my GPU in task manager ,, why ?

@w-e-w
Copy link
Collaborator

w-e-w commented Feb 19, 2025

but it's not show on my GPU in task manager ,, why ?

I don't know why GPU activity in task manager is broken
I have my guesses but I don't have any actual proof If those guesses are true
if you want a definitive answer you have to look somewhere else


my guess on why task manager does not show the acture load activity in 3D field is purely based on my observations and should not be taken as fact

I believe the 3D activity in task manager only shows when there is some accompanying graphical activity and not just CUDA

the reason of my speculation

my laptop with a discrete GPU (dGPU) GTX 1650, with a Intel internal GPU (iGPU)
the laptop display connect to the iGPU
so the main GPU is the iGPU which handles most of the light weight rendering tasks
the dGPU is only used for heavy tasks such as 3D applications such as games or for CUDA taks such as stable diffusion, the GPU is "off" most of the time

the task manager displays 3D activity, which most likely means that they will be some graphical output of some type
when running games it seems to work
but when running stable diffusion which doesn't have a graphical output so I think task manager decides to ignore it

note by "task manager" I'm referring to itself and its dependencies on how it retrieves information such as drivers not just task manager alone

this hypothesis is strengthened by the testing on my main PC, which has a 3090 and iGPU
if I plug my monitors on the dGPU, the 3D activity inside task managner seems to correspond to stable diffusion
but if I plug my monitors on the iGPU (meaning that lightweight tasks suach as desktop rendering are performed by iGPU and dGPU is "off" most of the time), when running stable diffusion the task managner only spikes for a brief moment at the beginning of the job then drops to 0%, even though clearly that the dGPU is working


a long time ago (possibly 6~9 years ago) I recall there used to be a dedicated CUDA graph in task manager
I think it got removed either by driver update or something


I suggest you use HWiNFO if you want to see more reliable GPU activity

@TheVertexDoctor
Copy link

@w-e-w but it's not show on my GPU in task manager ,, why ?

Use the dropdown and pick cuda. You're welcome.

https://gyazo.com/5790f142cd4f10308043dab0604ac709

@w-e-w
Copy link
Collaborator

w-e-w commented Feb 21, 2025

Use the dropdown and pick cuda. You're welcome.

well I did mention that there is CUDA in task manager but it's just not showing on lots of systems for some reason
this has been something that has been bothering me for lots of years

found one answer today that checks out on my system
https://answers.microsoft.com/en-us/windows/forum/all/cuda-not-in-task-manager/a65eed92-828f-4d92-b9c9-cb2666bdd87f

it turns out it's apparently has something to do with Hardware-accelerated GPU scheduling (HAGS)

with HAGS on CUDA and lots of other graphs don't show

On Off
Image Image

note 1: they could factors other then HAGS that enable of disable thoses graphs

note 2: this is not a recommendation to turn HAGS on or off
some claims that enabling it helps performance while others claim the contrary

@TheVertexDoctor
Copy link

AH I see. I have HAGS off, never felt i needed it as I have a 3090 and really haven't had any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants