Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: integrate OpenVINO AI plugins #304

Merged

Conversation

frenchwr
Copy link

@frenchwr frenchwr commented Dec 9, 2024

Background on plugins

This PR integrates OpenVINO AI plugins from from a repo maintained by Intel. The plugins include stable diffusion, semantic segmentation, and super resolution, and use Intel's AI inference library OpenVINO which supports accelerators like Intel GPUs and NPUs (neural processing units). The NPUs are built into Intel's line of Core Ultra chips that are present in many new laptop and desktop devices, so the hardware support for the plugins, while not universal, is expected to reach a large number of users. The plugins do not yet support GIMP v3, although it's on the roadmap.

Technical details

The primary changes include integrating with multiple content producer snaps to minimize the maintenance burden on the GIMP snap itself. In summary:

  • Add a new plug for openvino-ai-plugins-gimp snap (see PR here for background) and add a command-chain script from this repo to set the runtime environment for GIMP. An update to GIMP's plug-in search path allows these plugins to be used over this interface.
  • Add a new plug for openvino-toolkit-2404 snap (repo) and add a command-chain script from this repo to set the runtime environment for GIMP.
  • Add a new plug for accessing the Intel NPU char device node on the host over the custom-device snapd interface. The slot is provided by the intel-npu-driver snap.
  • Add a new plug for mounting the NPU runtime libs from the intel-npu-driver snap.
  • Add override-stage section to the gimp part of the snap to update the plugin search path and to fix GIMP's python interpreters file, which was pointing at a python interpreter that does not exist inside the snap.

Testing

I've tested on a remote machine equipped with an Intel CPU, GPU, and NPU. I have verified that all three AI plugins function on the different hardware device types, with the GPU and NPU providing acceleration.

@jnsgruk
Copy link
Member

jnsgruk commented Dec 10, 2024

Changes looking good overall, do you have an idea when GIMP 3.0 support is targeted?

@frenchwr
Copy link
Author

Changes looking good overall, do you have an idea when GIMP 3.0 support is targeted?

I asked here: intel/openvino-ai-plugins-gimp#154

It sounds like it's on their roadmap but they have not committed to any specific date.

@jnsgruk
Copy link
Member

jnsgruk commented Dec 10, 2024

Okay, might need to consider releasing this to a different track when it's ready for release rather than delay releasing 3.0 when it's out.

@frenchwr
Copy link
Author

Okay, might need to consider releasing this to a different track when it's ready for release rather than delay releasing 3.0 when it's out.

That sounds great to me! Is there something I can do (e.g. submit a request for a new track in the store) to help facilitate that? This is something we're hoping to publish and deliver for Intel this quarter.

@jnsgruk
Copy link
Member

jnsgruk commented Dec 10, 2024

https://forum.snapcraft.io/t/track-request-for-gimp/44274

Once we have the new track, I can help with the branch/credential plumbing here.

@frenchwr
Copy link
Author

Amazing! Thanks so much @jnsgruk .

@frenchwr
Copy link
Author

@jnsgruk I went ahead and put in a request for adding autoconnections for the new plugs to the snap here: https://forum.snapcraft.io/t/interface-autoconnections-request-for-gimp-track-2-99-openvino/44296

Assuming everything looks good, would you mind dropping a +1 in that thread since you're the snap maintainer?

@lucyllewy
Copy link
Member

It's important to note for Canonicalers that the snapcrtafters community do not have access to your internal Jira, so there's not much we can gain from the Jira link being put right at the top of a PR indicating it as the most important part of the comment.

@frenchwr
Copy link
Author

It's important to note for Canonicalers that the snapcrtafters community do not have access to your internal Jira, so there's not much we can gain from the Jira link being put right at the top of a PR indicating it as the most important part of the comment.

@lucyllewy Point taken, I removed the link. :) I'm in the habit of dropping link in the PR description because it enables some automation with Jira, but that only works for repos under the Canonical org.

@frenchwr
Copy link
Author

@jnsgruk Looks like the new track in the store was created (link)! 🥳

Let me know if there is anything I can do to help publish to the new track.

@jnsgruk jnsgruk changed the base branch from preview to 2.99-openvino December 17, 2024 10:07
@jnsgruk
Copy link
Member

jnsgruk commented Dec 17, 2024

Heyo 👋🏻 I've set up the CI environment and created the 2.99-openvino branch in this repo, and retargeted this PR so it's merging into that branch.

I also pushed some changes to the CI so that this branch is all wired up correctly. If you're happy to mark this as ready, I think we're good to go from a plumbing perspective 🙂

@jnsgruk
Copy link
Member

jnsgruk commented Dec 17, 2024

One thing I haven't done is wire up the auto-updater version bump thingy for this track - I think we should wait until there is 3.0 support for that and just merge into the stable track at that point.

@frenchwr frenchwr force-pushed the 2.99.16-openvino-ai-plugins branch from bf7e9a9 to 0baf5e3 Compare December 17, 2024 15:11
@frenchwr frenchwr marked this pull request as ready for review December 17, 2024 15:30
@frenchwr
Copy link
Author

Thanks, @jnsgruk ! Just marked it as ready for review.

Copy link
Member

@jnsgruk jnsgruk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two minor things in README then I think I'll merge and we'll see how the release goes!

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@frenchwr
Copy link
Author

Two minor things in README then I think I'll merge and we'll see how the release goes!

Glad you caught that as there were a few other sections of the README that needed to be tweaked as well. I left the interface connection blocks for now but hopefully those can be removed soon once the autoconnections are approved.

@jnsgruk jnsgruk merged commit a24d857 into snapcrafters:2.99-openvino Dec 17, 2024
1 check passed
@jnsgruk
Copy link
Member

jnsgruk commented Dec 17, 2024

Keep an eye out here! https://github.com/snapcrafters/gimp/actions/runs/12377350056

If we're successful, there should be a Call For Testing issue opened automatically once it's built.

@frenchwr frenchwr deleted the 2.99.16-openvino-ai-plugins branch December 17, 2024 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants