Skip to content

1.24.1 nuget package is broken on linux #27263

@ispysoftware

Description

@ispysoftware

Describe the issue

When we deploy our net 10 app to a linux x64 (ubuntu, glibc 2.35) target we get

The type initializer for 'Microsoft.ML.OnnxRuntime.NativeMethods' threw an exception. at Microsoft.ML.OnnxRuntime.SessionOptions..ctor()
at CoreLogic.AI.ONNX.ModelHelper.BuildOptions(Boolean useGPU)
at CoreLogic.AI.ONNX.ModelHelper.<>c__DisplayClass9_0.b__1()
at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy`1.CreateValue()
at CoreLogic.AI.ONNX.ModelHelper.GetOrCreateSession(Boolean useGPU)
at CoreLogic.AI.ONNX.ModelHelper.GetSession(Boolean useGPU)
at CoreLogic.AI.ObjectRecognizerInternal.RunDetect(Mat analysisFrame)
RunDetect: Camera 1: Unable to load shared library 'onnxruntime.dll' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable:
/home/sean/Desktop/Agent7200/onnxruntime.dll.so: cannot open shared object file: No such file or directory
/home/sean/Desktop/Agent7200/libonnxruntime.dll.so: cannot open shared object file: No such file or directory
/home/sean/Desktop/Agent7200/onnxruntime.dll: cannot open shared object file: No such file or directory
/home/sean/Desktop/Agent7200/libonnxruntime.dll: cannot open shared object file: No such file or directory

it looks like the managed wrapper is looking for a dll file on linux - not going to work

rolling back to 1.23.2 it works (segfaults, but that's another issue).
using the Microsoft.ML.OnnxRuntime nuget package

To reproduce

Try running an app using this nuget package on linux x64

Urgency

No response

Platform

Linux

OS Version

22.04

ONNX Runtime Installation

Released Package

ONNX Runtime Version or Commit ID

1.24.1

ONNX Runtime API

C#

Architecture

X64

Execution Provider

Default CPU

Execution Provider Library Version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETPull requests that update .net codeapi:CSharpissues related to the C# API

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions