Hi all !
I’m trying to run an example with a tf2 xmodel using pynq from the command line but unable to proceed because of an error about permissions.
I’m only with two lines of code - because it is just an example:
from pynq_dpu import DpuOverlay
# set DPU
overlay = DpuOverlay("dpu.bit")
I’ve started my CLI session with
source /etc/profile.d/pynq_venv.sh
so I can have the pynq environment.
When I run the example above (be in a script of from the Python console):
(pynq-venv) ubuntu@kria:~/myModel$ python
Python 3.10.6 (main, Mar 10 2023, 10:55:28) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pynq_dpu import DpuOverlay
>>> overlay = DpuOverlay("dpu.bit")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq_dpu/dpu.py", line 98, in __init__
super().__init__(abs_bitfile_name,
File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/overlay.py", line 348, in __init__
self.download()
File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq_dpu/dpu.py", line 116, in download
super().download()
File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/overlay.py", line 424, in download
Clocks.set_pl_clk(i, div0, div1)
File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/ps.py", line 303, in set_pl_clk
cls._instance.set_pl_clk(clk_idx, div0, div1, clk_mhz)
File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/ps.py", line 311, in _instance
cls._real_instance = _ClocksUltrascale()
File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/ps.py", line 463, in __init__
self._crf_mmio = MMIO(self.CRF_APB_ADDRESS, 0x100)
File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/mmio.py", line 73, in __init__
self.array = self.device.mmap(base_addr, length)
File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/pl_server/embedded_device.py", line 581, in mmap
raise EnvironmentError("Root permissions required.")
OSError: Root permissions required.
>>>
If I try sudo python
(pynq-venv) ubuntu@kria:~/myModel$ sudo python runit.py
Traceback (most recent call last):
File "/home/ubuntu/myModel/runit.py", line 1, in <module>
from pynq_dpu import DpuOverlay
ModuleNotFoundError: No module named 'pynq_dpu'
How can I run the two lines without a notebook ?
Thank you
I have the latest PYNQ version and on Ubuntu in a Xilinx Kria KV260