# Xclbin cannot be downloaded on AWS F1 instance

**URL:** <https://discuss.pynq.io/t/xclbin-cannot-be-downloaded-on-aws-f1-instance/1341>\
**Category:** Support\
**Created:** [June 10, 2020, 12:25pm UTC](https://discuss.pynq.io/t/xclbin-cannot-be-downloaded-on-aws-f1-instance/1341 "2020-06-10T12:25:35Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Medrano](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@Medrano](https://discuss.pynq.io/u/Medrano)\
**Post date:** [June 10, 2020, 12:25pm UTC](https://discuss.pynq.io/t/xclbin-cannot-be-downloaded-on-aws-f1-instance/1341/1 "2020-06-10T12:25:35Z")

</div>

Hi everyone!

I compiled the [hello world](https://github.com/Xilinx/Vitis_Accel_Examples/tree/master/hello_world) and [this other example](https://github.com/Xilinx/Vitis_Accel_Examples/tree/master/cpp_kernels/systolic_array) 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:

```auto
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

---

<div class="post-metadata">

**Author:** ![cathalmccabe](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/cathalmccabe/32/3348_2.png) [@cathalmccabe](https://discuss.pynq.io/u/cathalmccabe)\
**Post date:** [June 10, 2020, 12:39pm UTC](https://discuss.pynq.io/t/xclbin-cannot-be-downloaded-on-aws-f1-instance/1341/2 "2020-06-10T12:39:45Z")

</div>

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

Cathal

---

<div class="post-metadata">

**Author:** ![Medrano](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@Medrano](https://discuss.pynq.io/u/Medrano)\
**Post date:** [June 10, 2020, 12:58pm UTC](https://discuss.pynq.io/t/xclbin-cannot-be-downloaded-on-aws-f1-instance/1341/3 "2020-06-10T12:58:38Z")

</div>

Hi Cathal,  
this is the xclbin from Vitis.

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

Best,  
Medrano.

---

<div class="post-metadata">

**Author:** ![cathalmccabe](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/cathalmccabe/32/3348_2.png) [@cathalmccabe](https://discuss.pynq.io/u/cathalmccabe)\
**Post date:** [June 10, 2020, 1:19pm UTC](https://discuss.pynq.io/t/xclbin-cannot-be-downloaded-on-aws-f1-instance/1341/4 "2020-06-10T13:19:57Z")

</div>

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

This may be useful:

> <https://github.com/xupgit/compute_acceleration/blob/master/Creating_AFI.md>

Cathal

---

<div class="post-metadata">

**Author:** ![Medrano](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@Medrano](https://discuss.pynq.io/u/Medrano)\
**Post date:** [June 10, 2020, 1:52pm UTC](https://discuss.pynq.io/t/xclbin-cannot-be-downloaded-on-aws-f1-instance/1341/5 "2020-06-10T13:52:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cathalmccabe](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/cathalmccabe/32/3348_2.png) [@cathalmccabe](https://discuss.pynq.io/u/cathalmccabe)\
**Post date:** [June 10, 2020, 2:09pm UTC](https://discuss.pynq.io/t/xclbin-cannot-be-downloaded-on-aws-f1-instance/1341/6 "2020-06-10T14:09:43Z")

</div>

Yes, exactly.

Cathal

---

<div class="post-metadata">

**Author:** ![rock](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/rock/32/32_2.png) [@rock](https://discuss.pynq.io/u/rock)\
**Post date:** [June 11, 2020, 5:12am UTC](https://discuss.pynq.io/t/xclbin-cannot-be-downloaded-on-aws-f1-instance/1341/7 "2020-06-11T05:12:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![PeterOgden](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/peterogden/32/55_2.png) [@PeterOgden](https://discuss.pynq.io/u/PeterOgden)\
**Post date:** [June 11, 2020, 8:33am UTC](https://discuss.pynq.io/t/xclbin-cannot-be-downloaded-on-aws-f1-instance/1341/8 "2020-06-11T08:33:17Z")

</div>

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

Peter

---

<div class="post-metadata">

**Author:** ![Medrano](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@Medrano](https://discuss.pynq.io/u/Medrano)\
**Post date:** [June 11, 2020, 9:04am UTC](https://discuss.pynq.io/t/xclbin-cannot-be-downloaded-on-aws-f1-instance/1341/9 "2020-06-11T09:04:10Z")

</div>

Thanks @rock and @PeterOgden for your answers.

Medrano
