sherpa-onnx icon indicating copy to clipboard operation
sherpa-onnx copied to clipboard

libonnxruntime.so: version `VERS_1.17.1' not found

Open ZhenyaPav opened this issue 10 months ago • 6 comments

System.DllNotFoundException: Unable to load shared library '/home/zhenyapav/Projects/test/data_AI_Desktop_Companion_linuxbsd_x86_64/libsherpa-onnx-c-api.so' 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/zhenyapav/Projects/test/data_AI_Desktop_Companion_linuxbsd_x86_64/libonnxruntime.so: version `VERS_1.17.1' not found (required by /home/zhenyapav/Projects/test/data_AI_Desktop_Companion_linuxbsd_x86_64/libsherpa-onnx-c-api.so)

   at System.Runtime.InteropServices.NativeLibrary.<LoadFromPath>g____PInvoke|1_0(UInt16* __libraryName_native, Int32 __throwOnError_native)
   at System.Runtime.InteropServices.NativeLibrary.<LoadFromPath>g____PInvoke|1_0(UInt16* __libraryName_native, Int32 __throwOnError_native)
   at System.Runtime.Loader.AssemblyLoadContext.LoadUnmanagedDllFromPath(String unmanagedDllPath)
   at System.Runtime.Loader.AssemblyLoadContext.ResolveUnmanagedDll(String unmanagedDllName, IntPtr gchManagedAssemblyLoadContext)
   at SherpaOnnx.OfflineTts.SherpaOnnxDestroyOfflineTts(IntPtr handle)
   at SherpaOnnx.OfflineTts.SherpaOnnxDestroyOfflineTts(IntPtr handle)
   at SherpaOnnx.OfflineTts.Cleanup()
   at SherpaOnnx.OfflineTts.Finalize()
   at System.GC.RunFinalizers()

I get this error when trying to use MeloTTS in C#. Possibly related to https://github.com/k2-fsa/sherpa-onnx/issues/1081

ZhenyaPav avatar Jan 27 '25 17:01 ZhenyaPav

I should also point out that the same project works on Windows, seems to be a Linux-only issue. csproj:

<Project Sdk="Godot.NET.Sdk/4.3.0">
  <PropertyGroup>
    <TargetFramework>net9.0</TargetFramework>
    <EnableDynamicLoading>true</EnableDynamicLoading>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="FFMpegCore" Version="5.1.0" />
    <PackageReference Include="OpenAI" Version="2.0.0" />
    <PackageReference Include="SharpCompress" Version="0.38.0" />
    <PackageReference Include="Tiktoken" Version="2.2.0" />
    <PackageReference Include="Whisper.net.Runtime.Vulkan" Version="1.7.4" />
    <PackageReference Include="Whisper.net.Runtime" Version="1.7.4" />
    <PackageReference Include="Whisper.net.Runtime.NoAvx" Version="1.7.4" />
    <PackageReference Include="Whisper.net" Version="1.7.4" />
    <PackageReference Include="EchoSharp" Version="0.1.0" />
    <PackageReference Include="EchoSharp.Onnx.Sherpa" Version="0.1.0" />
    <PackageReference Include="EchoSharp.Onnx.SileroVad" Version="0.1.0" />
    <PackageReference Include="EchoSharp.Whisper.net" Version="0.1.0" />
    <PackageReference Include="NAudio.Core" Version="2.2.1" />
    <PackageReference Include="org.k2fsa.sherpa.onnx" Version="*" />
  </ItemGroup>
</Project>

ZhenyaPav avatar Jan 27 '25 17:01 ZhenyaPav

Are you able to run our dotnet example projects?

csukuangfj avatar Jan 27 '25 23:01 csukuangfj

Hello @csukuangfj. Yes, I was able to run kokoro-tts example. The issue seems to be caused by EchoSharp.Onnx.Sherpa package, which depends on Microsoft.ML.OnnxRuntime >= 1.20.0

ZhenyaPav avatar Jan 28 '25 13:01 ZhenyaPav

@ZhenyaPav

Please follow https://github.com/k2-fsa/sherpa-onnx/pull/1719 to build sherpa-onnx using the same onnxruntime version as EchoSharp.Onnx.Sherpa.

csukuangfj avatar Jan 28 '25 14:01 csukuangfj

Built the library for onnx runtime 1.20, this fixed the error.

ZhenyaPav avatar Feb 01 '25 09:02 ZhenyaPav

Note that not all.models from sherpa-onnx work for onnxruntime 1.20

csukuangfj avatar Feb 01 '25 10:02 csukuangfj