-
Notifications
You must be signed in to change notification settings - Fork 28
Add OpenVINO AI Plugins to Preview Track #325
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
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
773bcb2
feature: integrate OpenVINO AI plugins
frenchwr 0baf5e3
ci: update workflows for 2.99-openvino track
jnsgruk bb514f0
readme: remove TODOs and improve setup instructions
frenchwr a24d857
Merge pull request #304 from frenchwr/2.99.16-openvino-ai-plugins
jnsgruk 721184e
fix: remove arch hard-coding
frenchwr c102caf
Merge pull request #308 from frenchwr/2.99-openvino
jnsgruk c831cd4
feature: switch to personal-files interface as a less intrusive locat…
frenchwr 563d682
fix: add plug-declaration to unblock build
frenchwr 9a01d30
fix: use fixed source for command-chain scripts
frenchwr b0271b7
Merge pull request #310 from frenchwr/2.99-openvino
jnsgruk c425397
readme: remove section for manually connecting plugs
frenchwr f07eada
Merge pull request #311 from frenchwr/2.99-openvino
jnsgruk 7adaf40
fix: minor plug-in and extension errors from logs
frenchwr f5da54c
fix: avoid lua goat extension crash loop
frenchwr 1be96f2
Merge pull request #318 from frenchwr/2.99-openvino
jnsgruk 8320af2
chore: bump versions of command-chain scripts for openvino ai plugins…
frenchwr d657297
Merge branch 'preview' into 3.0-openvino
frenchwr 05c687d
chore: update 2.99 paths and commands to 3.0
frenchwr 73d3aef
readme: update instructions for preview branch
frenchwr 59ac8bc
chore: bump ai plugins command-chain version for 3.0 support
frenchwr 1678e50
chore: revert CI to preview branches
frenchwr aa8ac8c
fix: pull new command-chain scripts for arm64 issues
frenchwr 9fcdab4
chore: make openvino command-chain scripts no-ops for arm64
frenchwr 4b2bf71
chore: bump openvino command chain versions for better hardware detec…
frenchwr eed97f2
readme: clarify details about hardware requirements for AI plugins
frenchwr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"personal-files": { "allow-installation": "true" } | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,27 +26,52 @@ layout: | |
/usr/share/locale: | ||
bind: $SNAP/usr/share/locale | ||
|
||
plugs: | ||
ffmpeg-2404: | ||
interface: content | ||
target: ffmpeg-platform | ||
default-provider: ffmpeg-2404 | ||
|
||
slots: | ||
dbus-gimp: | ||
interface: dbus | ||
bus: session | ||
name: org.gimp.GIMP.UI | ||
|
||
plugs: | ||
ffmpeg-2404: | ||
interface: content | ||
target: ffmpeg-platform | ||
default-provider: ffmpeg-2404 | ||
intel-npu: | ||
interface: custom-device | ||
custom-device: intel-npu-device | ||
npu-libs: | ||
interface: content | ||
content: npu-libs-2404 | ||
target: $SNAP/npu-libs | ||
openvino-libs: | ||
interface: content | ||
content: openvino-libs-2404 | ||
target: $SNAP/openvino | ||
openvino-ai-plugins-gimp-libs: | ||
interface: content | ||
content: openvino-ai-plugins-gimp-2404 | ||
target: $SNAP/openvino-ai-plugins-gimp | ||
dot-local-share-openvino-ai-plugins-gimp: | ||
interface: personal-files | ||
write: | ||
- $HOME/.local/share/openvino-ai-plugins-gimp | ||
|
||
environment: | ||
GI_TYPELIB_PATH: $SNAP/gnome-platform/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/gjs/girepository-1.0:$GI_TYPELIB_PATH | ||
LD_LIBRARY_PATH: $SNAP/lib:$SNAP/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:$SNAP/gnome-platform/usr/lib:$SNAP/gnome-platform/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:$SNAP/usr/lib:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/lapack:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/blas | ||
LD_LIBRARY_PATH: $SNAP/lib:$SNAP/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:$SNAP/gnome-platform/usr/lib:$SNAP/gnome-platform/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:$SNAP/usr/lib:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/lapack:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/blas:$SNAP/npu-libs | ||
# Ensure the gmic plugin can correctly locate the QT plugins | ||
QT_PLUGIN_PATH: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/qt6/plugins | ||
GIMP3_LOCALEDIR: $SNAP/usr/share/locale | ||
# Lua goat exercise considered unstable upstream: https://gitlab.gnome.org/GNOME/gimp/-/commit/78665ca3723f723ac313fdaeef5b62d41ab6b48d | ||
# The extension will fail on GIMP startup but commenting these lines avoids the risk of a nasty crash loop | ||
#LUA_PATH: $SNAP/usr/share/lua/5.1/?.lua;$SNAP/usr/share/lua/5.1/lgi/?.lua;$SNAP/usr/share/lua/5.1/lgi/override/?.lua | ||
#LUA_CPATH: $SNAP/usr/lib/x86_64-linux-gnu/lua/5.1/?.so | ||
|
||
apps: | ||
gimp: | ||
command: usr/bin/gimp | ||
command-chain: ["command-chain/openvino-launch", "command-chain/openvino-ai-plugins-gimp-launch"] | ||
extensions: [gnome] | ||
desktop: usr/share/applications/gimp.desktop | ||
common-id: org.gimp.GIMP | ||
|
@@ -63,6 +88,11 @@ apps: | |
- network | ||
- removable-media | ||
- unity7 | ||
- intel-npu | ||
- npu-libs | ||
- openvino-libs | ||
- openvino-ai-plugins-gimp-libs | ||
- dot-local-share-openvino-ai-plugins-gimp | ||
|
||
parts: | ||
babl: | ||
|
@@ -230,6 +260,46 @@ parts: | |
- mypaint-brushes | ||
- mypaint-data | ||
- poppler-data | ||
override-stage: | | ||
# fix gimp python interpreters file | ||
cat <<EOF > ${CRAFT_PART_INSTALL}/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/gimp/3.0/interpreters/pygimp.interp | ||
python=/usr/bin/python3 | ||
python3=/usr/bin/python3 | ||
/usr/bin/python=/usr/bin/python3 | ||
/usr/bin/python3=/usr/bin/python3 | ||
:Python:E::py::python3: | ||
EOF | ||
# update gimp's plugin search path so it will pick up plugins mounted over snapd's content interface | ||
current_path=$(grep "# (plug-in-path" ${CRAFT_PART_INSTALL}/etc/gimp/3.0/gimprc | cut -d '"' -f2) | ||
add_dir=/snap/${SNAPCRAFT_PROJECT_NAME}/current/openvino-ai-plugins-gimp/gimp-plugins | ||
echo "(plug-in-path \"${current_path}:${add_dir}\")" >> ${CRAFT_PART_INSTALL}/etc/gimp/3.0/gimprc | ||
craftctl default | ||
|
||
command-chain-openvino: | ||
plugin: dump | ||
source-type: git | ||
source: https://github.com/canonical/openvino-toolkit-snap.git | ||
source-tag: 2024.6.0-4 | ||
stage: | ||
- command-chain/openvino-launch | ||
override-stage: | | ||
if [ $(uname -m) != "x86_64" ]; then | ||
echo 'exec "$@"' > ${CRAFT_PART_INSTALL}/command-chain/openvino-launch | ||
fi | ||
craftctl default | ||
|
||
command-chain-openvino-ai-plugins-gimp: | ||
plugin: dump | ||
source-type: git | ||
source: https://github.com/canonical/openvino-ai-plugins-gimp-snap.git | ||
source-branch: 3.0.0-2 | ||
stage: | ||
- command-chain/openvino-ai-plugins-gimp-launch | ||
override-stage: | | ||
if [ $(uname -m) != "x86_64" ]; then | ||
echo 'exec "$@"' > ${CRAFT_PART_INSTALL}/command-chain/openvino-ai-plugins-gimp-launch | ||
fi | ||
Comment on lines
+299
to
+301
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Commented above |
||
craftctl default | ||
|
||
gmic: | ||
after: [gimp] | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to just include this check in the script itself and keep the snapcraft.yaml simple? In the end - what matters most is what happens at runtime, so having the command-chain script itself check the arch feels appropriate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the
openvino-launch
command-chain script, my goal is to keep the door open for ARM64 support in the future since the snap itself does support ARM64, even though there is not an existing snap that consumes the ARM64 version. However, we will soon be providing similar plugin support for a few consumer snaps (Audacity and OBS) which may need ARM64 support.For the
openvino-ai-plugins-gimp-launch
command-chain script, there is an Intel CPU check so we don't necessarily need theuname -m
block insnapcraft.yaml
but I chose to keep it there for consistency with the other command-chain section above. I could remove it if you prefer.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, thanks