I’m having similar issues with the ZC702 board. For once I can’t set CMA to anything higher than 256MB when building petalinux and even when setting CMA to 256MB I still can only allocate 128MB with ‘allocate’.
I’ve used pynq_z1_v2.6.0 to build the SD image and then swapped the BOOT.BIN, boot.scr and image.ub that were built using 2020.1 version of Vitis, petalinux for ZC702 BSP. After enabling Xilinx APF DMA engines under Device Drivers I changed the CMA size to 1024 (ZC702 has 1GB DDR) under Library Routines->Size in Mega Bytes. When built I can see that it fails to reserve CMA of more than 256MB when booting up. Tried 1024MB, 512MB etc and nothing works above 256MB. Am I getting it right that since ZC702 has 4 separate DDR chips, each 256Mx8bit, you cannot reserve more than 256MB for CMA?
Another issue is when kernel has been configured to 256MB of CMA I cannot use more than 128MB when using ‘allocate’.
I’ve tried (~152MB)
buffer = allocate(shape=(40000000,), dtype=np.uint32)
which fails and the max I can allocate is around 33500000 (~128MB i.e. (33500000*4) / 2^20).
When running
mem=Xlnk()
print(mem.cma_mem_size())
print(mem.cma_stats())
I can see
268435456
{‘CMA Memory Available’: 239321088, ‘CMA Memory Usage’: 0, ‘Buffer Count’: 0}
Any suggestions will be much appreciated.