Hello,
I would like to ask, what is the maximum memory that can be allocated by PYNQ’s allocate() function?
from pynq import Overlay, Bitstream, GPIO, MMIO
from pynq import allocate
import numpy as np
src_buffer1 = allocate(shape=(1920*1080,), dtype=np.float32)
dst_buffer1 = allocate(shape=(1920*1080,), dtype=np.float32)
src_buffer2 = allocate(shape=(1920*1080,), dtype=np.float32)
dst_buffer2 = allocate(shape=(1920*1080,), dtype=np.float32)
src_buffer3 = allocate(shape=(1920*1080,), dtype=np.float32)
dst_buffer3 = allocate(shape=(1920*1080,), dtype=np.float32)
src_buffer4 = allocate(shape=(1920*1080,), dtype=np.float32)
dst_buffer4 = allocate(shape=(1920*1080,), dtype=np.float32)
src_buffer5 = allocate(shape=(1920*1080,), dtype=np.float32)
dst_buffer5 = allocate(shape=(1920*1080,), dtype=np.float32)
src_buffer6 = allocate(shape=(1920*1080,), dtype=np.float32)
dst_buffer6 = allocate(shape=(1920*1080,), dtype=np.float32)
src_buffer7 = allocate(shape=(1920*1080,), dtype=np.float32)
dst_buffer7 = allocate(shape=(1920*1080,), dtype=np.float32)
src_buffer8 = allocate(shape=(1920*1080,), dtype=np.float32)
dst_buffer8 = allocate(shape=(1920*1080,), dtype=np.float32)
and there’s Error:
RuntimeError Traceback (most recent call last)
<ipython-input-3-a0b8a9a655ee> in <module>
19
20 src_buffer6 = allocate(shape=(1920*1080,), dtype=np.float32)
---> 21 dst_buffer6 = allocate(shape=(1920*1080,), dtype=np.float32)
22
23 src_buffer7 = allocate(shape=(1920*1080,), dtype=np.float32)
/usr/local/share/pynq-venv/lib/python3.8/site-packages/pynq/buffer.py in allocate(shape, dtype, target, **kwargs)
170 if target is None:
171 target = Device.active_device
--> 172 return target.allocate(shape, dtype, **kwargs)
/usr/local/share/pynq-venv/lib/python3.8/site-packages/pynq/pl_server/device.py in allocate(self, shape, dtype, **kwargs)
290
291 """
--> 292 return self.default_memory.allocate(shape, dtype, **kwargs)
293
294 def reset(self, parser=None, timestamp=None, bitfile_name=None):
/usr/local/share/pynq-venv/lib/python3.8/site-packages/pynq/pl_server/xrt_device.py in allocate(self, shape, dtype, **kwargs)
167
168 """
--> 169 buf = _xrt_allocate(shape, dtype, self.device, self.idx, **kwargs)
170 buf.memory = self
171 return buf
/usr/local/share/pynq-venv/lib/python3.8/site-packages/pynq/pl_server/xrt_device.py in _xrt_allocate(shape, dtype, device, memidx, cacheable, pointer, cache)
122 bo, buf, device_address = pointer
123 else:
--> 124 bo = device.allocate_bo(size, memidx, cacheable)
125 buf = device.map_bo(bo)
126 device_address = device.get_device_address(bo)
/usr/local/share/pynq-venv/lib/python3.8/site-packages/pynq/pl_server/xrt_device.py in allocate_bo(self, size, idx, cacheable)
412 xrt.xclBOKind.XCL_BO_DEVICE_RAM, idx)
413 if bo >= 0x80000000:
--> 414 raise RuntimeError("Allocate failed: " + str(bo))
415 return bo
416
RuntimeError: Allocate failed: 4294967295