oloko64 / upscale-rs

A Tauri based GUI app that upscale images using Real-ESRGAN model.
MIT License
88 stars 8 forks source link

multi gpu support #13

Closed seiyajin closed 1 year ago

seiyajin commented 1 year ago

can you add multi gpu support or gpu selector, for your next update, i think it will good performance and faster for upscaling image

oloko64 commented 1 year ago

Nice suggestion. I'll be looking into it for the next update.

Currently I have a Linux machine with a integrated graphics and a Nvidia one, so I will be testing there.

I will be releasing rc builds when I manage to implement it, stay tuned.

oloko64 commented 1 year ago

Hi, during my launch today I started the implementation of multi gpu support, follow this PR to see the progress: https://github.com/OLoKo64/upscale-rs/pull/12

I didn't had time to test it yet but it should be already working, as the correct arguments are being correctly passed to the binary that does the upscaling.

The UI needs a bit of work still. image

The documentation of the commands can be found in this link: https://github.com/xinntao/Real-ESRGAN#usage-of-portable-executable-files

seiyajin commented 1 year ago

thanks alot for replying my request, this is will be great update

On Sat, 25 Feb 2023, 00:00 Reinaldo Rozato Junior, @.***> wrote:

Hi, during my launch today I started the implementation of multi gpu support, follow this PR to see the progress: #12 https://github.com/OLoKo64/upscale-rs/pull/12

I didn't had time to test it yet but it should be already working, as the correct arguments are being correctly passed to the binary that does the upscaling.

The UI needs a bit of work still. [image: image] https://user-images.githubusercontent.com/49915167/221240655-c2ec3b39-0726-4cac-89cc-fe05c2d8eaf4.png

The documentation of the commands can be found in this link: https://github.com/xinntao/Real-ESRGAN#usage-of-portable-executable-files

— Reply to this email directly, view it on GitHub https://github.com/OLoKo64/upscale-rs/issues/13#issuecomment-1444027159, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJCKAB6V75VITFNVFGAB6WDWZDSLVANCNFSM6AAAAAAVDM3O3M . You are receiving this because you authored the thread.Message ID: @.***>

oloko64 commented 1 year ago

@seiyajin I just released the first cross plataform release candidate for the v0.2.2 which includes the advanced options for multi GPU as well as added support for webp images.

Give it a spin and tell me what you think.

v0.2.2-rc1 link: https://github.com/OLoKo64/upscale-rs/releases/tag/v0.2.2-rc1

seiyajin commented 1 year ago

thanks for rc build update, seem work ok, for my old GPU (gtx660 + gtx750ti) oneGPU

but i think for some reason multiGPU string not worked so well (case happen when i'm using cupscale too) multiGPU i think this problem happen from realESRGAN script, not pytorch modul

oloko64 commented 1 year ago

Hey @seiyajin , thanks for testing so quickly.

So the selection of GPU is working but not the parallelization when using multi GPU.

I can think in 3 possibilities:

seiyajin commented 1 year ago

ok, i will try with other parameter, like you said parallelization multi gpu seem complicated, i tried searching solution about this problem, but i can not find the right answer. by the way, can i make request, for next update, can you add option for gfgan model inclued(optional), for face restoration, thank you

On Sun, 26 Feb 2023, 22:38 Reinaldo Rozato Junior, @.***> wrote:

Hey, thanks for testing so quickly.

So the selection of GPU is working but not the parallelization when using multi GPU.

I can think in 3 possibilities:

  • Maybe you need to pass the other parameters as well, for example, when using gpu-id: 0,1 set the tile-size: 0,0 and the load:proc:save: 1:2,1:2 as well. Can you try that? My notebook does not recognize the integrated graphics as a second GPU so I cant test it.
  • The documentation was not clear to me if the multi GPU support works only when selecting a directory, not individual files, so the parallelization occurs that way. This is a bit of a problem as I designed the app to select files only, so you can select the ones you need, not folders. This would require a bit more work to get right.
  • The last option is like you said, maybe is something wrong with the realESRGAN binary.

— Reply to this email directly, view it on GitHub https://github.com/OLoKo64/upscale-rs/issues/13#issuecomment-1445391273, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJCKAB75UABTKS4RM6P7F5DWZN2F3ANCNFSM6AAAAAAVDM3O3M . You are receiving this because you were mentioned.Message ID: @.***>

oloko64 commented 1 year ago

@seiyajin Some updates.

I tested some things to make the multi GPU work but sadly I was not successful, it really seems that it is made for when you select a folder, but as it would require a good chunk of work and it just split the work between the images, not really a multi GPU.

Two things make me not want to add the upscale per folder:

  1. It's not certain that it will work in the end, as I researched and didn't find any thread saying that works as intended, taking account the work it would take just to test it, not worth it, at least for now.
  2. In my experience with similar apps, per-folder upscaling was a bit hit and miss, if you selected a folder that contained anything other than photos they could crash, even worse, when you forgot some photos that were already upscaled in that folder, causing the application to create images larger than 1GB.

by the way, can i make request, for next update, can you add option for gfgan model inclued(optional), for face restoration

In this app I'm using the binary, not the Python script, and it still has the feature "Support face restore - GFPGAN" as a TODO.


For now im going to finish this update including the following:

In the future if I manage to find a way to make the multi GPU work I will update it, same with the face restoration, as soon as they update it i will as well.