SimFlowCFD / RapidCFD-dev

RapidCFD is an OpenFOAM fork running fully on CUDA platform. Brought to you by
https://sim-flow.com
Other
317 stars 93 forks source link

Compilation error Ubuntu 16.04 #34

Open Samos2b opened 6 years ago

Samos2b commented 6 years ago

Hello everyone,

I would like to compile RCFD on Ubuntu 16.04 with CUDA 8.0 and gcc 5.4.0 but I'm facing the following error when running ./Allwmake :

/usr/include/string.h: In function ‘void __mempcpy_inline(void, const void, size_t)’: /usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope return (char ) memcpy (dest, src, n) + n;

Does anyone was facing this error before?

Regards.

Anthony.

Samos2b commented 6 years ago

Hello here,

anybody has an idea about my issue?

Regards.

Anthony

Juradox commented 6 years ago

https://www.cfd-online.com/Forums/openfoam-installation/67333-git-installation-1-6-a.html

on this thread i found an answer for that issue that consisted in installing "flex" (type flex in a terminal and it will tell you the command to install it). However i still have issue to compile so I don't know if it will be enough.

Samos2b commented 6 years ago

Hello there,

I'm opening this post again because I'm facing another issue when trying to use RCFD on Kubuntu 16.04.

I finally Manage to compile RCFD with the new Ubuntu 16.04 instructions (thanks for that btw!), however, when I try to run the Cavity tutorial case be running the icoFoam command, my program get stuck a the very beginning : /---------------------------------------------------------------------------\ | RapidCFD by simFlow (sim-flow.com) | *---------------------------------------------------------------------------*/ Build : dev Exec : icoFoam -device 0 Date : Apr 06 2018 Time : 20:13:38 Host : "anthony-Linux-Desktop" PID : 22937 Case : /home/anthony/Documents/cavity nProcs : 1 sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster allowSystemOperations : Allowing user-supplied system call operations

// * //

Nothing happen after this line.

I did several verifications to make sure my CUDA 8.0 was installed correctly, and I executed the Post-Installation instruction as described in CUDA installation guide. I compiled the examples provided by Nvidia and they run correctly, so my graphic card is detected, communicates and executes CUDA properly.

Any idea what I did wrong in the installation?

My installation folder is located in /opt/RapidCFD for which I have the permission to read/write/execute, I got a GeForce GTX 1070 running on Kubuntu 16.04.

Thanks for your time.

Anthony.

Juradox commented 6 years ago

Well try the following :

file:

After installation of cuda 8.0 add in bashrc

export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

2) Install Flex

sudo apt-get install flex

3) Change the file in rapidCFD

$Home/RapidCFD/RapidCFD-dev/src/triSurface/triSurface/interfaces/STL/readSTLASCII.L#L58 $Home/RapidCFD/RapidCFD-dev/src/surfMesh/surfaceFormats/stl/STLsurfaceFormatASCII.L#L53

from

if YY_FLEX_SUBMINOR_VERSION < 34

to

if YY_FLEX_MINOR_VERSION < 6 && YY_FLEX_SUBMINOR_VERSION < 34

4) Change the architecture to adapt it to your graphic card ( Compute Capacity)

aller dansRapidCFD/RapidCFD-dev/wmake/rules/linux64Nvcc ouvrir C et C++ et changer CC = nvcc -Xptxas -dlcm=cg -m64 -arch=sm_30 en CC = nvcc -Xptxas -dlcm=cg -m64 -arch=sm_61 (maybe yours is not 61 check it)

4) Install libz-dev

sudo apt-get install libz-dev

Then run again the installation, it worked for me, hope it will for you. But this just the install, I never managed to have a computation working . . . I have another issue than the one you have, i go a bit further haha.

Tell me if you managed to make it worked, good luck.

Samos2b commented 6 years ago

Dear Juradox,

Thanks for the tips, I'm compiling again RCFD with your modification. I will keep you in touch for the result.

I'm pretty sure the issue comes from step 4 because the others points were already ok.

Regards.

Samos2b commented 6 years ago

Here an update.

Thanks for the tips, the program seems to load.

However I'm facing with an "illegal memory access" issue (maybe same as you)

/---------------------------------------------------------------------------\ | RapidCFD by simFlow (sim-flow.com) | *---------------------------------------------------------------------------*/ Build : dev Exec : icoFoam Date : Apr 07 2018 Time : 10:33:24 Host : "anthony-Linux-Desktop"
PID : 21177
Case : /home/anthony/Documents/cavity
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

// * //
Create time

Create mesh for time = 0

Reading transportProperties

Reading field p

Reading field U

Reading/calculating face flux field phi

Starting time loop

Time = 0.005

Courant Number mean: 0 max: 0
terminate called after throwing an instance of 'thrust::system::system_error'
what(): cudaEventSynchronize in future::wait: an illegal memory access was encountered

I'm gonna investigate about that and let you further update.

Regards

Juradox commented 6 years ago

Unfortunately, I can't help you beyond this point since I have the same issue I can't solve...

If you want here is the mail of the creator of rapidCF D" daniel.jasinski@gmail.com ". He helped me to have it worked to this point but he did not answered my last e mail and I don't want to harass him too much.

So if you wanna try to ask him and see if you manage to have it worked with his help.

Samos2b commented 6 years ago

I tried to run cuda-memcheck on icoFoam solver to look in what file the problem appear.

Here the first result the program returns : ========= Invalid global read of size 8 ========= at 0x00000308 in /usr/local/cuda-8.0/bin/../targets/x86_64-linux/include/sm_32intrinsics.hpp:137:void thrust::system::cuda::detail::bulk::detail::launch_byvalue<unsigned int=0, thrust::system::cuda::detail::bulk::detail::cudatask<thrust::system::cuda::detail::bulk::parallelgroup<thrust::system::cuda::detail::bulk::concurrentgroup<thrust::system::cuda::detail::bulk::agent, unsigned long=0>, unsigned long=0>, thrust::system::cuda::detail::bulk_::detail::closure<thrust::system::cuda::detail::for_each_n_detail::for_eachkernel, thrust::tuple<thrust::system::cuda::detail::bulk::detail::cursor, thrust::zip_iterator<thrust::tuple<thrust::counting_iterator<int, thrust::use_default, thrust::use_default, thrust::use_default>, thrust::detail::normal_iterator<thrust::device_ptr>, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type, thrust::null_type>>, thrust::detail::wrappedfunction<thrust::detail::unary ========= by thread (398,0,0) in block (0,0,0) ========= Address 0x00000c78 is out of bounds ========= Saved host backtrace up to driver entry point at kernel launch time ========= Host Frame:/usr/lib/x86_64-linux-gnu/libcuda.so.1 (cuLaunchKernel + 0x2cd) [0x23ce3d] ========= Host Frame:/usr/local/cuda-8.0/lib64/libcudart.so.8.0 [0xd23d] ========= Host Frame:/usr/local/cuda-8.0/lib64/libcudart.so.8.0 (cudaLaunch + 0x143) [0x33783] ========= Host Frame:/opt/RapidCFD/RapidCFD-dev/platforms/linux64NvccDPOpt/lib/libOpenFOAM.so (_ZN6thrust6system4cuda6detail5bulk_6detail13cuda_launcherINS3_14parallel_groupINS3_16concurrent_groupINS3_5agentILm1EEELm0EEELm0EEENS4_7closureINS2_17for_each_n_detail15for_each_kernelENS_5tupleINS4_6cursorILj0EEENS_12zip_iteratorINSF_INS_17counting_iteratorIiNS_11use_defaultESK_SK_EENS_6detail15normal_iteratorINS_10device_ptrIdEEEENS_9null_typeESR_SR_SR_SR_SR_SR_SR_EEEENSM_16wrapped_functionINSM_23unary_transform_functorIN4Foam21matrixMultiplyFunctorILb1ELi3EEEEEvEEjSR_SR_SR_SR_SR_SR_EEEEE6launchESB_S12_P11CUstream_st + 0x4e8) [0x56a678] ========= Host Frame:/opt/RapidCFD/RapidCFD-dev/platforms/linux64NvccDPOpt/lib/libOpenFOAM.so (_ZN4Foam12callMultiplyILb1EEEvRNS_8gpuFieldIdEERKS2_RKNS_7gpuListIiEES9_S9_S9_S9_S5_S5S5 + 0x5ad) [0x56b18d] ========= Host Frame:/opt/RapidCFD/RapidCFD-dev/platforms/linux64NvccDPOpt/lib/libOpenFOAM.so (_ZNK4Foam9lduMatrix4AmulERNS_8gpuFieldIdEERKNS_3tmpIS2_EERKNS_10FieldFieldIS1_dEERKNS_8UPtrListIKNS_17lduInterfaceFieldEEEh + 0x13c) [0x560fec] ========= Host Frame:/opt/RapidCFD/RapidCFD-dev/platforms/linux64NvccDPOpt/lib/libOpenFOAM.so (_ZNK4Foam5PBiCG5solveERNS_8gpuFieldIdEERKS2_h + 0x3f2) [0x580522] ========= Host Frame:icoFoam [0x904e8] ========= Host Frame:icoFoam [0xa67f1] ========= Host Frame:icoFoam [0xa6a6b] ========= Host Frame:icoFoam [0x41122] ========= Host Frame:/lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main + 0xf0) [0x20830] ========= Host Frame:icoFoam [0x440b9]

I know it's difficult to read but I found something weird that maybe can help.

I'm really not an expert in general programing or CUDA, sorry for that.

Regards.

Juradox commented 6 years ago

Well, I'm sorry but I'm not an expert at Cuda either, I tried solutions with my poor knowledge but it never worked . . . I don't know how i can help any further, sorry.

IF you manage to have it working, could you tell me how you did ?

daniel-jasinski commented 6 years ago

Hello,

There is optimization switch in file etc/controlDict. Could you set this switch to 0 and run the simulation again?

Daniel

Samos2b commented 6 years ago

Hello Daniel,

Thanks for your time.

I set the favourSpeedOverMemory switch to 0 and run the simulation again as you suggested but it changed nothing.

Anthony.