|
[Sponsors] |
May 1, 2014, 19:31 |
CUDA solvers of foam-extend-3.0
|
#1 |
Member
A. Bernath
Join Date: Jun 2011
Location: Karlsruhe, Germany
Posts: 39
Rep Power: 15 |
Hello,
has anybody suceeded up to now in using the new cuda solvers of foam-extend-3.0? As an example, I changed in a tutorial case from PCG to cudaCG but the solver then complains about not knowing this type of solver. Also the printed list does not contain the cuda solvers. Before wasting too much time I thought it could be helpful to ask here for people which have or, even better, had the same problem. Would be nice to get some help and share experiences! Bye, Alex |
|
May 8, 2014, 04:41 |
|
#2 |
Member
A. Bernath
Join Date: Jun 2011
Location: Karlsruhe, Germany
Posts: 39
Rep Power: 15 |
So nobody has used that solvers until now?
|
|
May 8, 2014, 05:23 |
|
#3 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,097
Rep Power: 34 |
Hi,
I don't think the cuda library is loaded by default in most solvers, so you would need to add the following to system/controlDict (on Linux): Code:
libs ("libcudaSolvers.so"); Code:
libs ("libcudaSolvers.dylib"); Code:
cd $FOAM_SRC/cudaSolvers ./Allwmake |
|
May 10, 2014, 17:54 |
|
#4 |
Member
A. Bernath
Join Date: Jun 2011
Location: Karlsruhe, Germany
Posts: 39
Rep Power: 15 |
Hi Philip,
thanks for the hint. I got one step further but it crashes right when the cuda solver should start with the calculation. The error message reads Code:
terminate called after throwing an instance of 'thrust::system::detail::bad_alloc' what(): std::bad_alloc: unknown error fvSolution looks like this: Code:
U { solver cudaCG; preconditioner diagonal; tolerance 1e-07; relTol 0.1; } I haven't checked if the cuda examples provided by nvidia work so that will be my next step. Thanks, Alex |
|
May 11, 2014, 14:57 |
|
#5 |
Member
A. Bernath
Join Date: Jun 2011
Location: Karlsruhe, Germany
Posts: 39
Rep Power: 15 |
Godd news, CUDA works now. I had the wrong driver version installed and after downgrading to the one which came with the cuda installer, everything works fine.
I tested some tutorial cases but actually it isn't faster at all when using the GPU. I checked the GPU utilization level and I could not get that value above 10% so I guess if I could optimize this, the calculation will be faster. But how to achieve this? Is there anyone who actually has accelerated calculations with this solvers? Do I have to tell the solver how many cuda cores should be used? |
|
May 12, 2014, 05:14 |
|
#6 | |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,097
Rep Power: 34 |
Quote:
As regards speed-up (or lack thereof), if I were you I would first check that you can replicate the speed-up results of Dan Combest (see his slides for OFW6) who originally developed some of these solvers. He used laplacianFoam and a hot block test case, BUT the speed-ups found were only for single precision. I'm not sure that the GPU linear solvers in the current form show any speed-up for double precision (please correct me if anyone knows better). Also, a basic solver like laplacianFoam is best suited to these GPU linear solvers as explicit terms are not iteratively updated outside the line solver, like in the SIMPLE/PISO algorithms and in the solidMechanics solvers. Philip |
||
June 8, 2014, 15:24 |
|
#7 | |
Senior Member
mahdi abdollahzadeh
Join Date: Mar 2011
Location: Covilha,Portugal
Posts: 153
Rep Power: 15 |
Quote:
I had installed everything successfully. but when I try to run a case I am getting a problem. Quote: terminate called after throwing an instance of 'thrust::system::system_error' what (): invalid device function Aborted (core dumped) I also try downgrading from cuda 6 to cuda 5.5. but the problem continue to exist. do u know how to resolve it? many thanks best mahdi |
||
June 9, 2014, 16:58 |
|
#8 |
Member
A. Bernath
Join Date: Jun 2011
Location: Karlsruhe, Germany
Posts: 39
Rep Power: 15 |
Hi Mahdi,
try to install the driver that comes with the cuda runfile. You can extract it by using Code:
-extract=/absolute/path/to/extract/location/ Regarding the speed up, I did some testing in double precision and there is a speed up for large problems when compared to the CG and BiCG solvers but none in case of GAMG. I also monitored the usage of the gpu during the calculations. It was only noteworthy high for the larger problems and I think this is the reason for the speed up. Regards, Alex |
|
June 11, 2014, 06:39 |
|
#10 | |
Senior Member
mahdi abdollahzadeh
Join Date: Mar 2011
Location: Covilha,Portugal
Posts: 153
Rep Power: 15 |
Quote:
now cuda is working . but I had tested for motorbike case it didnt show me no speed up. thus i tried for more heavy case. but then it terminated with a warning regarding memory. my graphic card is gforce 8400 GS. is there any way to resolve it? or is it just running on one processers of the graphic card and can i alter it? best mahdi |
||
June 11, 2014, 11:52 |
|
#11 | |
Member
A. Bernath
Join Date: Jun 2011
Location: Karlsruhe, Germany
Posts: 39
Rep Power: 15 |
Quote:
did you actually change the solvers to e.g. cudaCG in fvSolution? I don't think you can expect too much from your gpu as long as you're not running a super old cpu I don't know if it's possible to give a number of cores that has to be used like it is the case when decomposing and running on cpu. The only thing I can tell you is that if more elements are used and more inner iteration have to be calculated, the gpu usage rises. Regards, Alex |
||
June 11, 2014, 12:00 |
|
#12 | |
Senior Member
mahdi abdollahzadeh
Join Date: Mar 2011
Location: Covilha,Portugal
Posts: 153
Rep Power: 15 |
Quote:
Dear Alex Many thanks for ur answer. sure I had changed the solver to cudaCG and it runned. but as I told it was not efficient for thr motorbike case. then I changed to bigger case but it aborted with warning about memory in thrust. I have a case for simulation of plasma dynamics. its unsteady my mesh is large and I have also extra inner iterations. speeding up solution is necessary in this case for me. but however, I'm wondering how much benefit i could gain in comparison of running that in cluster with 100 CPUS. best mahdi |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] mesh airfoil NACA0012 | anand_30 | OpenFOAM Meshing & Mesh Conversion | 13 | March 7, 2022 18:22 |
[blockMesh] error message with modeling a cube with a hold at the center | hsingtzu | OpenFOAM Meshing & Mesh Conversion | 2 | March 14, 2012 10:56 |
[blockMesh] BlockMesh FOAM warning | gaottino | OpenFOAM Meshing & Mesh Conversion | 7 | July 19, 2010 15:11 |
[blockMesh] Axisymmetrical mesh | Rasmus Gjesing (Gjesing) | OpenFOAM Meshing & Mesh Conversion | 10 | April 2, 2007 15:00 |
[Gmsh] Import gmsh msh to Foam | adorean | OpenFOAM Meshing & Mesh Conversion | 24 | April 27, 2005 09:19 |