About EDEM API tutorial in linux and GPU solver conversion

User: "QinHe_321"
Altair Community Member

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

Find more posts tagged with

Sort by:
1 - 20 of 201

    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

    User: "QinHe_321"
    Altair Community Member
    OP

    Yes, but how can I compile my own .cl document? or can I use same .cl for every compile?

    .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

    User: "QinHe_321"
    Altair Community Member
    OP

    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.

    Please compile and check it should work, if it is not working please share the error message.

    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:

    User: "QinHe_321"
    Altair Community Member
    OP
    image.png image.png image.png image.png

    Above is cpp for dll, while below is confinement.cu

    image.png

    they are both in "C:\Users\a1312\OneDrive\Documents\Altair\EDEM2024\ParticleBodyForce", but EDEM still recognize it as cpu only document

    User: "QinHe_321"
    Altair Community Member
    OP
    image.png

    I updated cu, still didn't work

    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

    User: "QinHe_321"
    Altair Community Member
    OP

    the names are

    confinement.dll

    confinement.cu

    User: "Stephen Cole"
    Altair Employee
    Updated by Stephen Cole

    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.

    image.png
    User: "QinHe_321"
    Altair Community Member
    OP

    The model is still cpu only after I change "wtf" into "confinement"

    User: "QinHe_321"
    Altair Community Member
    OP

    #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"
    #endif

    I found another tutorial have such include document, where can I find the menu of including requirement

    User: "QinHe_321"
    Altair Community Member
    OP

    or maybe it is not recognized because I didn't add starting() and all other functions in cpp?

    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.

    User: "QinHe_321"
    Altair Community Member
    OP
    image.png image.png image.png image.png image.png image.png image.png

    the error is so weird, obviously I already defined GETFINTERFACE, but it still happens

    User: "QinHe_321"
    Altair Community Member
    OP

    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.

    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.


    Regards

    Stephen

    User: "QinHe_321"
    Altair Community Member
    OP

    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