Enable native ARM64 (aarch64) Docker build (#2648)#4343
Open
exzile wants to merge 1 commit into
Open
Conversation
Build and run OpenVINO Model Server natively on aarch64 Linux as a CPU-only image. All changes are architecture-conditional; the x86_64 build path and outputs are unchanged (defaults verified identical). Nothing is removed — unlike the earlier draft openvinotoolkit#2485 which deleted S3FileSystem and hard-swapped lib paths (regressing x86). - Makefile: TARGETARCH (amd64/arm64) selects --platform, the OpenVINO lib subdir (intel64/aarch64) and the control-flow-protection flag; the GPU release image variant is restricted to amd64. - Dockerfile.ubuntu: arch-conditional Bazel install (arm64 standalone binary), parameterized OV runtime lib dir, arch-conditional control-flow flag, skip x86-only intel-opencl-icd and the Intel GPU driver install on arm64, and an arch-agnostic bazel-out glob. - common_settings.bzl: control-flow protection via select() — -fcf-protection=full on x86, -mbranch-protection=standard on aarch64. - third_party/opencv/install_opencv.sh: same control-flow flag selection. - third_party/openvino/BUILD: link libopenvino.so from lib/aarch64 on ARM. - src/main_capi.c: compare the C-API smoke-test output with a tolerance instead of an exact memcmp (ARM CPU defaults to f16 inference precision, so the exact f32 match spuriously failed). No-op on x86. - create_package.sh: arch-agnostic bazel-out glob; $(uname -m) multiarch dir for libOpenCL (tolerate absent on CPU-only ARM); OpenVINO runtime lib dir intel64/aarch64; guard patchelf of libopenvino_tokenizers.so (not shipped in the aarch64 OpenVINO GenAI package). - docs/build_from_source.md: TARGETARCH option and a "Building for ARM64" section. Validated on a native ubuntu-24.04-arm runner: build -> capi-build -> pkg -> release all build, and the resulting image runs (ovms --version) and serves the dummy model on the aarch64 CPU plugin with /v2/health/ready returning 200. Closes openvinotoolkit#2648 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Enables building and running OpenVINO Model Server natively on aarch64 (ARM64) Linux as a CPU-only image, addressing #2648.
Every change is architecture-conditional — the
x86_64build path and its outputs are unchanged (theamd64defaults are byte-for-byte identical). Nothing is removed. This intentionally differs from the earlier draft #2485, which deletedS3FileSystemand hard-swapped lib paths (regressing x86).Scope
BASE_OS=ubuntu22) using pre-built OpenVINO binaries (OV_USE_BINARY=1). The OpenVINO GenAI nightlies publishaarch64archives for Ubuntu 22.04 only, hence ubuntu22.Changes
TARGETARCH(amd64/arm64) selects--platform, the OpenVINO lib subdir (intel64/aarch64) and the control-flow-protection flag; the GPU release-image variant is restricted to amd64.intel-opencl-icdand the Intel GPU driver install on arm64, arch-agnosticbazel-outglob.select()—-fcf-protection=fullon x86,-mbranch-protection=standardon aarch64.libopenvino.sofromlib/aarch64on ARM.memcmp— ARM CPU defaults to f16 inference precision, so the exact f32 match spuriously failed. No-op on x86.bazel-outglob;$(uname -m)multiarch dir for libOpenCL (tolerated absent on CPU-only ARM); OpenVINO runtime lib dirintel64/aarch64; guardpatchelfoflibopenvino_tokenizers.so(not shipped in the aarch64 GenAI package).TARGETARCHoption and a "Building for ARM64 (aarch64)" section.How to build
make release_image \ TARGETARCH=arm64 BASE_OS=ubuntu22 OV_USE_BINARY=1 \ DLDT_PACKAGE_URL=<aarch64 OpenVINO GenAI package> \ GPU=0 MEDIAPIPE_DISABLE=1 PYTHON_DISABLE=1Validation
Built and run on a native
ubuntu-24.04-armrunner:build → capi-build → pkg → releaseall build successfully.ovms --versionreports OpenVINO Model Server 2026.3.0 / OpenVINO backend 2026.3.0.dummymodel on the aarch64 CPU plugin;/v2/health/readyreturns200.Questions for maintainers
libopenvino_tokenizers.sois not present in the aarch64 OpenVINO GenAI package, so the tokenizers extension is unavailable on ARM (logged as a non-fatal warning). Flagging in case that package should also ship the aarch64 tokenizers library.Closes #2648