element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
FPGA
  • Technologies
  • More
FPGA
Blog PYNQ - Interactive C++ on the Kria-SoM in Jupyter Lab
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join FPGA to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: ralphjy
  • Date Created: 22 Feb 2022 5:15 AM Date Created
  • Views 4160 views
  • Likes 8 likes
  • Comments 1 comment
  • kria
  • interactive c++
  • pynq
  • jupyter notebooks
Related
Recommended

PYNQ - Interactive C++ on the Kria-SoM in Jupyter Lab

ralphjy
ralphjy
22 Feb 2022

I saw this post by Shane Fleming on the PYNQ discussion board that I thought would be of interest to the PYNQ users in the E14 community: Interactive C++ on the Kria SoM in Jupyter Lab

It caught my eye because up to this point I haven't tried interactive C++ with Jupyter notebooks although I have heard about the Cling implementation.   The post also demonstrates how to run pre-existing Vitis AI C++ code from the Vitis AI library in a notebook on the Kria SoM.

Shane's post covers the implementation steps in detail, so I'll just highlight them.

  1. Start with the PYNQ Ubuntu image on the Kria Starter Kit
  2. Install Miniconda and Mamba package managers to enable the installation of xeus-cling and PYNQ packages
  3. Installation should take about 30 minutes - unfortunately I ran into an unattended Ubuntu upgrade - so it took me more than an hour (need to remember to disable that)
  4. After that just need to start the Jupyter server and open the browser on port 9090 of the Kria

If everything has installed correctly you should see C++ notebook options in the launcher:

image

I'm primarily interested in the DPU-PYNQ example, so I went directly to that.  A cpp_demo directory has been added under the pynq-dpu notebooks directory

image

The example is going to run the resnet50 model using the pre-existing C++ code rather than using the Python bindings (pybind11) to run the C++ code in the previous example dpu_resnet50_pybind11 notebook.

 image

Two notebooks are being used:

  1. A Python notebook to load overlays
  2. A C++ notebook to run the application code

I've actually never run notebooks side-by-side, so another new experience.  It's quite a bit faster than the pybinding code which takes about 30 seconds to compile - so it feels almost instantaneous.

image

I did notice that the new PYNQ installation did break the original pybind11 notebook.  I reported that to Shane and he was going to see if it is an OpenCV version issue.

image

It will be interesting to try some of the other models.

  • Sign in to reply
  • Jan Cumps
    Jan Cumps over 3 years ago

    This is interesting. I've seen (and tested) the possibility to create C functions in a Jupiter page, then build and deploy on a microblaze. But that is in essence still a Python Jupyter page.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube