Skip to content

Commit a17c25e

Browse files
Revert ARM64 preloading - issue was TFM mismatch, not native loading
The native DLL loading failure was caused by using net8.0 NuGet packages with a net6.0 consuming project, not a missing preload. Reverts the ARM64 preloading added in 33b4855. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f7277c1 commit a17c25e

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

src/TorchSharp/Torch.cs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -154,19 +154,6 @@ private static void LoadNativeBackend(bool useCudaBackend, out StringBuilder? tr
154154
ok = TryLoadNativeLibraryByName("torch_cuda", typeof(torch).Assembly, trace);
155155
ok = TryLoadNativeLibraryByName("LibTorchSharp", typeof(torch).Assembly, trace);
156156
} else {
157-
var isWindowsArm64 = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) &&
158-
RuntimeInformation.ProcessArchitecture == Architecture.Arm64;
159-
if (isWindowsArm64) {
160-
trace.AppendLine($" Try loading Windows ARM64 native components");
161-
// Preloading these DLLs on Windows ARM64 ensures dependencies are resolved
162-
// when loading from NuGet package directories, similar to the CUDA preloading above.
163-
// ARM64 libtorch uses ARM Performance Libraries instead of Intel OpenMP.
164-
ok = TryLoadNativeLibraryByName("armpl_lp64", typeof(torch).Assembly, trace);
165-
ok = TryLoadNativeLibraryByName("uv", typeof(torch).Assembly, trace);
166-
ok = TryLoadNativeLibraryByName("c10", typeof(torch).Assembly, trace);
167-
ok = TryLoadNativeLibraryByName("torch_global_deps", typeof(torch).Assembly, trace);
168-
}
169-
170157
ok = TryLoadNativeLibraryByName("torch_cpu", typeof(torch).Assembly, trace);
171158
ok = TryLoadNativeLibraryByName("LibTorchSharp", typeof(torch).Assembly, trace);
172159
}

0 commit comments

Comments
 (0)