# Kria KV260 + PYNQ : hard time trying to make it work

**URL:** https://discuss.pynq.io/t/kria-kv260-pynq-hard-time-trying-to-make-it-work/5101
**Category:** Support
**Created:** [January 11, 2023, 4:04pm UTC](https://discuss.pynq.io/t/kria-kv260-pynq-hard-time-trying-to-make-it-work/5101 "2023-01-11T16:04:01Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![JPR75](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/jpr75/32/2959_2.png) [@JPR75](https://discuss.pynq.io/u/JPR75)
#### Post date: [January 11, 2023, 4:04pm UTC](https://discuss.pynq.io/t/kria-kv260-pynq-hard-time-trying-to-make-it-work/5101/1 "2023-01-11T16:04:01Z")

</div>

Hi,

I am having a hard time trying to install and make work PYNQ on Kria KV260. Any help or suggestions will be welcome.  
My config:

- Kira KV260
- Ubuntu 20.04 LTS (because I was not able to make Ubuntu 22.04 work correctly. Same problem as described in [KR260 Desktop Issue](https://discuss.pynq.io/t/kr260-desktop-issue/5061)
- PYNQ v1.0 (checkout to branch v1.0 asked by the install script)
- Software: provided example “2\_python\_environment.ipynb”

I went through the installation of PYNQ by cloning the GitHub repository and following the instructions, and I am able to start JupyterLab. Problems arise when I try to execute the provided kernel “2\_python\_environment.ipynt”, in section “Numpy Data Movement”:

```python
import numpy as np
import pynq

def get_pynq_buffer(shape, dtype):
    """ Simple function to call PYNQ's memory allocator with numpy attributes"""
    
    try:
        return pynq.allocate(shape, dtype)
    except RuntimeError:
        print('Load an overlay to allocate memory')
        return

```

pynq.allocate() does not work. Looking deeper, It seems that the problem comes from the function \_get\_xrt\_version\_embedded() of /usr/local/share/pynq-venv/lib/python3.8/site-packages/pynq/pl\_server/xrt\_device.py:

```python
def _get_xrt_version_embedded():
    output = subprocess.run(
        ["xbutil", "--version"], stdout=subprocess.PIPE, universal_newlines=True
    )
    if output.returncode != 0:
        warnings.warn("xbutil failed to run - unable to determine XRT version")
        return (0, 0, 0)
    xrt_version_str = output.stdout.split("\n")[0].split(":")[1].strip()

    return tuple(map(int, xrt_version_str.split(".")))

```

“xbutil” has no option “–version”. As a quick workaround, I have replaced the code by `xrt_version_str = "1.1.0"` (this is given by xbutil dump). But back to “2\_python\_environment.ipynt”, I have a problem with get\_pynq\_buffer() function in the next section of code:

```python
buffer = get_pynq_buffer(shape=(4,4), dtype=np.uint32)
buffer

```

This time, It seems that there is a problem with “global\_state\_file\_exists” in /usr/local/share/pynq-venv/lib/python3.8/site-packages/pynq/pl\_server/embedded\_device.py

I am wandering if I have missed something during the installation or made some mistakes.  
Has anyone successfully run PYNQ / Ubuntu on Kria (which version of PYNQ/Ubuntu please)?

Thanks

---

<div class="post-metadata">

### Author: ![qianyich](https://avatars.discourse-cdn.com/v4/letter/q/41988e/32.png) [@qianyich](https://discuss.pynq.io/u/qianyich)
#### Post date: [January 12, 2023, 12:45am UTC](https://discuss.pynq.io/t/kria-kv260-pynq-hard-time-trying-to-make-it-work/5101/2 "2023-01-12T00:45:42Z")

</div>

I failed this example as well but on a different board with a different image.

---

<div class="post-metadata">

### Author: ![stf](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/stf/32/2724_2.png) [@stf](https://discuss.pynq.io/u/stf)
#### Post date: [January 12, 2023, 9:37am UTC](https://discuss.pynq.io/t/kria-kv260-pynq-hard-time-trying-to-make-it-work/5101/3 "2023-01-12T09:37:38Z")

</div>

Hi @JPR75,

Many thanks for reporting this.

For the global\_state\_file issue, would you mind running cell 1 of `kv260/microblaze_c_libraries.ipynb`

![image](https://us1.discourse-cdn.com/flex019/uploads/pynq1/original/2X/9/9298056ad0aa0821d0fea0663c0a3775edfe487f.png)

This will download the base overlay and should create the global\_state\_file if it does not exist already. Then can you try rerunning `2_python_environment.ipynb` and report back?

Thanks for flagging the change in the options for xbutil. I’ll try and look into that at some point today.

Many thanks,  
Shane

---

<div class="post-metadata">

### Author: ![JPR75](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/jpr75/32/2959_2.png) [@JPR75](https://discuss.pynq.io/u/JPR75)
#### Post date: [January 12, 2023, 12:44pm UTC](https://discuss.pynq.io/t/kria-kv260-pynq-hard-time-trying-to-make-it-work/5101/4 "2023-01-12T12:44:09Z")

</div>

Thank you for your help.

I had to add the `ignore_version=True` option, because my [xilinx.com](http://xilinx.com):ip:axi\_iic is 2.1 instead of 2.0:

```python
from kv260 import BaseOverlay

base = BaseOverlay('base.bit', ignore_version=True)

```

and that solved the problem. I am now able to run the “Numpy Data Movement” section of `2_python_environment.ipynb`.

Thanks

---

<div class="post-metadata">

### Author: ![marioruiz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.pynq.io/marioruiz/32/2177_2.png) [@marioruiz](https://discuss.pynq.io/u/marioruiz)
#### Post date: [January 12, 2023, 3:19pm UTC](https://discuss.pynq.io/t/kria-kv260-pynq-hard-time-trying-to-make-it-work/5101/5 "2023-01-12T15:19:58Z")

</div>


