What about using GPU's to speed up matrix math?

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Mark Szlazak
Posts: 405
Joined: Tue Apr 04, 2017 6:06 pm
Location: Edmonton, Canada

What about using GPU's to speed up matrix math?

Postby Mark Szlazak » Sat Apr 15, 2017 7:16 am

I don't know if this would be something a CAD package should have. GPU's for doing the heavy lifting of matrix math are used in machine learning/deep learning/neural networks to do hardware speed ups of matrix math. They are not even connected to video monitors and are used like floating point coprocessor chips from decades ago. Anyway, NVIDIA with it's CUDA API is a very popular choice. Would CAD packages like FreeCAD benefit from a hardware speed up of vector math or is this just going overboard?
User avatar
TT-RS
Posts: 70
Joined: Fri Oct 24, 2014 9:19 pm

Re: What about using GPU's to speed up matrix math?

Postby TT-RS » Sat Apr 15, 2017 12:31 pm

Hello!

I don't think FC would benefit much from GPUs in general (in terms of speedup of main workbenches). In some commercial CAD systems mainly rendering modules use GPU (for example Dassault Systemes bought recently hybrid render ("keyshot-brother") and now it is called SW Visualize). There are few free and FOSS renderers that use GPU or even hybrid (GPU+CPU). This software might be used with FC.

More interesting are projects that use GPUs in FEM or CFD calculations. Professional (and expensive) CAE packages (like ANSYS) use GPU in computations - mainly in CFD area.

But there are some works to use GPU in Calculix. Right now I can't find the link of university which works on it, don't remember (but I wrote this link here on forum about 2 years ago). Here are some informations: https://www.openaircraft.com/calculix-extras/

Also in FOSS CFD, OpenFoam will have such possibility. Look at SpeedIT / SimFlow projects. For more info go to: http://gpgpu.org/tag/openfoam
Jee-Bee
Posts: 1959
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: What about using GPU's to speed up matrix math?

Postby Jee-Bee » Sat Apr 15, 2017 4:43 pm

But there are some works to use GPU in Calculix. Right now I can't find the link of university which works on it, don't remember (but I wrote this link here on forum about 2 years ago). Here are some informations: https://www.openaircraft.com/calculix-extras/
bernd wrote:...
Something for FEM workbench?
User avatar
TT-RS
Posts: 70
Joined: Fri Oct 24, 2014 9:19 pm

Re: What about using GPU's to speed up matrix math?

Postby TT-RS » Sat Apr 15, 2017 6:39 pm

Something for FEM workbench?
Yes, when Calculix get this functionality it will be "automatically" available in FC ;).

In my opinion this is difficult subject. I see that commercial CAD packages have problems with utilizing all CPU cores. They use multithreading "only" for Rendering, FEA/CFD and only few other tasks. From 3-4 years SW and, as far as I remember, Inventor use many cores for preparing 2D documentation.
In FC is one more problem, the solution for multithreading and/or using GPU must be cross-platform.
Mark Szlazak
Posts: 405
Joined: Tue Apr 04, 2017 6:06 pm
Location: Edmonton, Canada

Re: What about using GPU's to speed up matrix math?

Postby Mark Szlazak » Sat Apr 15, 2017 10:23 pm

Maybe looking at what the AI/deep learning packages are doing could help with implementation issues like threading. Torch 7 is one open source package. Facebook made public it's Cuda multithreading software for torch a couple years back.
User avatar
TT-RS
Posts: 70
Joined: Fri Oct 24, 2014 9:19 pm

Re: What about using GPU's to speed up matrix math?

Postby TT-RS » Sun Apr 16, 2017 10:32 am

How would you apply ML / AI to CAD software ? ;) I think it would be nice if FC could use multi-core CPU. Now when you run a little bigger macro GUI of FC freezes for some time. But as someone here wrote it is impossible because of libraries used in this software.

( Tensor Flow (from Google) is FOSS from about two years. There are CPU and GPU versions for all major platforms ).
Mark Szlazak
Posts: 405
Joined: Tue Apr 04, 2017 6:06 pm
Location: Edmonton, Canada

Re: What about using GPU's to speed up matrix math?

Postby Mark Szlazak » Mon Apr 17, 2017 7:07 am

How I would apply deep learning to CAD is something I could tell you only after you signed an NDA. :lol:
polymer
Posts: 228
Joined: Fri Sep 12, 2014 8:49 am

Re: What about using GPU's to speed up matrix math?

Postby polymer » Tue Apr 25, 2017 3:22 pm

Z88 has a GPU-Addon, may you can use it in FC, too? http://en.z88.de/z88aurora-gpu-addon/
User avatar
DeepSOIC
Posts: 7051
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: What about using GPU's to speed up matrix math?

Postby DeepSOIC » Tue Apr 25, 2017 4:11 pm

Mark Szlazak wrote:How I would apply deep learning to CAD is something I could tell you only after you signed an NDA. :lol:
Oh, come on! NDA?! :lol: https://www.ted.com/talks/maurice_conti ... tuitive_ai
HoWil
Posts: 840
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: What about using GPU's to speed up matrix math?

Postby HoWil » Wed Apr 26, 2017 6:23 am

Is it possible to use it e.g. for draft-array operations an parts.
Some time ago there was a discussion in the German forum about the long time for arrays (and maybe fuse) of PDN-bodies.
I experienced this also for PDN-transformations if the copies go into the hundreds.
Any chance that this could be accelerated with gpu- or multi-processing?
Br
Howil