About EDEM API tutorial in linux and GPU solver conversion

I have several packed dll about 'custom factory', 'custom particle body force' and 'custom contact model', also have the corresponding visutalstudio2017 header files.
How can I transfer them into linux .so document, and make them avalible for GPU solver? How does the packing works? and how do I compile .cu files?
I know there are several tutorial exists, but they are hard to follow because they are vague. It would be really helpful if there's step by step video tutorial.
Thanks
Qin
Answers
-
Hi Qin,
Please find the attached document the steps to convert dll to .so (Linux supported format) is explained from page-12 .
Hope this helps.
Thanks,
Prasad A
0 -
Yes, but how can I compile my own .cl document? or can I use same .cl for every compile?
0 -
.cl file is a GPU compatibility file if you convert to linux it supports GPU.
I suggest please go through the document and compile the steps, the attached document explains the detailed steps
0 -
Yes, but how can I compile my own .cl document? or can I use same .cl for every compile?
This question is not answered in pdf.
0 -
Please compile and check it should work, if it is not working please share the error message.
0 -
Hi , as Prasad mentions you don't need to compile the CUDA specific file. There is an overview video on EDEM GPU API here:
it's part of a series, part 1 is here:
0 -
Above is cpp for dll, while below is confinement.cu
they are both in "C:\Users\a1312\OneDrive\Documents\Altair\EDEM2024\ParticleBodyForce", but EDEM still recognize it as cpu only document
0 -
I updated cu, still didn't work
0 -
Hi, do the file names match? You are defining the name of the .cu file in the CPU code under "GPU_FILENAME" , this name should match the name of the .cu file you have.
Regards
Stephen
0 -
the names are
confinement.dll
confinement.cu
0 -
Hi,
Just to confirm did you change the code here "wtf" should read "confinement" as this is the name of the GPU file you are reading. You will have to recompile the CPU code afterwards to make sure this change is applied in the new model.
0 -
The model is still cpu only after I change "wtf" into "confinement"
0 -
#ifndef CUDACC
#include "cudaApiCore.cuh"
#include "apiConstants.cuh"
#include "CApiContact.cuh"
#include "CApiContactResults.cuh"
#include "CApiCustomPropertyData.cuh"
#include "CApiElement.cuh"
#include "CApiFieldData.cuh"
#include "CApiInteraction.cuh"
#include "CApiParticle.cuh"
#include "CApiSimulation.cuh"
#include "CApiTotalForce.cuh"
#include "CApiGeomTriangleInfo.cuh"
#include "CApiTriangleDeformationResult.cuh"
#include "CMat3x3.cuh"
#include "CQuaternion.cuh"
#include "CUtilitiesEquations.cuh"
#include "CUtilitiesMath.cuh"
#include "CUtilitiesPrecision.cuh"
#include "CVec3.cuh"
#endifI found another tutorial have such include document, where can I find the menu of including requirement
0 -
or maybe it is not recognized because I didn't add starting() and all other functions in cpp?
0 -
still didn't work
0 -
Hi,
I would make sure the version of the code you are using is all up to date with your installed version
The detailed API documentation is in C:\Program Files\Altair\2024.1\EDEM\src\Api\Help > index.html (or your installed location) which gives all the functions. Starting runs some code on pressing play in the Simulator, it is not needed as standard but can be useful in some cases.
0 -
the error is so weird, obviously I already defined GETFINTERFACE, but it still happens
0 -
I solved the CUDA problem by adding a empty preference file function, it is necessary.
But not I couldn't find header files' location in linux server.
0 -
Hi, the folder structure for the header files is the same on Windows and Linux, but the default install location for the software may be different. If you have the altair isntall folder you can find then the header files in /version number/edem//src/Api
The files are the same on Windows and Linux, so you can just copy the required header files for the API from your windows install to the Linux machine if it's easier.
RegardsStephen
0 -
yes, it's inside linux_apps folder, with similar directory.
And I found another error in help document, it should be g++ instead of gcc, to compile .so correctly.
And \
-I
is necessary for linux terminal, but the tutorial didn't mention about "\"
Q
0