PYNQ: PYTHON PRODUCTIVITY

Pynq & maximum allocatable memory (CMA)

Hello,

I have some limitations when using a DMA on a ZCU111. I can’t allocate all the memory I need in my buffers when I use “allocate” function.
After some research, I find this : " This buffer is allocated inside the kernel space using xlnk driver. The maximum allocatable memory is defined at kernel build time using the CMA memory parameters. For Pynq-Z1 kernel, it is specified as 128MB. " (https://pynq.readthedocs.io/en/v2.0/_modules/pynq/xlnk.html).

I think it is necessary to configure the Linux Kernel : Failed to allocate Memory when i use the fuction 'cma_alloc'
But I have no more information.

Someone can help me ?

Thanks :slight_smile:

Damien

I forgot to specify : I try to build a new image (https://pynq.readthedocs.io/en/v2.5.1/pynq_sd_card.html), but I don’t find any parameters to modify to increase this maximum allocatable memory.

Thanks :slight_smile:

Damien

Check under Petalinux Kernel Config. There was a tutorial here a while ago by Peter showing how to port to a new board. If I recall correctly is under the same settings as DMA APF.

Device Drivers->Generic Driver Options->Size in Mega Bytes(1024)
Device Drivers->Staging drivers (ON)->Xilinx APF Accelerator driver (ON)->Xilinx APF DMA engines support (ON)

Hi :slight_smile:
Thank you so much for your answers

You’re talking about this guide : Deploying PYNQ and Jupyter with Petalinux ?

Damien

Yep, that’s it.

Hello again.

I’m testing the guide, and it’s probably going to work.
Nevertheless, I lost the current configuration of ZCU111 v2.5, myrootfs… :frowning:

Do you know if I can:

  • just copy the new build kernel to my ZCU111 SD card?
  • or maybe just specify the kernel option when I use this guide: https://pynq.readthedocs.io/en/v2.5.1/pynq_sd_card.html ? Because I can’t configure the kernel with it (or I don’t know how to do this)
  • maybe something else?

Thank you very much, again

Damien

Hello,

I found a “temporary” solution. You need to follow this guide : https://pynq.readthedocs.io/en/v2.5.1/pynq_sd_card.html#pynq-sd-card and launch the kernel compilation. In an other terminal look for kernel configuration file and stop the compilation. Edit the file and start again the compilation.
WHen It’s finish you can copy the kernel file in your sd card.

It’s not “clean”, but I don’t know how to configure the kernel when you are using Pynq. If someone know, I’m very interested.

Damien

After you have the boot_files built (run make boot_files or run make), the petalinux_project folder should appear in your sdbuild/build/ folder, you can go inside and run petalinux-config -c kernel.