It is currently Sun Aug 23, 2026 9:13 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 81 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
 Post subject: Parallelization in next G'MIC [1.5.7.0]
PostPosted: Tue Aug 27, 2013 10:31 am  (#1) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Hi there,

I've worked all these last days on the G'MIC code, in order to allow the execution of parallel operations in G'MIC filters, using several CPU cores if available. It seems I've reached the end of the big work, and I'd like to have your impressions/feedback on this.

I've posted new (beta) binaries of the G'MIC plug-in for GIMP, both for Linux and Windows users, and I've started to parallelize some of the G'MIC filters, mainly the 'Repair / Smooth [*]' family of filters.
Basically, if you have 4 cores in your CPU, you can expect a x4 gain on the computation time for these filters. You can of course disable the parallelization, to verify this is indeed slower (I hope so!).
This is how it looks (after a filter refresh of course) :

Attachment:
gmic_parallel_smooth.png
gmic_parallel_smooth.png [ 266.55 KiB | Viewed 3761 times ]


Note that if you are using 1.5.6.1, you will get the same parallelization option when refreshing your filters, but unfortunately, it won't run in parallel in this case.
Is there anyone willing to test and tell me if that is indeed faster with the parallelization option ?
The binaries for the beta version are available at :

https://sourceforge.net/projects/gmic/files/beta/

(there is even the installer for Windows users).
Also, please remember you need to update your filters *after the installation*, to have the new options appearing in the smoothing filters.

I'm wait for your feedback, and I'll try to continue parallelizing some other filters. I'll write about my advances on this topic in this thread.


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Parallelization in next G'MIC [1.5.7.0]
PostPosted: Tue Aug 27, 2013 10:52 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: Sep 22, 2012
Posts: 2089
Location: US
Great news David! Thanks!

No 64-bit binaries for Win, I wonder if GMIC 32-bit with multi-threading abilities runs faster that 64-bit single-thread GMIC.
If someone's got Win OS's with both types of architecture, please let everyone know here too.


Top
 Post subject: Re: Parallelization in next G'MIC [1.5.7.0]
PostPosted: Tue Aug 27, 2013 11:02 am  (#3) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16167
David will it work with 2 cores?

_________________
Image


Top
 Post subject: Re: Parallelization in next G'MIC [1.5.7.0]
PostPosted: Tue Aug 27, 2013 11:04 am  (#4) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Yes Rod. It can (now) uses up to 4 cores.
I've just tested it and indeed, I get a roughly x4 gain on the computation time on my images.
I'm very happy to say the least :)


Top
 Post subject: Re: Parallelization in next G'MIC [1.5.7.0]
PostPosted: Tue Aug 27, 2013 11:09 am  (#5) 
Offline
GimpChat Member
User avatar

Joined: Nov 09, 2011
Posts: 726
This is so great! Thanks a lot Ronounours!!!

Kubuntu 64bit - i7-3770 with 4 cores (8 threads)
Image 6000x6000px - Smooth [anisotropic]

One core: 1min 45sec
Four cores (parallel processing): 0min 35 sec

Excellent!!! :yes

Do you think that then you will expand this feature to support multithreads? Would it have any advantages over multicore?

I hope soon to be able to use parallel processing with Inpaint [patch-based] :)

_________________
Image
Be patient, English is not my language.


Last edited by YAFU on Tue Aug 27, 2013 12:13 pm, edited 1 time in total.

Top
 Post subject: Re: Parallelization in next G'MIC [1.5.7.0]
PostPosted: Tue Aug 27, 2013 11:14 am  (#6) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
@YAFU : Nice result indeed :)
Multithreads and multicore does actually the same, from the computational point of view. New threads can be indeed executed on different cores of the CPU. That's the technique G'MIC now uses to speed parallelize the filters.


Top
 Post subject: Re: Parallelization in next G'MIC [1.5.7.0]
PostPosted: Tue Aug 27, 2013 11:19 am  (#7) 
Offline
GimpChat Member

Joined: May 09, 2012
Posts: 914
@K1TesseraEna

I will do a test to build 64-bit Win in the evening.


Top
 Post subject: Re: Parallelization in next G'MIC [1.5.7.0]
PostPosted: Tue Aug 27, 2013 11:24 am  (#8) 
Offline
GimpChat Member
User avatar

Joined: Nov 09, 2011
Posts: 726
@Ronounours: I see. Just I clarify that my system monitor shows that only 4 threads are working with G'MIC.
I do not understand which filters use 4 threads or 8 threads in GIMP. For example, Gaussian Blur seems to use 4. Resynthesize uses 8 threads.

_________________
Image
Be patient, English is not my language.


Top
 Post subject: Re: Parallelization in next G'MIC [1.5.7.0]
PostPosted: Tue Aug 27, 2013 11:40 am  (#9) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Yes, for now, I've explicitly limited filters to use 4 threads, but theoretically, G'MIC can use all of your cores.
Maybe I will improve that in the future.


Top
 Post subject: Re: Parallelization in next G'MIC [1.5.7.0]
PostPosted: Tue Aug 27, 2013 12:18 pm  (#10) 
Offline
GimpChat Member

Joined: Dec 27, 2012
Posts: 393
Location: England
Yep, it works fine for me. I'm running Linux Mint 15 64 bit and have a six core processor. I didn't time the Smooth Anisotropic filter but at a guess it appears to be about four times faster. Also I have conky set up on my desktop and it showed that four of the six processor cores were running at 100% whilst the filter was in action.
Great stuff much appreciated.

_________________
Image

DeviantArt gallery


Top
 Post subject: Re: Parallelization in next G'MIC [1.5.7.0]
PostPosted: Tue Aug 27, 2013 12:37 pm  (#11) 
Offline
Global Moderator
User avatar

Joined: May 16, 2010
Posts: 16167
Thank you David! I will test on my machine once i have GIMP compiled. I don't want to take anything away from that process at the moment. :lol :)
Awesome news for G'MIC users though.

_________________
Image


Top
 Post subject: Re: Parallelization in next G'MIC [1.5.7.0]
PostPosted: Tue Aug 27, 2013 2:16 pm  (#12) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12837
samj wrote:
@K1TesseraEna

I will do a test to build 64-bit Win in the evening.


I would appreciate that too samj. :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: Parallelization in next G'MIC [1.5.7.0]
PostPosted: Tue Aug 27, 2013 2:17 pm  (#13) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12837
Just again want to thank David for continueing the development of G'MIC. Now for GPU acceleration (as I said at Flickr parallel thread; I asketh for too mucheth. lolol). :)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: Parallelization in next G'MIC [1.5.7.0]
PostPosted: Tue Aug 27, 2013 2:33 pm  (#14) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5241
Location: Gimpville
Sweet! :tyspin

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: Parallelization in next G'MIC [1.5.7.0]
PostPosted: Tue Aug 27, 2013 6:29 pm  (#15) 
Offline
GimpChat Member

Joined: May 09, 2012
Posts: 914
:tyspin Ronounours

*****
Windows 64-bit compilation is available from this link : http://www.aljacom.com/~gmic/gmic-beta_ ... ts_win.zip


Top
 Post subject: Re: Parallelization in next G'MIC [1.5.7.0]
PostPosted: Tue Aug 27, 2013 6:38 pm  (#16) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12837
samj wrote:
:tyspin Ronounours

*****
Windows 64-bit compilation is available from this link : http://www.aljacom.com/~gmic/gmic-beta_ ... ts_win.zip


Just tried your compile samj; works great. Bilateral filter is now a little more spiffier on my system that is (dual-processor). Just wish I now had a quad-core. lol

:)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: Parallelization in next G'MIC [1.5.7.0]
PostPosted: Tue Aug 27, 2013 7:01 pm  (#17) 
Offline
GimpChat Member
User avatar

Joined: Sep 22, 2012
Posts: 2089
Location: US
samj wrote:
@K1TesseraEna

I will do a test to build 64-bit Win in the evening.


Merci beaucoup samj! Je savais que je pouvais compter sur vous :hi5


Top
 Post subject: Re: Parallelization in next G'MIC [1.5.7.0]
PostPosted: Tue Aug 27, 2013 7:47 pm  (#18) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5241
Location: Gimpville
I was able to cut the anisotropic smoothing from 53 seconds to 23 seconds on an Intel quad core. :jumpclap

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: Parallelization in next G'MIC [1.5.7.0]
PostPosted: Tue Aug 27, 2013 9:40 pm  (#19) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12837
GnuTux wrote:
I was able to cut the anisotropic smoothing from 53 seconds to 23 seconds on an Intel quad core. :jumpclap


Showoff. lolol

The problem I have is I'm too cheap to buy a new system. I actually can buy one to spare now, but choose not too, but eventually I'll break and splurge. Hope 16 core systems are available by then. ;)

:)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: Parallelization in next G'MIC [1.5.7.0]
PostPosted: Wed Aug 28, 2013 11:39 am  (#20) 
Offline
GimpChat Member
User avatar

Joined: Jan 03, 2011
Posts: 1656
Arghh. Just found a bug when trying to parallelize the 'Rodilius' filter. Calls to the FFTW3 library functions are not thread-safe, and doing this simultaneously in multiple threads make the library crash. I've fixed it, but I'll need to recompile the binary packages to fix it definitely.
Sorry for people who installed the beta :) (but after all, this was a beta, so there are some risks to use it!).


Top
Post new topic Reply to topic  [ 81 posts ]  Go to page 1, 2, 3, 4, 5  Next

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group