Add Windows ARM64 Build Support #654
Open
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.
This PR adds native Windows ARM64 build support to the OBS Background Removal plugin, enabling the plugin to run on ARM64 Windows devices such as Snapdragon X Elite/Plus laptops and future ARM-based Windows systems.
Changes Made
1. CMake Build Configuration (
CMakePresets.json)windows-arm64preset for Visual Studio 2022 with ARM64 toolchainwindows-arm64-insiderspreset for Visual Studio 2026 Insiders2. Dependency Management (
buildspec.json)obs-deps(prebuilt dependencies)qt6(Qt6 framework)obs-studio(OBS Studio sources)3. ONNX Runtime Support (
cmake/FetchOnnxruntime.cmake)4. Source Code Updates (
src/ort-utils/ort-session-utils.cpp)!defined(DISABLE_ONNXRUNTIME_GPU)5. CI/CD Pipeline (
.github/workflows/build-project.yaml)windows-arm64-buildjob for automated ARM64 buildsTechnical Details
Architecture Decisions
CPU-Only Inference on ARM64
Dynamic vs Static Linking
Qt Framework
Build Commands
Local Development (VS 2026 Insiders with ARM64 tools):
Local Development (VS 2022 with ARM64 tools installed):
CI/CD:
The GitHub Actions workflow automatically builds ARM64 artifacts alongside x64 builds.
Known Limitations
The build currently fails at the linking stage due to missing ARM64 OpenCV static libraries. The pre-built OpenCV packages at https://github.com/obs-ai/obs-backgroundremoval-dep-opencv/releases/ do not yet include ARM64 builds.
Required Action:
cmake/FetchOpenCV.cmakeneeds to be updated with ARM64 library paths once availableWorkaround:
Maintainers or contributors with ARM64 build environments can:
FetchOpenCV.cmaketo reference the ARM64 library locationsTesting
Benefits
Files Changed
CMakePresets.jsonbuildspec.jsoncmake/FetchOnnxruntime.cmakesrc/ort-utils/ort-session-utils.cpp.github/workflows/build-project.yamlRelated Issues
Closes #[issue number if applicable]
Additional Notes
This PR establishes the complete ARM64 build infrastructure. Once OpenCV ARM64 libraries become available, the plugin will build and run natively on ARM64 Windows with no additional changes required.