<div dir="ltr"><div>Looks like a CUDA thing. Google indicates MPS may help this issue but I had no experience with MPS.<br></div><div>Ye<br></div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">===================<br>
Ye Luo, Ph.D.<br>Computational Science Division & Leadership Computing Facility<br>
Argonne National Laboratory</div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 15, 2021 at 6:03 PM Christopher Daley via Openmp-dev <<a href="mailto:openmp-dev@lists.llvm.org">openmp-dev@lists.llvm.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"><div dir="ltr"><div class="gmail_default" style="font-family:courier new,monospace">Hi all,<br><br>We are trying to use OpenMP target offload in a subprocess and get the following error:<br><br>Target CUDA RTL --> Start initializing CUDA<br>Target CUDA RTL --> Init requires flags to 1<br>Target CUDA RTL --> Getting device 0<br>Target CUDA RTL --> Error returned from cuDeviceGet<br>Target CUDA RTL --> CUDA error is: initialization error<br>Libomptarget error: Device 0 is not ready.<br>Libomptarget error: run with env LIBOMPTARGET_INFO>1 to dump host-target pointer maps<br>Libomptarget error: Build with debug information to provide more informationLibomptarget fatal error 1: failure of target construct while offloading is mandatory<br><br>We are targeting a NVIDIA V100 GPU using a LLVM/Clang-12 build from December. We assume the error is because the CUDA context is started before there has been any OpenMP API calls or directives. How can we use OpenMP offload in the subprocess only? How can we use OpenMP offload in the original process and the subprocess? We have attached a toy code that fails with the message above when defining USE_CHILD_PROCESS. The key code is shown below:<br></div><div class="gmail_default" style="font-family:courier new,monospace"><br></div><div class="gmail_default" style="font-family:courier new,monospace">int main()<br>{<br>  int mypid = fork();<br>  if( 0 == mypid ) {<br>#ifdef USE_CHILD_PROCESS<br>    printf("Calling from child process\n");<br>    cfunc(); // contains OpenMP target offload<br>#endif<br>  } else {<br>#ifndef USE_CHILD_PROCESS<br>    printf("Calling from parent process\n");<br>    cfunc(); // contains OpenMP target offload<br>#endif<br>  }<br>  return 0;<br>}<br></div><div class="gmail_default" style="font-family:courier new,monospace"></div><div class="gmail_default" style="font-family:courier new,monospace"><br>Thanks,<br>Chris</div></div>
_______________________________________________<br>
Openmp-dev mailing list<br>
<a href="mailto:Openmp-dev@lists.llvm.org" target="_blank">Openmp-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev</a><br>
</blockquote></div>