# Failed to allocate Memory when i use the fuction 'cma\_alloc'

**URL:** https://discuss.pynq.io/t/failed-to-allocate-memory-when-i-use-the-fuction-cma-alloc/205
**Category:** Support
**Created:** [June 13, 2019, 8:53am UTC](https://discuss.pynq.io/t/failed-to-allocate-memory-when-i-use-the-fuction-cma-alloc/205 "2019-06-13T08:53:37Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Earl\_Bezos](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/earl_bezos/32/98_2.png) [@Earl\_Bezos](https://discuss.pynq.io/u/Earl_Bezos)
#### Post date: [June 13, 2019, 8:53am UTC](https://discuss.pynq.io/t/failed-to-allocate-memory-when-i-use-the-fuction-cma-alloc/205/1 "2019-06-13T08:53:37Z")

</div>

I make my zynq board work like Pynq-Z1, and i make a uImage 2016.04, added the Xilinx APF accelerator driver and UIO driver as tutorial.But when I ran the step

boolean\_generator = logictools\_olay.boolean\_generator  
boolean\_generator.setup(function)

in boolean\_generator.ipynb.something wrong happened that “RuntimeError: Failed to allocate Memory!”.  
How can I do to modify it,waiting for your reply.

---

<div class="post-metadata">

### Author: ![Earl\_Bezos](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/earl_bezos/32/98_2.png) [@Earl\_Bezos](https://discuss.pynq.io/u/Earl_Bezos)
#### Post date: [June 14, 2019, 6:24am UTC](https://discuss.pynq.io/t/failed-to-allocate-memory-when-i-use-the-fuction-cma-alloc/205/2 "2019-06-14T06:24:19Z")

</div>

OK, i overcame the problem. After adding the APF driver, I also modify the size in Mega Bytes(256) in the Device Drivers of linux kernel.Then you can get a /dev/xlnx, and the problem was solved.
