Add Windows ARM64 Build Support#654
Conversation
|
We are planning to adopt vcpkg for dependencies. Can you wait for this? |
|
No problem my end. |
|
I forgot to say this: Thank you for the contribution, I appreciate your work and we will do best effort to include your proposition ❤️ |
|
We uses static-version of ONNX Runtime because of dependency hell of DirectML, but now ONNX Runtime ships with WinML and the situation would be better than that time. |
|
#655 may be related with this PR. |
|
We are considering of adopting WinML for the next stable release. Will WinML be useful for native ARM64 build? |
|
@MrHinsh Hey we updated the dependency management system for both OpenCV and ONNX Runtime.. |
|
I'm pretty sure I gave you permission to click the update button. Let me check. |
|
AHH, conflicts |
|
Stalled? |
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.