Skip to content

[OpenVINO] Windows Support#18678

Open
suryasidd wants to merge 4 commits intopytorch:mainfrom
suryasidd:ov_windows_support
Open

[OpenVINO] Windows Support#18678
suryasidd wants to merge 4 commits intopytorch:mainfrom
suryasidd:ov_windows_support

Conversation

@suryasidd
Copy link
Copy Markdown
Collaborator

Summary

This PR enables windows support for OpenVINO backend in executorch.

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Apr 2, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18678

Note: Links to docs will display an error until the docs builds have been completed.

❌ 1 New Failure, 1 Cancelled Job, 3 Unrelated Failures

As of commit f62b9be with merge base 28f3cf3 (image):

NEW FAILURE - The following job has failed:

CANCELLED JOB - The following job was cancelled. Please retry:

FLAKY - The following job failed but was likely due to flakiness present on trunk:

BROKEN TRUNK - The following jobs failed but was present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

Copilot AI review requested due to automatic review settings April 2, 2026 20:55
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 2, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enables Windows support for the OpenVINO backend by adding Windows-specific dynamic library discovery/loading paths and updating build/docs accordingly.

Changes:

  • Add Windows OpenVINO runtime auto-discovery in Python bindings (DLL path + DLL directory handling).
  • Add Windows dynamic loading support in the C++ OpenVINO runtime (LoadLibrary/GetProcAddress + FreeLibrary).
  • Update OpenVINO backend build flags for MSVC and extend README instructions for Windows.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
extension/pybindings/portable_lib.py Detect openvino_c.dll on Windows and set OPENVINO_LIB_PATH / DLL search directory.
backends/openvino/runtime/OpenvinoBackend.cpp Use LoadLibrary/GetProcAddress on Windows; keep dlopen/dlsym on non-Windows.
backends/openvino/runtime/OpenvinoApi.h Add Windows header include and close library handles via FreeLibrary on Windows.
backends/openvino/README.md Document Windows quick start, env var setup, and build steps.
backends/openvino/CMakeLists.txt Use MSVC-compatible RTTI/exception flags (/GR, /EHsc) on Windows.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 80 to 83
logger.error(
"Failed to add the pybinding extension DLL to the search path. The extension may not work.",
e,
)
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

logger.error() is called with an extra positional argument (the exception) but the message string has no %s placeholder. The logging module will attempt %-formatting and can raise a TypeError, masking the original failure. Use logger.exception(...), or include a %s placeholder / pass exc_info=True.

Copilot uses AI. Check for mistakes.
target_compile_options(openvino_backend PRIVATE -frtti -fexceptions)
target_compile_options(
openvino_backend
PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/GR /EHsc>
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

The MSVC generator expression contains a space ($<$<CXX_COMPILER_ID:MSVC>:/GR /EHsc>), which CMake will tokenize into separate arguments and can break the generator expression / pass an invalid flag. Split into two generator expressions (one per flag) or otherwise avoid spaces inside the unquoted expression so both /GR and /EHsc are applied correctly on MSVC.

Suggested change
PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/GR /EHsc>
PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/GR>
$<$<CXX_COMPILER_ID:MSVC>:/EHsc>

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants