# GPU out of memory?

**URL:** <https://pyfr.discourse.group/t/gpu-out-of-memory/114>\
**Category:** Just Starting\
**Created:** [29 July 2016 02:53 UTC](https://pyfr.discourse.group/t/gpu-out-of-memory/114 "2016-07-29T02:53:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arif\_Andira](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@Arif\_Andira](https://pyfr.discourse.group/u/Arif_Andira)\
**Post date:** [29 July 2016 02:53 UTC](https://pyfr.discourse.group/t/gpu-out-of-memory/114/1 "2016-07-29T02:53:23Z")

</div>

Dear PyFR Developer,

I’ve downloaded the 3d case which is uploaded at [example datasets](https://pyfr.discourse.group/t/example-datasets/57/2).

When I ran using cuda backend, it gives an error message like this :

`[andiraarif@localhost Benchmark Problem]$ pyfr run -b cuda -p cube_hex24.pyfrm config.ini`

```auto
Traceback (most recent call last):
File "/usr/bin/pyfr", line 9, in <module>
load_entry_point('pyfr==1.4.0', 'console_scripts', 'pyfr')()
File "/usr/lib/python3.4/site-packages/pyfr-1.4.0-py3.4.egg/pyfr/scripts/main.py", line 109, in main
File "/usr/lib/python3.4/site-packages/pyfr-1.4.0-py3.4.egg/pyfr/scripts/main.py", line 230, in process_run
File "/usr/lib/python3.4/site-packages/pyfr-1.4.0-py3.4.egg/pyfr/scripts/main.py", line 214, in _process_common
File "/usr/lib/python3.4/site-packages/pyfr-1.4.0-py3.4.egg/pyfr/solvers/ __init__.py", line 14, in get_solver
File "/usr/lib/python3.4/site-packages/pyfr-1.4.0-py3.4.egg/pyfr/integrators/ __init__.py", line 26, in get_integrator
File "/usr/lib/python3.4/site-packages/pyfr-1.4.0-py3.4.egg/pyfr/integrators/controllers.py", line 15, in __init__
File "/usr/lib/python3.4/site-packages/pyfr-1.4.0-py3.4.egg/pyfr/integrators/steppers.py", line 9, in __init__
File "/usr/lib/python3.4/site-packages/pyfr-1.4.0-py3.4.egg/pyfr/integrators/base.py", line 41, in __init__
File "/usr/lib/python3.4/site-packages/pyfr-1.4.0-py3.4.egg/pyfr/solvers/base/system.py", line 52, in __init__
File "/usr/lib/python3.4/site-packages/pyfr-1.4.0-py3.4.egg/pyfr/solvers/base/system.py", line 110, in _load_int_inters
File "/usr/lib/python3.4/site-packages/pyfr-1.4.0-py3.4.egg/pyfr/solvers/navstokes/inters.py", line 13, in __init__
File "/usr/lib/python3.4/site-packages/pyfr-1.4.0-py3.4.egg/pyfr/solvers/baseadvecdiff/inters.py", line 12, in __init__
File "/usr/lib/python3.4/site-packages/pyfr-1.4.0-py3.4.egg/pyfr/solvers/baseadvec/inters.py", line 24, in __init__
File "/usr/lib/python3.4/site-packages/pyfr-1.4.0-py3.4.egg/pyfr/solvers/base/inters.py", line 56, in _const_mat
File "/usr/lib/python3.4/site-packages/pyfr-1.4.0-py3.4.egg/pyfr/backends/base/backend.py", line 17, in newfn
File "/usr/lib/python3.4/site-packages/pyfr-1.4.0-py3.4.egg/pyfr/backends/base/backend.py", line 117, in const_matrix
File "/usr/lib/python3.4/site-packages/pyfr-1.4.0-py3.4.egg/pyfr/backends/base/types.py", line 138, in __init__

File "/usr/lib/python3.4/site-packages/pyfr-1.4.0-py3.4.egg/pyfr/backends/base/types.py", line 62, in __init__'metaclass' entry removed. If no kwds argument is passed in, this will
File "/usr/lib/python3.4/site-packages/pyfr-1.4.0-py3.4.egg/pyfr/backends/base/backend.py", line 57, in malloc
File "/usr/lib/python3.4/site-packages/pyfr-1.4.0-py3.4.egg/pyfr/backends/cuda/base.py", line 82, in _malloc_impl
pycuda._driver.MemoryError: cuMemAlloc failed: out of memory

```

What’s wrong with this calculation? What memory in computer is used to perform GPU computing using CUDA Backend ? Fyi I used NVIDIA GeForce GTX460 GDDR5 1GB and 16GB RAM

---

<div class="post-metadata">

**Author:** ![p.vincent](https://yyz2.discourse-cdn.com/free1/user_avatar/pyfr.discourse.group/p.vincent/32/225_2.png) [@p.vincent](https://pyfr.discourse.group/u/p.vincent)\
**Post date:** [29 July 2016 03:38 UTC](https://pyfr.discourse.group/t/gpu-out-of-memory/114/2 "2016-07-29T03:38:27Z")

</div>

Hi Arif,

> What’s wrong with this calculation?

It seems you are running out of (GPU) memory.

> What memory in computer is used to perform GPU computing using CUDA Backend ?

GPU memory. In your case 1GB.

You can try lowering the order in the .ini fee and see if it launches.

Cheers

Peter

---

<div class="post-metadata">

**Author:** ![Arif\_Andira](https://avatars.discourse-cdn.com/v4/letter/a/2acd7d/32.png) [@Arif\_Andira](https://pyfr.discourse.group/u/Arif_Andira)\
**Post date:** [29 July 2016 04:07 UTC](https://pyfr.discourse.group/t/gpu-out-of-memory/114/3 "2016-07-29T04:07:25Z")

</div>

Thanks a lot Dr Peter E Vincent,  
glad to get the answer from you. It works with second and third order.  
Does it mean that cuda backend cannot solve the relatively heavy case with 1 GB GPU memory ?

May i ask you something else?  
Can i run PyFR with multi-core in single processor ( in this case i use 1 CPU Intel i7 with 8 cores(4cores hyperthreading)) + GPU ( Nvidia GTX460 ) simultaneously?What configuration and command do i have to type?

I have read the user guide, and i’m still confused about running in this mode. Thank you 🙂

---

<div class="post-metadata">

**Author:** ![Zach\_Davis1](https://avatars.discourse-cdn.com/v4/letter/z/3ec8ea/32.png) [@Zach\_Davis1](https://pyfr.discourse.group/u/Zach_Davis1)\
**Post date:** [29 July 2016 13:14 UTC](https://pyfr.discourse.group/t/gpu-out-of-memory/114/4 "2016-07-29T13:14:48Z")

</div>

Hi Arif,

Freddie has answered how to go about setting up a heterogeneous run using both CPU and GPU configurations in the PyFR mailing list. The thread with detailed instructions can be found at:

[https://groups.google.com/forum/#!topic/pyfrmailinglist/3-WhWBeH2ok](https://groups.google.com/forum/#!topic/pyfrmailinglist/3-WhWBeH2ok)

Best Regards,

Zach
