<div dir="ltr">Also, the configure.log has<div><br></div><div>  #define PETSC_HAVE_MPI_GPU_AWARE 1</div><br><div>which says PETSc thinks the GPU support is there.</div><div><br></div><div>  Thanks,</div><div><br></div><div>     Matt</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Tue, Sep 23, 2025 at 1:20 AM Satish Balay <<a href="mailto:balay.anl@fastmail.org">balay.anl@fastmail.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">orte-info output does suggest OpenMPI is built with cuda enabled.<br>
<br>
Are you able to run PETSc examples? What do you get for:<br>
<br>
>>>><br>
balay@petsc-gpu-01:/scratch/balay/petsc/src/snes/tutorials$ make ex19<br>
/scratch/balay/petsc/arch-linux-c-debug/bin/mpicc -fPIC -Wall<br>
-Wwrite-strings -Wno-unknown-pragmas -Wno-lto-type-mismatch<br>
-Wno-stringop-overflow -fstack-protector -fvisibility=hidden -g3 -O0 <br>
-I/scratch/balay/petsc/include<br>
-I/scratch/balay/petsc/arch-linux-c-debug/include<br>
-I/nfs/gce/projects/petsc/soft/u22.04/spack-2024-11-27-cuda/opt/spack/linux-ubuntu22.04-x86_64/gcc-11.4.0/cuda-12.0.1-gy7foq57oi6wzltombtsdy5eqz5gkjgc/include<br>
    -Wl,-export-dynamic ex19.c <br>
-Wl,-rpath,/scratch/balay/petsc/arch-linux-c-debug/lib<br>
-L/scratch/balay/petsc/arch-linux-c-debug/lib<br>
-Wl,-rpath,/nfs/gce/projects/petsc/soft/u22.04/spack-2024-11-27-cuda/opt/spack/linux-ubuntu22.04-x86_64/gcc-11.4.0/cuda-12.0.1-gy7foq57oi6wzltombtsdy5eqz5gkjgc/lib64<br>
-L/nfs/gce/projects/petsc/soft/u22.04/spack-2024-11-27-cuda/opt/spack/linux-ubuntu22.04-x86_64/gcc-11.4.0/cuda-12.0.1-gy7foq57oi6wzltombtsdy5eqz5gkjgc/lib64<br>
-L/nfs/gce/projects/petsc/soft/u22.04/spack-2024-11-27-cuda/opt/spack/linux-ubuntu22.04-x86_64/gcc-11.4.0/cuda-12.0.1-gy7foq57oi6wzltombtsdy5eqz5gkjgc/lib64/stubs<br>
-Wl,-rpath,/scratch/balay/petsc/arch-linux-c-debug/lib<br>
-L/scratch/balay/petsc/arch-linux-c-debug/lib<br>
-Wl,-rpath,/usr/lib/gcc/x86_64-linux-gnu/11<br>
-L/usr/lib/gcc/x86_64-linux-gnu/11 -lpetsc -llapack -lblas -lm -lcudart<br>
-lnvToolsExt -lcufft -lcublas -lcusparse -lcusolver -lcurand -lcuda<br>
-lX11 -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi<br>
-lgfortran -lm -lgfortran -lm -lgcc_s -lquadmath -lstdc++ -o ex19<br>
balay@petsc-gpu-01:/scratch/balay/petsc/src/snes/tutorials$ ./ex19 -snes_monitor -dm_mat_type seqaijcusparse -dm_vec_type seqcuda -pc_type gamg -pc_gamg_esteig_ksp_max_it 10 -ksp_monitor -mg_levels_ksp_max_it 3 <br>
lid velocity = 0.0625, prandtl # = 1., grashof # = 1.<br>
  0 SNES Function norm 2.391552133017e-01 <br>
    0 KSP Residual norm 2.013462697105e-01 <br>
    1 KSP Residual norm 5.027022294231e-02 <br>
    2 KSP Residual norm 7.248258907839e-03 <br>
    3 KSP Residual norm 8.590847505363e-04 <br>
    4 KSP Residual norm 1.511762118013e-05 <br>
    5 KSP Residual norm 1.410585959219e-06 <br>
  1 SNES Function norm 6.812362089434e-05 <br>
    0 KSP Residual norm 2.315252918142e-05 <br>
    1 KSP Residual norm 2.351994603807e-06 <br>
    2 KSP Residual norm 3.882072626158e-07 <br>
    3 KSP Residual norm 2.227447016095e-08 <br>
    4 KSP Residual norm 2.200353394658e-09 <br>
    5 KSP Residual norm 1.147903850265e-10 <br>
  2 SNES Function norm 3.411489611752e-10 <br>
Number of SNES iterations = 2<br>
balay@petsc-gpu-01:/scratch/balay/petsc/src/snes/tutorials$ <br>
<<<<<br>
<br>
So what issue are you seeing with your code? And does it go away with the option: "-use_gpu_aware_mpi 0"? for example:<br>
<br>
>>>><br>
balay@petsc-gpu-01:/scratch/balay/petsc/src/snes/tutorials$ ./ex19 -snes_monitor -dm_mat_type seqaijcusparse -dm_vec_type seqcuda -pc_type gamg -pc_gamg_esteig_ksp_max_it 10 -ksp_monitor -mg_levels_ksp_max_it 3 -use_gpu_aware_mpi 0<br>
lid velocity = 0.0625, prandtl # = 1., grashof # = 1.<br>
  0 SNES Function norm 2.391552133017e-01 <br>
    0 KSP Residual norm 2.013462697105e-01 <br>
    1 KSP Residual norm 5.027022294231e-02 <br>
    2 KSP Residual norm 7.248258907839e-03 <br>
    3 KSP Residual norm 8.590847505363e-04 <br>
    4 KSP Residual norm 1.511762118013e-05 <br>
    5 KSP Residual norm 1.410585959219e-06 <br>
  1 SNES Function norm 6.812362089434e-05 <br>
    0 KSP Residual norm 2.315252918142e-05 <br>
    1 KSP Residual norm 2.351994603807e-06 <br>
    2 KSP Residual norm 3.882072626158e-07 <br>
    3 KSP Residual norm 2.227447016095e-08 <br>
    4 KSP Residual norm 2.200353394658e-09 <br>
    5 KSP Residual norm 1.147903850265e-10 <br>
  2 SNES Function norm 3.411489611752e-10 <br>
Number of SNES iterations = 2<br>
balay@petsc-gpu-01:/scratch/balay/petsc/src/snes/tutorials$ <br>
<<<<<br>
<br>
Satish<br>
<br>
On Tue, 23 Sep 2025, 岳新海 wrote:<br>
<br>
> I get:<br>
> [mae_yuexh@login01 ~]$ orte-info |grep 'MCA btl'<br>
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MCA btl: smcuda (MCA v2.1, API v3.1, Component v4.1.5)<br>
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MCA btl: tcp (MCA v2.1, API v3.1, Component v4.1.5)<br>
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MCA btl: self (MCA v2.1, API v3.1, Component v4.1.5)<br>
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;MCA btl: vader (MCA v2.1, API v3.1, Component v4.1.5)<br>
> <br>
> <br>
> <br>
> Xinhai<br>
> <br>
> <br>
> <br>
> <br>
> <br>
> 岳新海<br>
> <br>
> <br>
> <br>
> 南方科技大学/学生/研究生/2023级研究生<br>
> <br>
> <br>
> <br>
> 广东省深圳市南山区学苑大道1088号<br>
> <br>
> <br>
> <br>
> <br>
> &nbsp;<br>
> &nbsp;<br>
> &nbsp;<br>
> ------------------&nbsp;Original&nbsp;------------------<br>
> From: &nbsp;"Satish&nbsp;Balay"<<a href="mailto:balay.anl@fastmail.org" target="_blank">balay.anl@fastmail.org</a>&gt;;<br>
> Date: &nbsp;Tue, Sep 23, 2025 03:25 AM<br>
> To: &nbsp;"岳新海"<<a href="mailto:12332508@mail.sustech.edu.cn" target="_blank">12332508@mail.sustech.edu.cn</a>&gt;; <br>
> Cc: &nbsp;"petsc-dev"<<a href="mailto:petsc-dev@mcs.anl.gov" target="_blank">petsc-dev@mcs.anl.gov</a>&gt;; <br>
> Subject: &nbsp;Re: [petsc-dev] Question on PETSc + CUDA configuration with MPI on  cluster<br>
> <br>
> &nbsp;<br>
> <br>
>  <br>
> What&nbsp;do&nbsp;you&nbsp;get&nbsp;for&nbsp;(with&nbsp;your&nbsp;openmpi&nbsp;install)&nbsp;:orte-info&nbsp;|grep&nbsp;'MCA&nbsp;btl'<br>
> <br>
> With&nbsp;cuda&nbsp;built&nbsp;openmpi&nbsp;-&nbsp;I&nbsp;get:<br>
> balay@petsc-gpu-01:/scratch/balay/petsc$&nbsp;./arch-linux-c-debug/bin/orte-info&nbsp;|grep&nbsp;'MCA&nbsp;btl'<br>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MCA&nbsp;btl:&nbsp;smcuda&nbsp;(MCA&nbsp;v2.1,&nbsp;API&nbsp;v3.1,&nbsp;Component&nbsp;v4.1.6)<br>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MCA&nbsp;btl:&nbsp;openib&nbsp;(MCA&nbsp;v2.1,&nbsp;API&nbsp;v3.1,&nbsp;Component&nbsp;v4.1.6)<br>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MCA&nbsp;btl:&nbsp;self&nbsp;(MCA&nbsp;v2.1,&nbsp;API&nbsp;v3.1,&nbsp;Component&nbsp;v4.1.6)<br>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MCA&nbsp;btl:&nbsp;tcp&nbsp;(MCA&nbsp;v2.1,&nbsp;API&nbsp;v3.1,&nbsp;Component&nbsp;v4.1.6)<br>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MCA&nbsp;btl:&nbsp;vader&nbsp;(MCA&nbsp;v2.1,&nbsp;API&nbsp;v3.1,&nbsp;Component&nbsp;v4.1.6)<br>
> <br>
> And&nbsp;without&nbsp;cuda:<br>
> balay@petsc-gpu-01:/scratch/balay/petsc.x$&nbsp;./arch-test/bin/orte-info&nbsp;&nbsp;|&nbsp;grep&nbsp;'MCA&nbsp;btl'<br>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MCA&nbsp;btl:&nbsp;openib&nbsp;(MCA&nbsp;v2.1,&nbsp;API&nbsp;v3.1,&nbsp;Component&nbsp;v4.1.6)<br>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MCA&nbsp;btl:&nbsp;self&nbsp;(MCA&nbsp;v2.1,&nbsp;API&nbsp;v3.1,&nbsp;Component&nbsp;v4.1.6)<br>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MCA&nbsp;btl:&nbsp;tcp&nbsp;(MCA&nbsp;v2.1,&nbsp;API&nbsp;v3.1,&nbsp;Component&nbsp;v4.1.6)<br>
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MCA&nbsp;btl:&nbsp;vader&nbsp;(MCA&nbsp;v2.1,&nbsp;API&nbsp;v3.1,&nbsp;Component&nbsp;v4.1.6)<br>
> <br>
> i.e&nbsp;"smcuda"&nbsp;should&nbsp;be&nbsp;listed&nbsp;for&nbsp;a&nbsp;cuda&nbsp;enabled&nbsp;openmpi.<br>
> <br>
> Its&nbsp;not&nbsp;clear&nbsp;if&nbsp;GPU-aware&nbsp;MPI&nbsp;makes&nbsp;a&nbsp;difference&nbsp;for&nbsp;all&nbsp;MPI&nbsp;impls&nbsp;(or&nbsp;versions)&nbsp;-&nbsp;so&nbsp;good&nbsp;to&nbsp;verify.&nbsp;[its&nbsp;a&nbsp;performance&nbsp;issue&nbsp;anyway&nbsp;-&nbsp;so&nbsp;primarily&nbsp;useful&nbsp;when&nbsp;performing&nbsp;timing&nbsp;measurements]<br>
> <br>
> Satish<br>
> <br>
> On&nbsp;Mon,&nbsp;22&nbsp;Sep&nbsp;2025,&nbsp;岳新海&nbsp;wrote:<br>
> <br>
> &gt;&nbsp;Dear&nbsp;PETSc&nbsp;Team,<br>
> &gt;&nbsp;&nbsp;<br>
> &gt;&nbsp;I&nbsp;am&nbsp;encountering&nbsp;an&nbsp;issue&nbsp;when&nbsp;running&nbsp;PETSc&nbsp;with&nbsp;CUDA&nbsp;support&nbsp;on&nbsp;a&nbsp;cluster.&nbsp;When&nbsp;I&nbsp;set&nbsp;the&nbsp;vector&nbsp;type&nbsp;to&nbsp;VECCUDA,&nbsp;PETSc&nbsp;reports&nbsp;that&nbsp;my&nbsp;MPI&nbsp;is&nbsp;not&nbsp;GPU-aware.&nbsp;However,&nbsp;the&nbsp;MPI&nbsp;library&nbsp;(OpenMPI&nbsp;4.1.5)&nbsp;I&nbsp;used&nbsp;to&nbsp;configure&nbsp;PETSc&nbsp;was&nbsp;built&nbsp;with&nbsp;the&nbsp;--with-cuda&nbsp;option&nbsp;enabled.<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;Here&nbsp;are&nbsp;some&nbsp;details:<br>
> &gt;&nbsp;PETSc&nbsp;version:&nbsp;3.20.6<br>
> &gt;&nbsp;MPI:&nbsp;OpenMPI&nbsp;4.1.5,&nbsp;configured&nbsp;with&nbsp;--with-cuda<br>
> &gt;&nbsp;GPU:&nbsp;RTX3090<br>
> &gt;&nbsp;CUDA&nbsp;version:&nbsp;12.1&nbsp;<br>
> &gt;&nbsp;I&nbsp;have&nbsp;attached&nbsp;both&nbsp;my&nbsp;PETSc&nbsp;configure&nbsp;command&nbsp;and&nbsp;OpenMPI&nbsp;configure&nbsp;command&nbsp;for&nbsp;reference.<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;My&nbsp;questions&nbsp;are:<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;&nbsp;<br>
> &gt;&nbsp;&nbsp;<br>
> &gt;&nbsp;&nbsp;<br>
> &gt;&nbsp;Even&nbsp;though&nbsp;I&nbsp;enabled&nbsp;--with-cuda&nbsp;in&nbsp;OpenMPI,&nbsp;why&nbsp;does&nbsp;PETSc&nbsp;still&nbsp;report&nbsp;that&nbsp;MPI&nbsp;is&nbsp;not&nbsp;GPU-aware?<br>
> &gt;&nbsp;&nbsp;<br>
> &gt;&nbsp;&nbsp;<br>
> &gt;&nbsp;&nbsp;<br>
> &gt;&nbsp;Are&nbsp;there&nbsp;additional&nbsp;steps&nbsp;or&nbsp;specific&nbsp;configuration&nbsp;flags&nbsp;required&nbsp;(either&nbsp;in&nbsp;OpenMPI&nbsp;or&nbsp;PETSc)&nbsp;to&nbsp;ensure&nbsp;GPU-aware&nbsp;MPI&nbsp;is&nbsp;correctly&nbsp;detected?<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;Any&nbsp;guidance&nbsp;or&nbsp;suggestions&nbsp;would&nbsp;be&nbsp;greatly&nbsp;appreciated.<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;&nbsp;<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;Best&nbsp;regards,<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;Xinhai&nbsp;Yue<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;&nbsp;<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;岳新海<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;南方科技大学/学生/研究生/2023级研究生<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;广东省深圳市南山区学苑大道1088号<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;<br>
> &gt;&nbsp;&nbsp;</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!cdM21c-7ReRi2XQTPS6YvfilWnEw4nUkPb1NxGBgs3JvVOaKitEMUhroNxRlbKSqRNErzlAPkMZW22UEHKIh$" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div>