<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Hi Junchao,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Thanks for your reply. I will try that. If I have any issues, I will come back to this thread.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Thanks,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Feng</div>
<hr style="display: inline-block; width: 98%;">
<div id="divRplyFwdMsg">
<div style="direction: ltr; font-family: Calibri, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<b>From:</b> Junchao Zhang <junchao.zhang@gmail.com><br>
<b>Sent:</b> 09 February 2026 23:18<br>
<b>To:</b> feng wang <snailsoar@hotmail.com><br>
<b>Cc:</b> petsc-users@mcs.anl.gov <petsc-users@mcs.anl.gov><br>
<b>Subject:</b> Re: [petsc-users] Port existing GMRES+ILU(0) implementation to GPU</div>
<div style="direction: ltr;"> </div>
</div>
<div style="direction: ltr;">Hi Feng,<br>
At the first step, you don't need to change your CPU implementation. Then do profiling to see where it is worth putting your effort. Maybe you need to assemble your matrices and vectors on GPUs too, but decide that at a later stage. <br>
</div>
<div style="direction: ltr;"> Thanks!</div>
<div style="direction: ltr;">--Junchao Zhang</div>
<div style="direction: ltr;"><br>
</div>
<div><br>
</div>
<div style="direction: ltr;">On Mon, Feb 9, 2026 at 4:31 PM feng wang <<a class="OWAAutoLink" id="OWAa70303c2-6824-9a2b-d05e-7ee7783c4300" href="mailto:snailsoar@hotmail.com">snailsoar@hotmail.com</a>> wrote:</div>
<blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left: 1px solid rgb(204, 204, 204);">
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Junchao,</div>
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Many thanks for your reply.</div>
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
This is great! Do I need to change anything for my current CPU implementation? or I just link to a version of Petsc that is configured with cuda and make sure the necessary data are copied to the "device", then Petsc will do the rest magic for me?</div>
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks,</div>
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Feng</div>
<hr style="direction: ltr; display: inline-block; width: 98%;">
<div id="x_m_-6845830625879680973divRplyFwdMsg">
<div style="direction: ltr; font-family: Calibri, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<b>From:</b> Junchao Zhang <<a class="OWAAutoLink" id="OWA1042c31b-c7de-d60a-9844-a1d38d83e76e" href="mailto:junchao.zhang@gmail.com">junchao.zhang@gmail.com</a>><br>
<b>Sent:</b> 09 February 2026 1:55<br>
<b>To:</b> feng wang <<a class="OWAAutoLink" id="OWAbd8c9ebc-f97a-b538-3ff2-4d98abb667ff" href="mailto:snailsoar@hotmail.com">snailsoar@hotmail.com</a>><br>
<b>Cc:</b> <a class="OWAAutoLink" id="OWA608c87c1-fd1e-2a08-e7d0-be2da0294067" href="mailto:petsc-users@mcs.anl.gov">
petsc-users@mcs.anl.gov</a> <<a class="OWAAutoLink" id="OWAeb8a4500-dcf1-c868-5547-f99019ed7d81" href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>><br>
<b>Subject:</b> Re: [petsc-users] Port existing GMRES+ILU(0) implementation to GPU</div>
<div style="direction: ltr;"> </div>
</div>
<div style="direction: ltr;">Hello Feng,<br>
It is possible to run GMRES with ILU(0) on GPUs. You may need to configure PETSc with CUDA (--with-cuda --with-cudac=nvcc) or Kokkos (with extra --download-kokkos --download-kokkos-kernels). Then run with -mat_type {aijcusparse or aijkokkos} -vec_type
{cuda or kokkos}.<br>
But triangular solve is not GPU friendly and the performance might be poor. But you should try it, I think. <br>
<br>
Thanks!<br>
--Junchao Zhang</div>
<div style="direction: ltr;"><br>
</div>
<div style="direction: ltr;">On Sun, Feb 8, 2026 at 5:46 PM feng wang <<a class="OWAAutoLink" id="OWA9e4f3c5e-233c-2b53-611b-02376774ffc9" href="mailto:snailsoar@hotmail.com">snailsoar@hotmail.com</a>> wrote:</div>
<blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left: 1px solid rgb(204, 204, 204);">
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Dear All,</div>
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I have an existing implementation of GMRES with ILU(0), it works well for cpu now. I went through the Petsc documentation, it seems Petsc has some support for GPUs. is it possible for me to run GMRES with ILU(0) in GPUs?</div>
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Many thanks for your help in advance,</div>
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Feng</div>
</blockquote>
</blockquote>
</body>
</html>