-
Notifications
You must be signed in to change notification settings - Fork 213
Windows Arm Support #1493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Windows Arm Support #1493
Conversation
There was a problem hiding this 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 adds Windows ARM64 support to TorchSharp by implementing platform detection, native library loading improvements, and build system modifications to handle ARM64 architecture on Windows.
- Updates runtime identification to detect win-arm64 platform
- Adds explicit dependency chain loading for Windows native libraries
- Includes Windows ARM64-specific LibTorch redistributables and build configurations
Reviewed Changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
src/TorchSharp/Torch.cs | Updates platform detection and native library loading for ARM64 |
src/Redist/libtorch-cpu/*.sha | Adds SHA hashes for ARM64 LibTorch redistributables |
src/Redist/libtorch-cpu/libtorch-cpu.proj | Defines ARM64-specific DLL dependencies |
src/Native/gen-buildsys-win.bat | Adds ARM64 CMake configuration support |
src/Native/build.cmd | Enables ARM64 build architecture and removes conditional vcvarsall calls |
src/Examples.Utils/Examples.Utils.csproj | Updates ImageSharp package version |
pkg/* | Adds ARM64 NuGet package configuration and references |
Directory.Build.* | Configures ARM64 build properties and native assembly references |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
} else { | ||
ok = TryLoadNativeLibraryByName("torch_cpu", typeof(torch).Assembly, trace); | ||
ok = TryLoadNativeLibraryByName("LibTorchSharp", typeof(torch).Assembly, trace); | ||
var isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable isWindows
is redeclared here when it's already available from line 129. Consider reusing the existing variable to avoid duplication.
Copilot uses AI. Check for mistakes.
@@ -17,7 +17,7 @@ | |||
|
|||
<ItemGroup> | |||
<PackageReference Include="SharpZipLib" Version="1.4.0" /> | |||
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.7" /> | |||
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.11" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] This package version update appears unrelated to Windows ARM64 support. Consider separating dependency updates into a separate commit to maintain focused changes.
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.11" /> | |
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.10" /> |
Copilot uses AI. Check for mistakes.
@dotnet-policy-service agree |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Hey @cm4ker, huge thanks for the contribution! Have you had a chance to check that these changes still work on other platforms? Is Windows x64 still all good? Our pipelines don’t yet support Windows arm64, but we’re working on upgrading them so we can support the newer releases we've been working on (moving to the latest libtorch + CUDA) |
@alinpahontu2912 Hi! Unfortunately I haven't x64 device and can't check it =( |
Hi!
I add Windows ARM support with Copilot help (yea there can be some strange style and logic decigions) and check it on Snapdragon X Elite computer for my little project - it works.
Feel free point me or make changes directly.
Partially close #945
Thank you for this great project and make ML happen on dotnet easy!