Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPM FLOW - GPU ACELERATION #5452

Open
EnriqueRamonV opened this issue Jun 27, 2024 · 1 comment
Open

OPM FLOW - GPU ACELERATION #5452

EnriqueRamonV opened this issue Jun 27, 2024 · 1 comment

Comments

@EnriqueRamonV
Copy link

I am a user of OPM Flow and am interested in optimizing its performance by utilizing the GPU in my system. Could you please confirm if it's possible to activate GPU acceleration for calculations in OPM Flow, and how I can do so? Are there specific settings within the software that I need to adjust?
I appreciate any guidance or additional documentation you can provide on this matter.

Best regards,
Enrique Ramon

@multitalentloes
Copy link

multitalentloes commented Jul 9, 2024

It is possible both for Nvidia and AMD cards, but note that only parts of the simulator is currently gpu-accelerated. In addition to this, there is no guarantee that running a simulation on your GPU will be faster. As of now you typically need a quite large simulation for GPUs to be faster, and hard simulation cases are usually also better on CPU because more fancy numerical algorithms have been implemented.

The main part of OPM currently supported by GPUs is the linear solver. So to make sure I run my simulation with a GPU I provide a json file that describes the linear solver using the --linear-solver=/path/to/file.json option. The json may look something like this:

{
   "tol": "0.01",
   "maxiter": "200",
   "verbosity": "0",
   "solver": "gpubicgstab",
   "preconditioner": {
       "type": "GPUDILU"
   }
}

Here the important part is to set the solver to "gpubicgstab", which is a conjugate gradient method.
You should also select a preconditioner, right now probably "GPUDILU", or "OPMCUILU0".

I know there are other ways to run OPM with GPUs, for instance through the BDA bridge, but I am not very familiar with how to do that.

Note that for the preconditioners to be found OPM must be built with CUDA available if you want to run on an Nvidia GPU, and built with HIP available + CONVERT_CUDA_TO_HIP=ON to make cmake generate the equivalent HIP code that can be run on AMD GPUs.

Feel free to ask more questions if this is still unclear:)

Edit: if your version of opm is older than september 2024 then the solver should be called cubicgstab and the preconditioners should typically start with "CU" instead of "GPU"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants