Djdefrag / QualityScaler

QualityScaler - image/video AI upscaler app
MIT License
2.08k stars 152 forks source link

System resources not being fully utilized #57

Open FluffyDiscord opened 11 months ago

FluffyDiscord commented 11 months ago

I have rather high end PC and upscaling videos are slow. Current system usage seems low. Would it be possible to speed up the upscaling for higher end setups? I remember other setups to take less time and use more system resources

image

Video is ~3 minutes long. image

Setup: R7 5800X3D 32GB RAM RTX 4090 Samsung Pro NVME SSD

Djdefrag commented 11 months ago

Hi my friend,

This probably happens because the cpu can't send enough images to the gpu to upscale, considering that the gpu is extremely faster than the cpu (in general, not your pc, which has monster components).

At the moment I set it to use only 1 cpu, because even trying with more than 1 the total time to upscale a video remained the same, at least considering my gpu. But yours, which is extremely more powerful, can actually handle many more operations.

This problem will be partly solved with the next version, which will be focused solely on performance. In particular there will be a new AI engine that is the result of more than a year of work (I'm waiting for Microsoft to release it stably) that will bring:

However I would also like to add a widget to choose how many cpu to use for the AI engine, this could help a lot especially in your case, that is with a very high performance pc.

FluffyDiscord commented 11 months ago

The widget would be great - could it be done before the release of the updated version that waits for Microsoft release?

Also I got to the point where ffmpeg was stitching the images back together. It also didnt use fully my CPU and the SSD was barely used, so probably not bottlenecked by IO. Could you also add oltion to specify threads ? Would love to use all of them if possible (there's hard limit of 16 AFAIK for ffmpeg)

Djdefrag commented 11 months ago

Yes, my friend

I am actually working on it and it will be released as soon as possible.

For ffmpeg, to set the number of cpus to use you can change the CPU number widget.

Consider that CPU means thread, so if your cpu has 16 threads and you want to use them all you have to enter 16

FluffyDiscord commented 11 months ago

Just a heads up, the CPU number that I enter to the GUI does not seem to be added to ffmpeg command line:

Screenshot_2

Djdefrag commented 11 months ago

Hi,

i do not use ffmpeg directly, but with moviepy library.

despite not being in the commandline, then actually all the cpus are used?

FluffyDiscord commented 11 months ago

I don't think all threads are used, I entered 8 and I saw the same usage as on the screen, around 15-20%, which would indicate 3-4 threads

Djdefrag commented 11 months ago

This is strange, i clearly see all my cpu used.

But i will investigate further, thank you my friend

Yau0608 commented 3 months ago

I wonder if this problem have already been fixed? I am using a i7 9700k cpu with rtx 3060 gpu, but the application won't use all 12 GB vram in the gpu like 4.5/12 only image