xinntao / Real-ESRGAN

Real-ESRGAN aims at developing Practical Algorithms for General Image/Video Restoration.
BSD 3-Clause "New" or "Revised" License
28.15k stars 3.53k forks source link

Multithreading for python script. #156

Open therealkingoftheuniverse opened 2 years ago

therealkingoftheuniverse commented 2 years ago

It seems like the python script is only using 1 thread. My gpu is not being fully saturated all the time. Is it possible to increase the threads used by the python script?

P.S. It seems that you can use the portable version? Is it any performance penalty to use it?

KeygenLLC commented 2 years ago

I would like to know this as well.

I see the same in CPU mode on macOS. Most it uses is about 1.3 cores max at any given time, even on a 10 core machine. Still relatively fast on desktop, but could be faster if it was multi-threaded.

I can't test the portable vulkan build here properly as it's not compatible with my OS/hardware and errors out at the end because it can't find a library. It pegs my AMD GPU while processing though, using all of it, rendering an image in a matter of seconds.

darkcristle commented 2 years ago

I am also trying to figure this out, my original solution was to just use the ncnn version but I was having serious block issues and was unable to find a solution (not using -s). When I ran the pytorch version for the first time it utilized nearly 90% of my GPU but since then I have been unable to pass 15%. I am not sure what has changed.

Were you ever able to figure out a solution?

P.S. I made a modification for it to use .jpg instead of .png as the png kept getting stored as 16bit despite the source not being 16bit. No reason that should be relevant but who knows.