Skip to content

Make ONNX Runtime’s DNNL and OpenVINO dependencies optional - #1802

Open
barrypitman wants to merge 4 commits into
bytedeco:masterfrom
barrypitman:onnxruntime-optional-deps
Open

Make ONNX Runtime’s DNNL and OpenVINO dependencies optional#1802
barrypitman wants to merge 4 commits into
bytedeco:masterfrom
barrypitman:onnxruntime-optional-deps

Conversation

@barrypitman

Copy link
Copy Markdown
Contributor

Summary

ONNX Runtime currently inherits the DNNL and OpenVINO presets, causing their native libraries to be loaded even when those execution providers are not required. This can prevent ONNX Runtime from loading on platforms without a corresponding OpenVINO preset, including ARM64.

This change:

  • Marks the DNNL and OpenVINO Maven dependencies as optional.
  • Removes their transitive Java module requirements and preset inheritance.
  • Configures DNNL and OpenVINO preloads dynamically at load time, similar to the approach used for CUDA
  • Adds platform-specific OpenVINO libraries only on supported platforms.
  • Preserves the existing CUDA preload behavior for GPU builds.

This allows the base ONNX Runtime preset to load without requiring OpenVINO or DNNL while retaining support when their native resources are available.

Given that OpenVINO is quite a large dependency, I think that making if optional makes sense.

Also - apologies for not picking up this issue earlier. Currently the onnxruntime preset is not functional on ARM.

@barrypitman
barrypitman marked this pull request as ready for review August 29, 2026 11:55
@saudet
saudet requested a review from blueberry August 30, 2026 01:22

@blueberry blueberry left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I tried the latest snapshots (onnxruntime-platform-1.28.0-1.5.15-20260828.110255-3) and it my tests pass (the CUDA problem from the other issue is still there, but it is unrelated to this PR). So, if this change is available in the snapshot, it works.

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.

2 participants