CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Installation

[foam-extend.org] extend-3.0 cuda installation

Register Blogs Community New Posts Updated Threads Search

Like Tree8Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 22, 2014, 08:40
Default extend-3.0 cuda installation
  #1
Member
 
Join Date: Aug 2011
Posts: 37
Rep Power: 14
Kojote is on a distinguished road
Hi

I tried to install cuda solvers for ext3.0. What i did ->

- installed 3.0 without problems
- installed nvidia driver and cuda 5.5
- then i changed in the prefs.sh ->
# System installed CUDA
export CUDA_SYSTEM=1
export CUDA_DIR=/usr/bin/cuda-5.5
export CUDA_BIN_DIR=$CUDA_DIR/bin
export CUDA_LIB_DIR=$CUDA_DIR/lib
export CUDA_INCLUDE_DIR=$CUDA_DIR/include
export CUDA_ARCH=sm_20

- then i tried to compile the cudaSolvers

but i get a message like this

Found nvcc but \$CUDA_IGNORE set -- not enabling CUDA support.

Or where is this flag? $CUDA_IGNORE

OK found it in the /Allwmake.firstInstall

thx for help me out

Br

Christian
Kojote is offline   Reply With Quote

Old   January 23, 2014, 02:20
Default
  #2
Member
 
Join Date: Aug 2011
Posts: 37
Rep Power: 14
Kojote is on a distinguished road
Hi

Something is wrong with my setup.
I cannot compile Cuda.
Did someone the installation successfully?


Br

Christian
Kojote is offline   Reply With Quote

Old   January 23, 2014, 05:20
Default
  #3
New Member
 
Dominik Christ
Join Date: Mar 2009
Posts: 28
Rep Power: 17
dominik_christ is on a distinguished road
Hi Christian,
the installation works fine on my machine.
Can you please post more information?

* Is the Cuda installation itself working, can you compile and run the Cuda tutorial cases?
* Where is your Cuda installation located? /usr/bin/cuda seems a little strange to me. If you installed from .deb package, Cuda is located in /usr/local/cuda/ . If you type "which nvcc" and "locate bin/nvcc" what output do you get?
* How do you try to compile the Cuda solvers in foam-extend? Which commands are you running?
* What is the exact error message that you get?

Best regards,
Dominik
dominik_christ is offline   Reply With Quote

Old   January 23, 2014, 05:54
Default
  #4
Member
 
Join Date: Aug 2011
Posts: 37
Rep Power: 14
Kojote is on a distinguished road
Hi

Thx for answer. I am at work in the moment. Will get the infos asap. But good to hear that cuda is possible.

Br

Christian
Kojote is offline   Reply With Quote

Old   January 23, 2014, 12:13
Smile
  #5
Member
 
Join Date: Aug 2011
Posts: 37
Rep Power: 14
Kojote is on a distinguished road
* Is the Cuda installation itself working, can you compile and run the Cuda tutorial cases?
yes make is working in samples

* Where is your Cuda installation located? /usr/bin/cuda seems a little strange to me. If you installed from .deb package, Cuda is located in /usr/local/cuda/ . If you type "which nvcc" and "locate bin/nvcc" what output do you get? you are right, i posted wrong path

which nvcc ->
/usr/local/cuda/bin/nvcc

prefs.sh:
export CUDA_SYSTEM=1
export CUDA_DIR=/usr/local/cuda
export CUDA_BIN_DIR=$CUDA_DIR/bin
export CUDA_LIB_DIR=$CUDA_DIR/lib
export CUDA_INCLUDE_DIR=$CUDA_DIR/include
export CUDA_ARCH=sm_20

settings.sh
# CUDA if available
# ~~~~~~~~~~~~~~~~~
[ -z "$CUDA_SYSTEM" ] && [ -e /usr/local/cuda/bin/nvcc ] && {
export CUDA_DIR=/usr/local/cuda
export CUDA_BIN_DIR=$CUDA_DIR/bin
export CUDA_LIB_DIR=$CUDA_DIR/lib
export CUDA_INCLUDE_DIR=$CUDA_DIR/include
}



* How do you try to compile the Cuda solvers in foam-extend? Which commands are you running?

./Allwmake in the cudaSolvers

* What is the exact error message that you get?

Found nvcc but $CUDA_IGNORE set -- not enabling CUDA support

but yesterday the flag was ok and then there were errors, too.

what can i do?

[/QUOTE]

many thanks for help

christian
Kojote is offline   Reply With Quote

Old   January 27, 2014, 06:31
Default
  #6
New Member
 
Dominik Christ
Join Date: Mar 2009
Posts: 28
Rep Power: 17
dominik_christ is on a distinguished road
Hi Christian,

When I search all subdirectories for occurrence of CUDA_IGNORE ("grep -r CUDA_IGNORE"), I find only two files: Allwmake.firstInstall and src/cudaSolvers/Allwmake.

Only Allwmake.firstInstall sets this environment variable, so it appears to me that you are running ./Allwmake.firstInstall before going into src/cudaSolvers and running ./Allwmake there.

When setting CUDA_IGNORE, the Allwmake.firstInstall script posts a message:

---
$CUDA_ARCH is required by nvcc compiler but not set.
Check section '-gpu-architecture' in 'man nvcc' for details.

Proceed without compiling cudaSolvers? [Y/n]
---

So the remedy would be to set CUDA_ARCH as appropriate for your hardware. I have K20 Tesla cards here and "export CUDA_ARCH=sm20" is the setting that I use.

To automate setting of CUDA_ARCH, you can use etc/presh.sh-EXAMPLE as a template to make a customized etc/prefs.sh with your local settings.

Hope this helps,
Dominik
dominik_christ is offline   Reply With Quote

Old   January 27, 2014, 07:10
Default
  #7
Member
 
Join Date: Aug 2011
Posts: 37
Rep Power: 14
Kojote is on a distinguished road
Quote:
Originally Posted by dominik_christ View Post
Hi Christian,

When I search all subdirectories for occurrence of CUDA_IGNORE ("grep -r CUDA_IGNORE"), I find only two files: Allwmake.firstInstall and src/cudaSolvers/Allwmake.

Only Allwmake.firstInstall sets this environment variable, so it appears to me that you are running ./Allwmake.firstInstall before going into src/cudaSolvers and running ./Allwmake there.

When setting CUDA_IGNORE, the Allwmake.firstInstall script posts a message:

---
$CUDA_ARCH is required by nvcc compiler but not set.
Check section '-gpu-architecture' in 'man nvcc' for details.

Proceed without compiling cudaSolvers? [Y/n]
---

So the remedy would be to set CUDA_ARCH as appropriate for your hardware. I have K20 Tesla cards here and "export CUDA_ARCH=sm20" is the setting that I use.

To automate setting of CUDA_ARCH, you can use etc/presh.sh-EXAMPLE as a template to make a customized etc/prefs.sh with your local settings.

Hope this helps,
Dominik

Hi Dominik,

Thanks for answer again.
i did all from scratch again. No my cuda settings are 100% OK. Cuda tutorils are compiled. When i run ./Allwmake.firstinstall the scipt sais something like "found nvcc, cuda is compiled by default" I adjusted the settings.sh and prefs.sh before that. While comping OpenFoam the massage with the flag is in the log file.
Cuda will be not compiled. When i do "wmake libso" in the cudaSolver folder then "make has no target" (i use the german ubuntu so i don't know the massage in english).

By the way what are your experience with cuda.

Br

Christian
Kojote is offline   Reply With Quote

Old   January 27, 2014, 13:32
Default
  #8
New Member
 
Dominik Christ
Join Date: Mar 2009
Posts: 28
Rep Power: 17
dominik_christ is on a distinguished road
Hi Christian,

When you post, please provide exactly the steps you are taking with verbatim commands, post log files (as attachments if possible) and error messages as they are because it is very difficult to identify anything from a written summary (and I cannot tell if you e.g. forgot to source the etc/bashrc file at some point, or something like that)
I can live with German error messages.

Regarding my experience with cuda and foam-extend:
1) It works ...

2) ... except for coupled boundary conditions, like cyclic, processor and ggi. These need to be updated in every iteration that a solver (e.g. BiCG) is doing for a transport equation. This would require:
a) Uploading the intermediate data back to CPU, update the cyclic BCs and load the changed values back to the GPU (=very time-consuming)
or
b) Implementing all coupled boundary conditions with GPU code.

So this is tricky by principle. I believe that implementing general coupled boundary condition support for GPU is the major open task for the future.

3) I have not yet made a valid comparison, that is between a good CPU setup and a good GPU setup. When time allows, there will be something to show at the workshop.

Best regards,
Dominik
dominik_christ is offline   Reply With Quote

Old   January 28, 2014, 02:44
Default
  #9
Member
 
Join Date: Aug 2011
Posts: 37
Rep Power: 14
Kojote is on a distinguished road
Hi Dominik

OK. I have to reinstall a computer next week. Then i will write out all logs etc. I would be very nice if you could have a look at them if i failure again.

Some more questions:

Do you have to decompose a cuda case, or is this be done by the hardware?
And is it possible to run a case with lagrangian particle on cuda?

!!! Many thanks for your help !!!!

Br

Christian
Kojote is offline   Reply With Quote

Old   January 28, 2014, 05:23
Default
  #10
Member
 
xxxxx
Join Date: Feb 2013
Posts: 34
Rep Power: 13
xxxx is on a distinguished road
Hello!

I'm trying to install cudaSolvers too, but I found the same problems as Kojote.
I managed to compile foam-ext-3.0 with cuda ( "found nvcc, cuda is compiled by default") but when I try to run ./Allwmake in cudaSolvers dir I get:

linux@linux-Precision-T7600:~/foam/linux-3.0/src/cudaSolvers$ ./Allwmake
Found nvcc but $CUDA_IGNORE set -- not enabling CUDA support.

and if I try wmake libso instead of ./Allwmake I get:

linux@linux-Precision-T7600:~/foam/linux-3.0/src/cudaSolvers$ wmake libso
wmakeLnInclude: linking include files to ./lnInclude
make: *** No rule to make target `cudaCG/cgDiag.dep', needed by `Make/linux64Gcc46DPOpt/dependencies'. Stop.

How did you manage to make it work, dominik_christ?
Thanks in advance
__________________
Federico
xxxx is offline   Reply With Quote

Old   January 28, 2014, 10:14
Default
  #11
Member
 
Join Date: Aug 2011
Posts: 37
Rep Power: 14
Kojote is on a distinguished road
Hi

Now i did it all again on another computer. Ubuntu 12.04 64bit / CUDA 5.5.
Nvidia driver (319.37) from the cuda run file. My card is a GeForce GTX 650 Ti and from what i know i have to use sm_30.
And i have the same situation like Federico described.

I did -> export CUDA_IGNORE=0, with the Allwmake.firstInstall the flag is not written.

And with "./Allwmake" in the cudaSolver folder or "wmake libso" getting this:

Found nvcc -- enabling CUDA support.
make: *** Keine Regel vorhanden, um das Target »cudaCG/cgDiag.dep«,
benötigt von »Make/linux64Gcc46DPOpt/dependencies«, zu erstellen. Schluss.

Br

Christian
mm.abdollahzadeh likes this.
Kojote is offline   Reply With Quote

Old   January 29, 2014, 04:53
Default
  #12
Member
 
xxxxx
Join Date: Feb 2013
Posts: 34
Rep Power: 13
xxxx is on a distinguished road
Hello Kojote.

Since it seems that we are the only people interested in CUDA compiling on this forum, would you like to keep in contact? Do you have any news about CUDA compiling?
__________________
Federico
xxxx is offline   Reply With Quote

Old   January 29, 2014, 04:57
Default
  #13
Member
 
Join Date: Aug 2011
Posts: 37
Rep Power: 14
Kojote is on a distinguished road
Hi,

Yes to keep in touch, no to the news.

Br

Christian
Kojote is offline   Reply With Quote

Old   January 31, 2014, 10:45
Default
  #14
New Member
 
Dominik Christ
Join Date: Mar 2009
Posts: 28
Rep Power: 17
dominik_christ is on a distinguished road
Dear Christian and Federico,

I could reproduce some of the issues and found some solutions:
1) The logic in Allwmake must be inverted: It tests for [ -z $CUDA_IGNORE], which is for the absence of CUDA_IGNORE. The logic has to be: If IGNORE is absent, do compile. The "then" and "else" part must therefore be swapped to:
if [ -z $CUDA_IGNORE ]
then
echo "Found nvcc -- enabling CUDA support."
wmake libso
else
echo "Found nvcc but \$CUDA_IGNORE set -- not enabling CUDA support."
fi

2) "wmake libso" should work independently from this. The compilation error that Christian is seeing comes from a broken dependency. To re-create dependencies, run "wclean" before "wmake libso" (but please read the points below before that).

3) The cufflink headers in "*.cu" and "include/*.H" in directory "cudaSolver/" have become messed up. For a quick fix, add a closing comment "*/" at the end of the descriptive header before the actual code for these files.

4) If you get any error with "gpu-architecture", then CUDA_ARCH is not set. As mentioned in the post above, you can permanently set it in etc/prefs.sh (use etc/prefs.sh-EXAMPLE as template). My configuration is:

export CUDA_SYSTEM=1
export CUDA_DIR=/usr/local/cuda
export CUDA_BIN_DIR=$CUDA_DIR/bin
export CUDA_LIB_DIR=$CUDA_DIR/lib64
export CUDA_INCLUDE_DIR=$CUDA_DIR/include
export CUDA_ARCH=sm_20

With these changes, I can compile cudaSolvers with the latest version of the git repository version. I will make a bugfix from above points and submit it to the foam-extend project.

Hope this solves the issues on your machines as well.

Best regards,
Dominik
dominik_christ is offline   Reply With Quote

Old   January 31, 2014, 11:10
Default
  #15
Member
 
Join Date: Aug 2011
Posts: 37
Rep Power: 14
Kojote is on a distinguished road
hi dominik

wow will try asap

manythx for your help and for your work

christian
Kojote is offline   Reply With Quote

Old   January 31, 2014, 13:35
Default
  #16
Member
 
Krishna
Join Date: Jun 2012
Posts: 33
Blog Entries: 1
Rep Power: 13
rkc.cfd is on a distinguished road
Quote:
Originally Posted by dominik_christ View Post
Dear Christian and Federico,

The cufflink headers in "*.cu" and "include/*.H" in directory "cudaSolver/" have become messed up. For a quick fix, add a closing comment "*/" at the end of the descriptive header before the actual code for these files.

Dominik
That was funny when I found out that somebody really wanted us to read the code

Also when I compiled it was asking for the cusp definitions
Code:
lnInclude/cudaTypes.H:53:29: error: cusp/coo_matrix.h: No such file or directory
So I downloaded from the git repository and added the directory to make file options.

Thanks to all of you on this thread.
chery1986 likes this.
rkc.cfd is offline   Reply With Quote

Old   February 1, 2014, 05:39
Default
  #17
Member
 
xxxxx
Join Date: Feb 2013
Posts: 34
Rep Power: 13
xxxx is on a distinguished road
Thank you dominik_christ,

Actually I already fixed this:

Quote:
Originally Posted by dominik_christ View Post

3) The cufflink headers in "*.cu" and "include/*.H" in directory "cudaSolver/" have become messed up. For a quick fix, add a closing comment "*/" at the end of the descriptive header before the actual code for these files.
And this:

Quote:
Originally Posted by dominik_christ View Post

4) If you get any error with "gpu-architecture", then CUDA_ARCH is not set. As mentioned in the post above, you can permanently set it in etc/prefs.sh (use etc/prefs.sh-EXAMPLE as template). My configuration is:

export CUDA_SYSTEM=1
export CUDA_DIR=/usr/local/cuda
export CUDA_BIN_DIR=$CUDA_DIR/bin
export CUDA_LIB_DIR=$CUDA_DIR/lib64
export CUDA_INCLUDE_DIR=$CUDA_DIR/include
export CUDA_ARCH=sm_20
with CUDA_ARCH=sm_30 (my machine!) before to try to compile with wmake libso but I still can't compile cudaSolvers.

Have you tested it? Do they work now? (the gpu solvers I mean)
__________________
Federico
xxxx is offline   Reply With Quote

Old   February 1, 2014, 11:44
Default
  #18
Member
 
Join Date: Aug 2011
Posts: 37
Rep Power: 14
Kojote is on a distinguished road
Hi

good to know that you were able to compile

Quote:
Originally Posted by rkc.cfd View Post
That was funny when I found out that somebody really wanted us to read the code

Also when I compiled it was asking for the cusp definitions
Code:
lnInclude/cudaTypes.H:53:29: error: cusp/coo_matrix.h: No such file or directory
So I downloaded from the git repository and added the directory to make file options.

Thanks to all of you on this thread.
could you upload your cuda solver folder here or somewhere else

thx

christian
Kojote is offline   Reply With Quote

Old   February 3, 2014, 02:18
Default
  #19
Member
 
Join Date: Aug 2011
Posts: 37
Rep Power: 14
Kojote is on a distinguished road
Hi

I'm still running in trouble. I did the fix for the headers and the script. After "wclean" and "wmake libso" i still get this.

Making dependency list for source file cudaSolver/cudaSolver.C
make: *** Keine Regel vorhanden, um das Target »cudaCG/cgDiag.dep«,
benötigt von »Make/linux64Gcc46DPOpt/dependencies«, zu erstellen. Schluss.

Br

Christian
Kojote is offline   Reply With Quote

Old   February 3, 2014, 22:11
Default
  #20
Member
 
Krishna
Join Date: Jun 2012
Posts: 33
Blog Entries: 1
Rep Power: 13
rkc.cfd is on a distinguished road
Hi,

Sorry for the late reply, some how I was not subscribed to the thread and did not get the message.

The link to my github is

https://github.com/mechysolv/openfoa...extend-3.0.git

I have downloaded the cusp solvers to

Code:
$WM_THIRD_PARTY_DIR/LocalDev
from

https://github.com/cusplibrary/cusplibrary

Hope that helps,

RKC
mm.abdollahzadeh likes this.
rkc.cfd is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[foam-extend.org] A problem about installation of open foam extend 3.1 Toalchemist OpenFOAM Installation 1 May 31, 2018 08:58
[foam-extend.org] problems with openFoam extend 3.0 installation AmirBaqa1987 OpenFOAM Installation 1 December 20, 2016 19:17
problem with RBF in tho Foam 3.0 extend Vesek OpenFOAM Programming & Development 4 June 16, 2014 04:22
ParaView-4.0.1 did not compile for foam extend 3.0 installation mhkenergy OpenFOAM Installation 8 June 4, 2014 02:26
[swak4Foam] Basic Error when installing swak4foam with foam extend 3.0 mnobrega OpenFOAM Community Contributions 6 April 1, 2014 01:47


All times are GMT -4. The time now is 17:04.