Xclbin cannot be downloaded on AWS F1 instance

Hi everyone!

I compiled the hello world and this other example on an AWS instance with the FPGA Developer AMI and obtained the corresponding xclbin files.

When I try to download the xclbin file on an F1 instance, it fails with the following error:

import pynq

# program the device
ol = pynq.Overlay("vadd.xclbin")

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-2-1a85661e7c73> in <module>
      3 
      4 # program the device
----> 5 ol = pynq.Overlay("vadd.xclbin")

~/anaconda3/lib/python3.7/site-packages/pynq/overlay.py in __init__(self, bitfile_name, dtbo, download, ignore_version, device)
    342 
    343         if download:
--> 344             self.download()
    345 
    346         self.__doc__ = _build_docstring(self._ip_map._description,

~/anaconda3/lib/python3.7/site-packages/pynq/overlay.py in download(self, dtbo)
    401                 Clocks.set_pl_clk(i)
    402 
--> 403         super().download(self.parser)
    404         if dtbo:
    405             super().insert_dtbo(dtbo)

~/anaconda3/lib/python3.7/site-packages/pynq/bitstream.py in download(self, parser)
    152 
    153         """
--> 154         self.device.download(self, parser)
    155 
    156     def remove_dtbo(self):

~/anaconda3/lib/python3.7/site-packages/pynq/pl_server/xrt_device.py in download(self, bitstream, parser)
    499                 self.contexts = old_contexts
    500                 raise RuntimeError("Programming Device failed: " +
--> 501                                    _format_xrt_error(err))
    502         finally:
    503             xrt.xclUnlockDevice(self.handle)

RuntimeError: Programming Device failed: EINVAL (22) Invalid argument

Any hints? Am I missing something?

Thanks in advance,
Medrano

Moving to support.
Did you run the process to create an Amazon FPGA image (AFI), or is the xclbin the output of Vitis?

Cathal

Hi Cathal,
this is the xclbin from Vitis.

Do I need to create the AFI, the process with the S3 bucket?

Best,
Medrano.

Yes, exactly, you need to create the AFI - this is the way AWS works.

This may be useful:

Cathal

Thanks a lot.
A final question, so, the file you should pass to pynq is the awsxclbin, as in

ol = pynq.Overlay("vadd.awsxclbin") ?

Best,
Medrano

Yes, exactly.

Cathal

You can rename the awsxclbin to xclbin for Overlay class to accept it.

This isn’t necessary. Any filename extension will do.

Peter

1 Like

Thanks @rock and @PeterOgden for your answers.

Medrano