Skip to content

Update onnxruntime to version 1.26.0, add OpenVINO build flags#1769

Merged
saudet merged 32 commits into
bytedeco:masterfrom
barrypitman:codex/update-onnxruntime-to-version-1.26.0
May 26, 2026
Merged

Update onnxruntime to version 1.26.0, add OpenVINO build flags#1769
saudet merged 32 commits into
bytedeco:masterfrom
barrypitman:codex/update-onnxruntime-to-version-1.26.0

Conversation

@barrypitman
Copy link
Copy Markdown
Contributor

Once the OpenVINO changes are merged, we can declare an optional dependency on the OpenVINO preset (I think).

@saudet saudet requested a review from blueberry May 18, 2026 03:20
@blueberry
Copy link
Copy Markdown
Contributor

I built the CPU version on my Arch linux. It succeeded (with manual changes for the abseil problem specific for arch, not in general) and now I'm trying to build CUDA.

@blueberry
Copy link
Copy Markdown
Contributor

I am not sure that we need openvino on macos-arm64. It might work, but if it's anything like the dnnl build for macos, it's much slower than coreml that is already supproted, and surely slower than MLX, which we can add as a new preset not unlike openvino. So if ovenvino does not build on that platform, I think we should stick to linux and windows x86_64, and support macos with its own optimized backends.

@barrypitman
Copy link
Copy Markdown
Contributor Author

@m1ngyuan requested the MacOS support for OpenVINO on this PR so would be interesting to hear what they think

@barrypitman
Copy link
Copy Markdown
Contributor Author

I have updated the PR so that it references the new OpenVINO preset.

I found that ONNX Runtime’s native build.py invokes CMake which calls find_package(OpenVINO REQUIRED) before JavaCPP has a chance to unpack OpenVINO resources from the Maven dependency jars.

That is why I added this line (cd "$TOP_PATH" && bash cppbuild.sh install openvino -platform "$PLATFORM"). The alternative is that we could simply install openvino using pip, I'm not sure what is preferred.

I'd like to test the OpenVINOExecutionProviderSample locally, @saudet maybe you could advise - how/when would we push snapshot builds to Sonatype?

@saudet
Copy link
Copy Markdown
Member

saudet commented May 18, 2026

The build already gets the OpenVINO binaries from Maven. Use those

@barrypitman
Copy link
Copy Markdown
Contributor Author

I think that we'd need to use the maven dependency plugin to unpack the relevant openvino JAR file in the maven validate goal, is that what you had in mind?

When running the cppbuild.sh script (in the maven initialize lifecycle phase), it is looking for the OpenVINOConfig.cmake file, but the maven dependencies are only extracted / unpacked later in the build (during generate-sources).

@saudet
Copy link
Copy Markdown
Member

saudet commented May 18, 2026

If it needs OpenVINOConfig.cmake add it to the Maven artifact, that's what it's for

@saudet
Copy link
Copy Markdown
Member

saudet commented May 18, 2026

Anything added to buildResources like this will get extracted in time for the cppbuild.sh script:
https://github.com/bytedeco/javacpp-presets/blob/master/opencv/pom.xml#L105-L111

…e/providers/openvino/ov_factory.cc:10:10: fatal error: format: No such file or directory

                                      10 | #include <format>
                                         |          ^~~~~~~~
                                   compilation terminated.
Comment thread onnxruntime/cppbuild.sh Outdated
Comment thread onnxruntime/cppbuild.sh
Comment thread onnxruntime/pom.xml
Comment thread onnxruntime/pom.xml Outdated
@saudet
Copy link
Copy Markdown
Member

saudet commented May 20, 2026

And we'll need this patch to get the build working for CUDA on Windows:

…NOExecutionProviderSample confirmed working on linux x86-64 (via WSL)
…e only try load onnxruntime_providers_cuda for CUDA-enabled builds
…envino on platforms that don't build it.
Comment thread onnxruntime/cppbuild.sh Outdated
barrypitman and others added 6 commits May 21, 2026 22:23
…ut macro.

CUDA 13 CCCL headers use __out as a parameter name in generated PTX helpers.
If Windows/SAL headers are included later while cub.cuh is being parsed, __out
can be redefined and expanded away, producing invalid code such as "=r"( [0]).
Preloading windows.h lets the existing ORT wrapper undefine __out for the full
CUB/CCCL include.
Comment thread onnxruntime/cppbuild.sh Outdated
@saudet saudet merged commit a1c0061 into bytedeco:master May 26, 2026
7 checks passed
@blueberry
Copy link
Copy Markdown
Contributor

@saudet It seems that the github action that should have deployed this stalled https://github.com/bytedeco/javacpp-presets/actions/runs/26425638965/job/77857915571

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