Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

RuntimeError: There is no current event loop in thread 'ScriptRunner.scriptThread'. #108

@manudwd

Description

@manudwd

Hello!
DPU Target: DPUCZDX8G_ISA1_B4096

Vitis Verison: 2.5.0 (CPU)

I am using the Xilinx-RFSoC ZCU 111 for a custom neural net, I am using that with combinations to some other tools to create something along the lines of a dash board for my results, all of which is intended to happen on the board using board Jupyter terminal.

I am able to load the bitstream as usual using dpu = DpuOverlay("dpu.bit") when I run it on the jupyter notebook. The problem occurs when I use it in combination with this web app creating tool called streamlit. streamlit hosts on the local system as well typically on localhost:8501 port, while PYNQ hosts on port:8080.

Expected Behaviour: when I run streamlit run myDPU_file.py, the app should be hosted on local computer's browser since the Board is connected to my local computer via UART.

Actual Behaviour: The error message:

RuntimeError: There is no current event loop in thread 'ScriptRunner.scriptThread'.
Traceback:

File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 541, in _run_script
    exec(code, module.__dict__)
File "/home/xilinx/jupyter_notebooks/pynq-dpu/present_Complete_DPU.py", line 394, in <module>
    overlay = DpuOverlay("dpu.bit")
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 315, in __init__
    super().__init__(bitfile_name, dtbo, partial=False, device=device)
File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/bitstream.py", line 88, in __init__
    device = Device.active_device
File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/pl_server/device.py", line 70, in active_device
    if len(cls.devices) == 0:
File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/pl_server/device.py", line 54, in devices
    cls._devices.extend(DeviceMeta._subclasses[key]._probe_())
File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/pl_server/embedded_device.py", line 545, in _probe_
    return [EmbeddedDevice()]
File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/pl_server/embedded_device.py", line 568, in __init__
    super().__init__(0, "embedded_xrt{}")
File "/usr/local/share/pynq-venv/lib/python3.10/site-packages/pynq/pl_server/xrt_device.py", line 325, in __init__
    self._loop = asyncio.get_event_loop()
File "/usr/lib/python3.10/asyncio/events.py", line 656, in get_event_loop
    raise RuntimeError('There is no current event loop in thread %r.'

I understand this problem may not be answered since it is raised in combination with other tools, but the error message seems to suggest that no device is found, which shouldn't be the case. It seems like a fundamental problem of threading, any help in diagnosing would be really appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions