|
[Sponsors] |
GPU compilation for hybrid vortex/finite volume Method |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 22, 2014, 04:38 |
GPU compilation for hybrid vortex/finite volume Method
|
#1 |
New Member
Join Date: Dec 2012
Location: Tokyo, Japan
Posts: 5
Rep Power: 13 |
Hello,
I am working on a hybrid vortex method/finite volume method. I already have a C++ implementation of the vortex method and I have decided to use OpenFOAM for the FVM part. In the vortex method, to solve the N-body problem we use a GPU function. To compile it we first compile the cuda part with nvcc and then we link using g++. The makefile is: Code:
INCLUDE = -I/opt/cuda/include -I. LIBS = -Wl,-rpath,/opt/cuda/lib64 -L/opt/cuda/lib64 -lcuda -lcudart CXX = g++ LD = g++ CXXFLAGS = -O2 -Wall $(INCLUDE) LDFLAGS = -O2 NVCC = nvcc NVCCFLAGS = $(INCLUDE) SRC= $(wildcard *.C) SRCU= $(wildcard *.cu) OBJ= $(SRC:.C=.o) $(SRCU:.cu=.o) EXE = main all: $(EXE) .SUFFIXES: .cu .cu.o: $(NVCC) $(NVCCFLAGS) -c $< -o $@ .C.o: $(CXX) $(CXXFLAGS) -c $< -o $@ main: $(OBJ) $(LD) $(LDFLAGS) $(OBJ) $(LIBS) -o $@ Thank you |
|
March 31, 2014, 20:38 |
|
#2 |
Senior Member
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 18 |
I've only worked with cuda solvers outside of OF but the latest foam-3.0 has a few nvcc compiled linear solvers coupled with it. You might be able to get a few hints on this here:
foam-extend-3.0/src/cudaSolvers/ And the respective Allwmake, Make/options, Make/files Cheers! Kyle |
|
April 4, 2014, 00:05 |
|
#3 |
New Member
Join Date: Dec 2012
Location: Tokyo, Japan
Posts: 5
Rep Power: 13 |
Hi Kyle,
Thanks for your answer!! As you suggested I looked at the foam-extend-3.0 and decided to use it. The installation went well, however when I run the Allwmake.firstInstall I get: Code:
Cuda compiler detected at /opt/cuda/bin/nvcc; cudaSolvers will be compiled by default. $CUDA_ARCH is required by nvcc compiler but not set. Check section '-gpu-architecture' in 'man nvcc' for details. extend-3.0 cuda installation So I will try to look for a solution there. Thanks again, Pierre |
|
April 4, 2014, 14:31 |
|
#4 |
Senior Member
Kyle Mooney
Join Date: Jul 2009
Location: San Francisco, CA USA
Posts: 323
Rep Power: 18 |
Hi Pierre,
Take a look at this file: /foam-extend-3.0/wmake/rules/linux64Gcc/nvcc There you can see how $CUDA_ARCH is actually added to the compiler flags. Maybe you know enough about nvcc compilers such that you know what the env variable is supposed to be set as. Cheers! Kyle |
|
April 7, 2014, 05:57 |
|
#5 |
New Member
Join Date: Dec 2012
Location: Tokyo, Japan
Posts: 5
Rep Power: 13 |
Hi Kyle,
I am sorry for answering so late. In fact I had an issue with my swak4Foam, and, after reinstalling it, Allmake ran without problems. However when after I try to compile the a solver with cuda I got that kind of error : Code:
Found nvcc -- enabling CUDA support. make: *** No rule to make target `fastBiot/fastBiot.dep', needed by `Make/linux64Gcc46DPOpt/dependencies'. Stop. make: *** Waiting for unfinished jobs.... |
|
Tags |
gpu, nvcc, vortex method, wmake |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
The aspect ratio of the volume elements in Finite Volume Method | CharlieTan84 | Main CFD Forum | 3 | August 28, 2012 03:34 |
Control volume based finite difference method? | mukut.medhi | Main CFD Forum | 3 | August 24, 2012 11:01 |
Help regarding implementing the Finite Volume method for meridional flows | shreyasr | Main CFD Forum | 0 | July 23, 2012 08:05 |
Finite Volume Method | cfd seeker | Main CFD Forum | 3 | September 8, 2011 05:36 |
Control Volume Finite Element Method | gerardosrez | Main CFD Forum | 0 | March 16, 2011 15:49 |