# Nvidia GPU Segmentation fault with OpenCL

**URL:** <https://pyfr.discourse.group/t/nvidia-gpu-segmentation-fault-with-opencl/728>\
**Category:** Errors\
**Created:** [27 December 2022 10:35 UTC](https://pyfr.discourse.group/t/nvidia-gpu-segmentation-fault-with-opencl/728 "2022-12-27T10:35:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yujif1Aero](https://yyz2.discourse-cdn.com/free1/user_avatar/pyfr.discourse.group/yujif1aero/32/448_2.png) [@Yujif1Aero](https://pyfr.discourse.group/u/Yujif1Aero)\
**Post date:** [27 December 2022 10:35 UTC](https://pyfr.discourse.group/t/nvidia-gpu-segmentation-fault-with-opencl/728/1 "2022-12-27T10:35:17Z")

</div>

Dear all,

Hi I am Yuji. I have a question and a problem.

[Question]  
In terms of pyfr run, I put $pyfr run -b openmp -p 2d-inc-cylinder.pyfrm 2d-inc-cylinder.ini.  
I found ,however, GPUs are not working. Openmp option only uses CPUs?

[Problem]  
I am testing the 2D Cylinder Flow in the examples that are on your website([Examples — Documentation](https://pyfr.readthedocs.io/en/latest/examples.html)).  
I put this command  
$pyfr run -b opencl -p 2d-inc-cylinder.pyfrm 2d-inc-cylinder\_opencl.ini

However it got “core dumped”

```bash
$ pyfr run -b opencl -p 2d-inc-cylinder.pyfrm 2d-inc-cylinder_opencl.ini
Authorization required, but no authorization protocol specified
Authorization required, but no authorization protocol specified
Authorization required, but no authorization protocol specified
 100.0% [=========================================================================>] 75.00/75.00 ela: 00:06:33 rem: 00:00:00
[g262:29629] ***Process received signal***
[g262:29629] Signal: Segmentation fault (11)
[g262:29629] Signal code: Address not mapped (1)
[g262:29629] Failing at address: 0x8
[g262:29629] [0] /lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x7f6ec8afa520]
[g262:29629] [1] /lib/x86_64-linux-gnu/libnvidia-opencl.so.1(+0xe9bac)[0x7f6eb94f9bac]
[g262:29629] [2] /lib/x86_64-linux-gnu/libnvidia-opencl.so.1(+0xd6e48)[0x7f6eb94e6e48]
[g262:29629] [3] /lib/x86_64-linux-gnu/libnvidia-opencl.so.1(+0xd7b6b)[0x7f6eb94e7b6b]
[g262:29629] [4] /lib/x86_64-linux-gnu/libnvidia-opencl.so.1(+0xe0a89)[0x7f6eb94f0a89]
[g262:29629] [5] /lib/x86_64-linux-gnu/libffi.so.8(+0x7e2e)[0x7f6ec8553e2e]
[g262:29629] [6] /lib/x86_64-linux-gnu/libffi.so.8(+0x4493)[0x7f6ec8550493]
[g262:29629] [7] /usr/lib/python3.10/lib-dynload/_ctypes.cpython-310-x86_64-linux-gnu.so(+0xa451)[0x7f6ec82a3451]
[g262:29629] [8] /usr/lib/python3.10/lib-dynload/_ctypes.cpython-310-x86_64-linux-gnu.so(+0x13ce2)[0x7f6ec82acce2]
[g262:29629] [9] /home/test/libxsmm/pyfr-venv/bin/python(_PyObject_MakeTpCall+0x25b)[0x563226d917db]
[g262:29629] [10] /home/test/libxsmm/pyfr-venv/bin/python(_PyEval_EvalFrameDefault+0x64f9)[0x563226d89e39]
[g262:29629] [11] /home/test/libxsmm/pyfr-venv/bin/python(+0x1a7083)[0x563226de6083]
[g262:29629] [12] /home/test/libxsmm/pyfr-venv/bin/python(+0x28cd14)[0x563226ecbd14]
[g262:29629] [13] /home/test/libxsmm/pyfr-venv/bin/python(+0x12cb4a)[0x563226d6bb4a]
[g262:29629] [14] /home/test/libxsmm/pyfr-venv/bin/python(+0x2356d0)[0x563226e746d0]
[g262:29629] [15] /home/test/libxsmm/pyfr-venv/bin/python(PyGC_Collect+0x6e)[0x563226ea78ae]
[g262:29629] [16] /home/test/libxsmm/pyfr-venv/bin/python(Py_FinalizeEx+0x16e)[0x563226ea52ee]
[g262:29629] [17] /home/test/libxsmm/pyfr-venv/bin/python(Py_Exit+0xc)[0x563226eba00c]
[g262:29629] [18] /home/test/libxsmm/pyfr-venv/bin/python(+0x2688ff)[0x563226ea78ff]
[g262:29629] [19] /home/test/libxsmm/pyfr-venv/bin/python(PyErr_PrintEx+0x1d)[0x563226ea782d]
[g262:29629] [20] /home/test/libxsmm/pyfr-venv/bin/python(_PyRun_SimpleFileObject+0x1d6)[0x563226ea4166]
[g262:29629] [21] /home/test/libxsmm/pyfr-venv/bin/python(_PyRun_AnyFileObject+0x43)[0x563226ea3e33]
[g262:29629] [22] /home/test/libxsmm/pyfr-venv/bin/python(Py_RunMain+0x2be)[0x563226e950ae]
[g262:29629] [23] /home/test/libxsmm/pyfr-venv/bin/python(Py_BytesMain+0x2d)[0x563226e6b34d]
[g262:29629] [24] /lib/x86_64-linux-gnu/libc.so.6(+0x29d90)[0x7f6ec8ae1d90]
[g262:29629] [25] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80)[0x7f6ec8ae1e40]
[g262:29629] [26] /home/test/libxsmm/pyfr-venv/bin/python(_start+0x25)[0x563226e6b245]
[g262:29629] ***End of error message***
Segmentation fault (core dumped)

```

Do you know what is wrong?  
Best,

Yuji

---

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [27 December 2022 11:47 UTC](https://pyfr.discourse.group/t/nvidia-gpu-segmentation-fault-with-opencl/728/2 "2022-12-27T11:47:23Z")

</div>

Are you running on an NVIDIA GPU?

Regards, Freddie.

---

<div class="post-metadata">

**Author:** ![Yujif1Aero](https://yyz2.discourse-cdn.com/free1/user_avatar/pyfr.discourse.group/yujif1aero/32/448_2.png) [@Yujif1Aero](https://pyfr.discourse.group/u/Yujif1Aero)\
**Post date:** [27 December 2022 13:24 UTC](https://pyfr.discourse.group/t/nvidia-gpu-segmentation-fault-with-opencl/728/3 "2022-12-27T13:24:24Z")

</div>

Dear Dr. Freddie,  
Thanks for your quick reply.  
Yes exactly I am using Nvidia GPUs.

Best,  
Yuji

---

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [27 December 2022 15:52 UTC](https://pyfr.discourse.group/t/nvidia-gpu-segmentation-fault-with-opencl/728/4 "2022-12-27T15:52:40Z")

</div>

From the installation notes ([Installation — Documentation](https://pyfr.readthedocs.io/en/latest/installation.html#opencl-backend)):

> Note that when running on NVIDIA GPUs the OpenCL backend terminate with a segmentation fault after the simulation has finished. This is due to a long-standing bug in how the NVIDIA OpenCL implementation handles sub-buffers. As it occurs during the termination phase—after all data has been written out to disk—the issue does _not_ impact the functionality or correctness of PyFR.

Regards, Freddie.
