# Feature gpu for 0.2.4

**URL:** <https://bempp.discourse.group/t/feature-gpu-for-0-2-4/94>\
**Category:** Uncategorized\
**Created:** [24 July 2021 11:01 UTC](https://bempp.discourse.group/t/feature-gpu-for-0-2-4/94 "2021-07-24T11:01:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hellojxt](https://avatars.discourse-cdn.com/v4/letter/h/9f8e36/32.png) [@hellojxt](https://bempp.discourse.group/u/hellojxt)\
**Post date:** [24 July 2021 11:01 UTC](https://bempp.discourse.group/t/feature-gpu-for-0-2-4/94/1 "2021-07-24T11:01:29Z")

</div>

The code of “Solving your first problem with Bempp” cannot run under bempp 0.2.4.  
The error it causes:

```auto
RuntimeError: Could not find suitable OpenCL CPU driver.

```

I read the code of bempp 0.2.4 and found that it does not support gpu, but earlier versions (e.g. 0.2.1) support gpu. I changed the `device_type='cpu'` in the source code to `device_type='gpu'` and it can run successfully. Is this safe? When is the latest version of bempp expected to support gpu? How can I use GPU to speed up my calculations now? Thank you!

---

<div class="post-metadata">

**Author:** ![timo](https://yyz2.discourse-cdn.com/free1/user_avatar/bempp.discourse.group/timo/32/7_2.png) [@timo](https://bempp.discourse.group/u/timo)\
**Post date:** [26 July 2021 09:42 UTC](https://bempp.discourse.group/t/feature-gpu-for-0-2-4/94/2 "2021-07-26T09:42:21Z")

</div>

Hi,

all our OpenCL compute kernels can run on CPUs and GPUs. The question is performance. For dense matrix assembly CPUs are most of the time faster due to memory transfer overhead onto the device. For domain potential operators the picture looks different. Here, GPU codes are often faster. You can find details at: [https://discovery.ucl.ac.uk/id/eprint/10129932/1/main.pdf](https://discovery.ucl.ac.uk/id/eprint/10129932/1/main.pdf)

Best wishes

Timo

---

<div class="post-metadata">

**Author:** ![hellojxt](https://avatars.discourse-cdn.com/v4/letter/h/9f8e36/32.png) [@hellojxt](https://bempp.discourse.group/u/hellojxt)\
**Post date:** [30 July 2021 09:06 UTC](https://bempp.discourse.group/t/feature-gpu-for-0-2-4/94/3 "2021-07-30T09:06:39Z")

</div>

Thank you so much for replying, I got it.

---

<div class="post-metadata">

**Author:** ![Niki](https://yyz2.discourse-cdn.com/free1/user_avatar/bempp.discourse.group/niki/32/23_2.png) [@Niki](https://bempp.discourse.group/u/Niki)\
**Post date:** [16 August 2021 19:34 UTC](https://bempp.discourse.group/t/feature-gpu-for-0-2-4/94/4 "2021-08-16T19:34:12Z")

</div>

Hi!  
I also have question about GPU support in current version (0.2.4)  
I am on Windows and AMD CPU, so there is no official OpenCL CPU driver. There is no readily available pocl driver for Windows as well (I’ve tried to build one from source, but after a day of headache I gave up).  
But I have NVIDIA GPU, so I would like to try it instead of Numba for better performance. Anyway when I set in my code:  
_opencl\_kernels.device\_type=‘gpu’_  
And operator keywords:  
_assembler=“dense”, device\_interface=“opencl”_  
I get error:  
**Could not find suitable OpenCL CPU driver.**  
(If I don’t pass keywords, no errors, but it seems that calculation is performed with Numba on CPU. GPU is not loaded at all)  
I’ve tried to edit source code as hellojxt proposed, but I get another errors. Sorry, I am new to Python (worked mostly in Matlab previously), so I am afraid to break the code.  
May be it is easier to setup Linux on my computer to get pocl working. But I anticipate another problems with that due to no experience with Linux at all.  
Would be nice to get some information on all this…  
Thanks!

PS: Anyway even with Numba BEMpp gives tremendous speed comparing to other BEM libraries I’ve tried so far. But you always want faster when it comes to such stuff… =)
