# Memory on CUDA GPU

**URL:** <https://pyfr.discourse.group/t/memory-on-cuda-gpu/1093>\
**Category:** General\
**Tags:** mesh\
**Created:** [22 May 2024 07:21 UTC](https://pyfr.discourse.group/t/memory-on-cuda-gpu/1093 "2024-05-22T07:21:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wgbb](https://avatars.discourse-cdn.com/v4/letter/w/6f9a4e/32.png) [@wgbb](https://pyfr.discourse.group/u/wgbb)\
**Post date:** [22 May 2024 07:21 UTC](https://pyfr.discourse.group/t/memory-on-cuda-gpu/1093/1 "2024-05-22T07:21:36Z")

</div>

Hello, everybody.

I’d like to ask you about a memory problem during cuda calculations, I’m experiencing a lack of video memory.

To give a brief description, when I do a calculation with a 3D mesh of 7 million with order=1, there is no problem, when I switch to order=5, I get an error that there is not enough video memory (120G of cuda memory).

> ine 136, in \_malloc\_checked  
> raise RuntimeError('Allocation too large for normal backend ’  
> RuntimeError: Allocation too large for normal backend memory-model

Is there any way to reduce the memory usage, even if it reduces the speed of computation?  
Incidentally, my mesh is generated using pointwise and is not set in high order format.

Regards, Wgbb.

---

<div class="post-metadata">

**Author:** ![WillT](https://avatars.discourse-cdn.com/v4/letter/w/bc79bd/32.png) [@WillT](https://pyfr.discourse.group/u/WillT)\
**Post date:** [22 May 2024 07:50 UTC](https://pyfr.discourse.group/t/memory-on-cuda-gpu/1093/2 "2024-05-22T07:50:43Z")

</div>

No, we’ve already been very aggressive in memory optimisations. If you’re allocating a lot of memory, you’ll want to add this:

```ini
[backend]
memory-model = large

```

But that just changes the allocation method and won’t reduce the overall memory usage. In order to run your calculation, you’ll probably need to partition it and run it across more GPUs.
