Skip to content

Add Windows ARM64 CPU support for TorchSharp#1549

Open
alinpahontu2912 wants to merge 1 commit intodotnet:mainfrom
alinpahontu2912:arm64_support
Open

Add Windows ARM64 CPU support for TorchSharp#1549
alinpahontu2912 wants to merge 1 commit intodotnet:mainfrom
alinpahontu2912:arm64_support

Conversation

@alinpahontu2912
Copy link
Member

Add support for building, packaging, and distributing TorchSharp on Windows ARM64 (CPU-only, no CUDA). This enables .NET developers on Windows ARM64 devices to use TorchSharp with the stable LibTorch 2.10.0 release.

Key changes:

  • MSBuild: Add win-arm64 RID mapping, archive name, and cmake path (ARM64 archive has different layout: lib/ instead of libtorch/lib/)
  • Native build: Enable ARM64 cross-compilation from x64 via MSVC amd64_arm64 toolchain and CMake -A ARM64
  • Runtime: Detect win-arm64 in Torch.cs nativeRid for correct native library loading
  • NuGet: Add libtorch-cpu-win-arm64 package and update libtorch-cpu meta-package
  • CI: Add Windows ARM64 PR validation and native build pipeline jobs (cross-compiled on x64 agents)
  • LibTorch: ARM64 uses armpl_lp64.dll (ARM Performance Libraries) instead of Intel OpenMP (libiomp5md.dll)

Add support for building, packaging, and distributing TorchSharp on
Windows ARM64 (CPU-only, no CUDA). This enables .NET developers on
Windows ARM64 devices to use TorchSharp with the stable LibTorch 2.10.0
release.

Key changes:
- MSBuild: Add win-arm64 RID mapping, archive name, and cmake path
  (ARM64 archive has different layout: lib/ instead of libtorch/lib/)
- Native build: Enable ARM64 cross-compilation from x64 via MSVC
  amd64_arm64 toolchain and CMake -A ARM64
- Runtime: Detect win-arm64 in Torch.cs nativeRid for correct native
  library loading
- NuGet: Add libtorch-cpu-win-arm64 package and update libtorch-cpu
  meta-package
- CI: Add Windows ARM64 PR validation and native build pipeline jobs
  (cross-compiled on x64 agents)
- LibTorch: ARM64 uses armpl_lp64.dll (ARM Performance Libraries)
  instead of Intel OpenMP (libiomp5md.dll)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant