Skip to content
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

Unable to load shared library 'MklImports' or one of its dependencies. #3903

Open
mphollas opened this issue Jun 23, 2019 · 23 comments

Comments

@mphollas
Copy link

commented Jun 23, 2019

System information

  • Mac 0S Mojave 10.14.3:
  • dotnet --version
    2.2.300
  • Project references
  • Microsoft.ML
  • Microsoft.ML.Mkl.Redis
  • Microsoft.ML.TimeSeries

Issue

Source code / logs

Unable to load shared library 'MklImports' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libMklImports, 1): image not found

at Microsoft.ML.Transforms.TimeSeries.EigenUtils.Dsytrd(Layout matrixLayout, Uplo uplo, Int32 n, Double[] a, Int32 lda, Double[] d, Double[] e, Double[] tau)\n at Microsoft.ML.Transforms.TimeSeries.EigenUtils.MklSymmetricEigenDecomposition(Single[] input, Int32 size, Single[]& eigenValues, Single[]& eigenVectors)\n at Microsoft.ML.Transforms.TimeSeries.TrajectoryMatrix.ComputeSvd(Single[]& singularValues, Single[]& leftSingularvectors)\n at Microsoft.ML.Transforms.TimeSeries.AdaptiveSingularSpectrumSequenceModeler.AdaptiveSingularSpectrumSequenceModelerInternal.TrainCore(Single[] dataArray, Int32 originalSeriesLength)\n at Microsoft.ML.Transforms.TimeSeries.AdaptiveSingularSpectrumSequenceModeler.AdaptiveSingularSpectrumSequenceModelerInternal.Train(RoleMappedData data)\n

@ilias

This comment has been minimized.

Copy link

commented Jul 14, 2019

I got a similar error running an ASP.NET core 2.2 app on a linux64 docker container

fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
An unhandled exception has occurred while executing the request.
System.DllNotFoundException: Unable to load shared library 'MklImports' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libMklImports: cannot open shared object file: No such file or directory
at Microsoft.ML.Transforms.TimeSeries.EigenUtils.Dsytrd(Layout matrixLayout, Uplo uplo, Int32 n, Double[] a, Int32 lda, Double[] d, Double[] e, Double[] tau)
at Microsoft.ML.Transforms.TimeSeries.EigenUtils.MklSymmetricEigenDecomposition(Single[] input, Int32 size, Single[]& eigenValues, Single[]& eigenVectors)
at Microsoft.ML.Transforms.TimeSeries.TrajectoryMatrix.ComputeSvd(Single[]& singularValues, Single[]& leftSingularvectors)
….

@flo8

This comment has been minimized.

Copy link

commented Jul 15, 2019

Hi!

I run into the same exact situation with a .Net Core 2.2 app (console) here using Ubuntu 16.04 x64:
Description: Ubuntu 16.04.6 LTS
Release: 16.04
Codename: xenial

dotnet --version
2.2.300

I get exactly the same exception as described above.

@eduardobr

This comment has been minimized.

Copy link

commented Jul 25, 2019

Same issue in here.
mlnet 0.14.27903.10

.NET Core SDK (reflecting any global.json):
Version: 2.2.401
Commit: 729b316c13

Runtime Environment:
OS Name: Mac OS X
OS Version: 10.14
OS Platform: Darwin
RID: osx.10.14-x64
Base Path: /usr/local/share/dotnet/sdk/2.2.401/

Host (useful for support):
Version: 2.2.6
Commit: 7dac9b1b51

.NET Core SDKs installed:
2.2.301 [/usr/local/share/dotnet/sdk]
2.2.401 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.2.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.2.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.2.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

@Benzidrine

This comment has been minimized.

Copy link

commented Jul 29, 2019

Same issue here

OS Name: Mac OS X
OS Version: 10.14.1
Platform: Darwin

dotnet --version
2.2.300

@wschin

This comment has been minimized.

Copy link
Member

commented Aug 11, 2019

@codemzs, any comment?

@archeg

This comment has been minimized.

Copy link

commented Aug 20, 2019

I have the same issue, but on Windows and 4.6 .Net framework.

OS: Windows 10

.NET Framework 4.6.1

Trying to use Anomaly Detection, only Iid works, SSA and SRCNN do not.
On the same machine, if running on .Net Core 2.2 everything works well

@flo8

This comment has been minimized.

Copy link

commented Aug 23, 2019

Hi @wschin @codemzs !

Is there anything we can do to help you guys move this forward?

Many thanks,

@dhunt84971

This comment has been minimized.

Copy link

commented Sep 6, 2019

Having same issue on Ubuntu 19.04 with AnomalyDetection_PowerMeterReadings.

dotnet --version
2.2.401

mlnet 0.15.28007.4

@flo8

This comment has been minimized.

Copy link

commented Sep 11, 2019

Hi @codemzs @wschin !

How can we help you troubleshoot this?

Cheers

@lessenko

This comment has been minimized.

Copy link

commented Oct 3, 2019

Hi!
I have the same issue.

Runtime Environment:
RID: ubuntu.18.04-x64
Base Path: /usr/share/dotnet/sdk/2.2.401/

I tried the sample "DetectChangePointBySsaStream.cs"
for ML 1.2.0, 1.3.1 and 1.4.0-preview

Thanks

@rpln

This comment has been minimized.

Copy link

commented Oct 3, 2019

Had the precise error described here when using TimeSeries in ML.net and what fixed it for me was installing the Intel MKL: https://software.intel.com/en-us/mkl

In my case specifically, I was working with dotnet via the .NET Core SDK Docker images: https://hub.docker.com/_/microsoft-dotnet-core-sdk/

Within docker (debian base), the fix for me was:

RUN \
  sed -i 's/ main/ main contrib non-free/' /etc/apt/sources.list && \
  apt-get update && \
  DEBIAN_FRONTEND=noninteractive apt-get install -y intel-mkl

I presume similar installs of Intel MKL on non-debian linux or macos are also likely to fix the issue

@flo8

This comment has been minimized.

Copy link

commented Oct 7, 2019

Hi @rpln and thanks for sharing this info!

I also tried it here on our systems but still have the problem. Is there a way to make sure that MKL is correctly installed?

I also didn't find any mention of how to install this dependency on ML.Net website. Trying to Google it didn't give much results as well. @codemzs any idea on this?

Many thanks,

@flo8

This comment has been minimized.

Copy link

commented Oct 8, 2019

Hi all!

Thanks a lot @rpln, after checking this link on SO it seemed that MKL was not correctly installed in our Docker container even if we followed the instructions above. After following this and this, it now seems to work correctly.

It's however a bit sad to see that this MKL thing is currently nowhere to be found on ML.Net documentation and that this ticket has been opened for almost 4 months :(

Thanks a lot to @rpln for your contribution!

Flo

@lessenko

This comment has been minimized.

Copy link

commented Oct 9, 2019

Hi all!

Thanks a lot @rpln and @Flow8 my sample works.
My decision is to put library libiomp5.so from intel-mkl 2019.0.117
into local nuget directory for microsoft.ml.mkl.redist.
Docker is not used.

Regards.

@AceHack

This comment has been minimized.

Copy link

commented Oct 9, 2019

I can't get this working on Mac.

I tried installing MKL from https://software.seek.intel.com/performance-libraries

But it's still failing.

@lessenko

This comment has been minimized.

Copy link

commented Oct 10, 2019

Hi AceHack!
Just in case, libiomp5 has needed definitions for libMklImports (Nuget). It's for Ubuntu.
For Mac I suppose it's analog libMklImports.dylib and libiomp5.dylib
https://software.intel.com/en-us/articles/dyld-library-not-loadedlibiomp5dylib

Nuget local dir for Mac ---.nuget/packages/microsoft.ml.mkl.redist/1.3.1/runtimes/osx-x64/native/


@AceHack

This comment has been minimized.

Copy link

commented Oct 10, 2019

I am running the mlnet global tool, microsoft.ml.mkl.redist is not present in my nuget cache.

@lessenko

This comment has been minimized.

Copy link

commented Oct 10, 2019

Just in case, I use Mono, MonoDevelop and Nuget (in MonoDevelop).

@lessenko

This comment has been minimized.

Copy link

commented Oct 10, 2019

Via NuGet I add only Microsoft.ML.TimeSeries package.
Microsoft.ML.Mkl.Redist is added itself.

@danjagnow

This comment has been minimized.

Copy link

commented Oct 10, 2019

I'm seeing the same thing using Microsoft.ML.TimeSeries 1.3.1 on Windows 10 Enterprise, with a library targeting net48;netstandard2.0 and a unit test project targeting net48.

System.TypeInitializationException : The type initializer for 'Microsoft.ML.Transforms.TimeSeries.FftUtils' threw an exception.
  ----> System.DllNotFoundException : Unable to load DLL 'MklImports': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
   at Microsoft.ML.Transforms.TimeSeries.FftUtils.ComputeForwardFft(Single[] inputRe, Single[] inputIm, Single[] outputRe, Single[] outputIm, Int32 length)
   at Microsoft.ML.Transforms.TimeSeries.SrCnnAnomalyDetectionBase.SrCnnAnomalyDetectionBaseCore.State.SpectralResidual(Single input, FixedSizeQueue`1 data, VBufferEditor`1& result)
   at Microsoft.ML.Transforms.TimeSeries.SrCnnTransformBase`2.SrCnnStateBase.TransformCore(TInput& input, FixedSizeQueue`1 windowedBuffer, Int64 iteration, VBuffer`1& dst)
   at Microsoft.ML.Transforms.TimeSeries.SequentialTransformerBase`3.StateBase.Process(TInput& input, TOutput& output)
   at Microsoft.ML.Transforms.TimeSeries.SrCnnTransformBase`2.Mapper.<>c__DisplayClass16_0.<MakeGetter>b__0(VBuffer`1& dst)
   at Microsoft.ML.Data.TypedCursorable`1.TypedRowBase.<>c__DisplayClass8_0`1.<CreateDirectVBufferSetter>b__0(TRow row)
   at Microsoft.ML.Data.TypedCursorable`1.TypedRowBase.FillValues(TRow row)
   at Microsoft.ML.Transforms.TimeSeries.TimeSeriesPredictionEngine`2.Predict(TSrc example, TDst& prediction, Nullable`1 horizon, Nullable`1 confidenceLevel)
   at Microsoft.ML.Transforms.TimeSeries.TimeSeriesPredictionEngine`2.Predict(TSrc example, Nullable`1 horizon, Nullable`1 confidenceLevel)
@lessenko

This comment has been minimized.

Copy link

commented Oct 11, 2019

I've tried the sample in VS 2017 community on Windows 7 and 10 (dotnet 2.1) at last weekend. It seems it worked without problem.

@AceHack

This comment has been minimized.

Copy link

commented Oct 11, 2019

Still having issue on Mac.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.