Arminius-Software / face2video

MIT License
61 stars 3 forks source link

No GPU Usage #2

Closed sp00ks-git closed 4 months ago

sp00ks-git commented 4 months ago

Hi, Cool script so thanks for that. (Possibly more a feature request)

I note that on execution my GPU isn't utilised during any of the processes. Is this by design or something else? Nvidia GTX3080ti

My GPU is utilised around 90% during normal operation with Reactor.

Arminius-Software commented 4 months ago

Interesting, Reactor has always been running on the CPU for me. It might have something to do with the onnxruntime-gpu library, how ever installing it made no difference for me. Did you install face2video in a virtual environment?

sp00ks-git commented 4 months ago

Interesting, Reactor has always been running on the CPU for me. It might have something to do with the onnxruntime-gpu library, how ever installing it made no difference for me. Did you install face2video in a virtual environment?

I assume you mean "Reactor has always been running on the GPU for me"?

no virtual envirnoment, Debian 10 with python 3.10 installed from source.

Everything seems fine...

Also receive this meesage about codecs but wasnt an issue just fyi.

image

Arminius-Software commented 4 months ago

No, Reactor never used the GPU for me. Now, after some tinkering with the venv and the correct onnxruntime-gpu library, it suddenly does. But you are correct, the script versions seem to not use the GPU no matter if in a venv or not. I am currently very busy, but I will take a closer look at the actual Reactor code and the Automatic 1111 API when I have some more free time. If using the GPU would make the process notably faster, then it would definitely be worth figuring out how to utilize the GPU. Thank you for bringing this to my attention.

Arminius-Software commented 4 months ago

I finally found the time to take a closer look at this issue. Turns out there is an option built into the reactor API to choose if you want to run the extension via the CPU or the GPU. I have now added the option to select either the CPU or the GPU, with GPU being the default option. However, changing between CPU and GPU between videos requires restarting automatic1111 for the change to apply. Running this GPU-based appears to be at least 30-50% faster. Thanks again for pointing this out.