CMA array with np.int32 data type error

Hi,
I need to transfer an array of data type is int32 from PL to PS, and I create an array by using cma_array with data type is np.int32 as follows,
Screenshot from 2020-10-21 10-17-17

As showed in the screenshot, there is an error message “Bus error” and Python got crash.

My board is ZCU102 and PYNQ version is 2.5.

Thanks.

I’m using this and it is working can you try it?
from pynq import allocate
from pynq import Overlay
ol = Overlay(“something.bit”)
arr = allocate(shape=(512, 16), dtype=np.int32)

@bartokon, still the same error. Which version of pynq and board are you use?

image
Image v2.5.1
git clone GitHub - Xilinx/PYNQ: Python Productivity for ZYNQ -b v2.5.1
Eclypse-Z7

maybe I should try 2.5.1 tomorrow, thanks!

I upgrade PYNQ from 2.5 to 2.5.4, on my Ultra96-v2, still have the same issue…

Check your device-tree. You could forget about dma ?xilinx apf? drivers and device-tree addons for xlnk

Hi @bartokon, thanks your suggestion!
I don’t understand the device-tree you mean, and the the relationship between this error with DMA.
But I google for “Xilinx APF” and found this post
Enabling Xilinx APF Accelerator Driver in PetaLinux, the author mentioned similar problem which is failed to open “/dev/xlnk”. Then he added several configurations about DMA and APF into petalinux configurations.(I don’t familiar with petalinux neither)
Then I looking into the Ultra96-v2 PYNQ image repository and found the configuration file, but do not see any configuration about DMA and APF, could this be the possible cause? If yes, what should I do?
BTW, I upgrade my PYNQ on Ultra96-v2 by using pip3.

Thanks again.

add this to device-tree

zyxclmm_drm {		compatible = "xlnx,zocl";		status = "okay";	};

and add Xilinx APF support.

You could try one of this ready images: Releases · Avnet/Ultra96-PYNQ · GitHub

The Best thing you can do is try to learn how petalinux works and wait for someone from pynq to help you out :slight_smile:

@bartokon, thanks for your help, I will try Avnet’s image later.

Hey @Jia-Ming_Lin ,

Any progress with this issue?

I’m having the same problem with the latest image of Ultra…

Thanks,
Assaf.

My problem was solved when I changed the buffer size to an even dimensional size (it crashed for odd size).

Hi @assaf_almog

I haven’t solve the problem now…, could you share your code?
For me, arr = allocate(shape=(512,16), dtype=dt got Bus error when dt = np.uint16, np.int16, np.uint32 and np.int32. And it works for only np.uint8 and np.int8.

What do you mean by “buffer size is even dimension”?

Thanks,
Jia-Ming.

hi @Jia-Ming_Lin ,

My code:

arr = allocate(shape=(N,), dtype=np.int32)

When N is odd - The program crash with Bus Error,
When N is Even - It works fine.

Assaf.