onnxruntime/csharp/sample/InferenceSample
Yi Zhang 3252ff2cb7
Change DML GPU pool in Windows GPU workflow use Visual Studio 2022 (#16784)
### Description
1. use the pool with VS2022
2. upgrade System.Memory to 4.5.5


### Motivation and Context
Solve the build error while using VS2022:
`[Failure] Msbuild failed when processing the file
'D:\a\_work\1\s\csharp\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj'
with message: Method not found: 'System.ReadOnlySpan`1<Char>
Microsoft.IO.Path.GetFileName(System.ReadOnlySpan`1<Char>)'`

Ref:
https://stackoverflow.com/questions/73399777/azure-build-failing-due-to-method-not-found-system-readonlyspan1char-micros
2023-07-23 10:07:21 +08:00
..
Microsoft.ML.OnnxRuntime.InferenceSample [C#] Implement OrtValue APIs (#16206) 2023-06-29 08:59:23 -07:00
Microsoft.ML.OnnxRuntime.InferenceSample.Forms Update Xamarin sample code (#9925) 2021-12-07 16:18:58 +10:00
Microsoft.ML.OnnxRuntime.InferenceSample.Forms.Android Change DML GPU pool in Windows GPU workflow use Visual Studio 2022 (#16784) 2023-07-23 10:07:21 +08:00
Microsoft.ML.OnnxRuntime.InferenceSample.Forms.iOS Change DML GPU pool in Windows GPU workflow use Visual Studio 2022 (#16784) 2023-07-23 10:07:21 +08:00
Microsoft.ML.OnnxRuntime.InferenceSample.Maui Add MAUI csharp\sample\InferenceSample\ project (#12356) 2022-07-29 07:22:36 +10:00
Microsoft.ML.OnnxRuntime.InferenceSample.NetCoreApp [C#] Implement OrtValue APIs (#16206) 2023-06-29 08:59:23 -07:00
readme.md Update Xamarin sample code (#9925) 2021-12-07 16:18:58 +10:00

To test the iOS or Android samples the native build of ONNX Runtime is required and must be in a specific location.

Only the native build for the platform you are testing on is required. e.g. if you're testing using an Android device that is arm64, you only need the libonnxruntime.so for arm64-v8a. The version of the native build should match the checked-out version of the ONNX Runtime repository you're currently using as closely as possible. Otherwise mismatches with the native entry points is possible and could cause crashes.

To acquire the native build you can:

  • build it yourself
    • Android build instructions
    • iOS build instructions
  • extract it from the Microsoft.ML.OnnxRuntime nuget package using NuGetPackageExplorer
    • release version is here
    • integration test version is here
      • this is frequently updated and should work if you're currently using the master branch of ONNX Runtime
  • or if you have access to the internal packaging pipelines
    • the Zip-Nuget-Java-Nodejs Packaging Pipeline produces the native package as an artifact under drop-signed-nuget-CPU
      • run a build for your current branch in the pipeline to ensure the native build matches exactly

For iOS the native build should be at one or more of:

  • \build\iOS\iphoneos\Release\Release-iphoneos\onnxruntime.framework for an iOS device
  • \build\iOS\iphonesimulator\Release\Release-iphonesimulator\onnxruntime.framework for an iOS simulator

For Android the native build should be at one or more of:

  • \build\Android\arm64-v8a\Release\libonnxruntime.so for an 64-bit arm device
  • \build\Android\armeabi-v7a\Release\libonnxruntime.so for an 32-bit arm device
  • \build\Android\x86\Release\libonnxruntime.so for an x86 Android emulator
  • \build\Android\x86_64\Release\libonnxruntime.so for an x86_64 Android emulator