KeyError:2 when loading overlay bitfile

Hi all,

I am currently encountering the following error when loading the overlay:

from pynq import Overlay
/usr/lib/python3.9/site-packages/pynq/pmbus.py:230: UserWarning: Could not initialise libsensors library
  warnings.warn("Could not initialise libsensors library")

overlay = Overlay('/usr/lib/python3.9/site-packages/pynq/overlays/addr/adder.bit')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.9/site-packages/pynq/overlay.py", line 330, in __init__
    self.parser = self.device.get_bitfile_metadata(self.bitfile_name)
  File "/usr/lib/python3.9/site-packages/pynq/pl_server/xrt_device.py", line 520, in get_bitfile_metadata
    return XclBin(bitfile_name)
  File "/usr/lib/python3.9/site-packages/pynq/pl_server/xclbin_parser.py", line 286, in __init__
    self.ip_dict, self.mem_dict = _xclbin_to_dicts(filename)
  File "/usr/lib/python3.9/site-packages/pynq/pl_server/xclbin_parser.py", line 236, in _xclbin_to_dicts
    sections[xclbin.AXLF_SECTION_KIND.EMBEDDED_METADATA].decode(),
KeyError: 2

Versions:
PYNQ version 2.5.1
Git commit: 6fee2225bf90cd0ecb085017c5408a3d384a0632
Vivado 2020.2

It seems, the “sections” array is empty. But why?

I have pleaced the files adder.bit, adder.tcl and adder.hwh in the same directory.

Can please someone push me in the right direction?

Thank you very much and best regards
Frank

1 Like

Hi @madcat,

What board are you using?

Mario

Hi @marioruiz

it’s a custom board based on the MPSoC Ultrascale+ (DEVICE=“xazu5ev” PACKAGE=“sfvc784”)
Running PetaLinux 2020.2

Thanks for your response :slight_smile:
Frank

Hi,

This could be a bug in that version of PYNQ, if you want to stay with that version I suggest you use the PYNQ version 2.5.

PYNQ 2.5.1 introduced support for Alveo, and it seems that a bug for embedded.

If possible, I would also suggest you move to PYNQ 2.7.

Mario

Hi Mario,

thanks again for your quick response :slight_smile:

All right, I will try to get my overlay running on both versions (2.5 and 2.7)

I will keep you informed :slight_smile:

Thanks Mario and kind regards
Frank

2 Likes

Hi Mario,

I have upgraded to Pynq version 2.7 and the KeyError is gone :slight_smile:

I have a question regarding the XRT. With Pynq versions prior to 2.7, Pynq is using the XRT directly in code? With Pynq version 2.7, Pynq is using the xclbinutil binary for doing the job? Just for the understanding

Thank you for your help!
Best regards
Frank

2 Likes

Hi,

XRT for edge was only introduced in 2.7. Previously, it was only used for data center cards.
xclbin format is something that has no official support for edge. You may see in the code that xclbinutil is being used, but this is only for memory allocation purposes.

Mario

Thx Mario!