machinelearning icon indicating copy to clipboard operation
machinelearning copied to clipboard

MacOS CI legs throwing DllNotFoundException for MklImports

Open najeeb-kazmi opened this issue 7 years ago • 2 comments

Related to #3722

The MacOS CI legs in multiple PRs are throwing DllNotFoundException for MklImports.dll.

E.g. #3676 #3682 #3693

Error Message: System.TypeInitializationException : The type initializer for 'Microsoft.ML.TestFramework.BaseTestClass' threw an exception. ---- System.DllNotFoundException : 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 Stack Trace: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at ReflectionAbstractionExtensions.<>c__DisplayClass0_0.b__0() in C:\Dev\xunit\xunit\src\xunit.execution\Extensions\ReflectionAbstractionExtensions.cs:line 42 at ReflectionAbstractionExtensions.CreateTestClass(ITest test, Type testClassType, Object[] constructorArguments, IMessageBus messageBus, ExecutionTimer timer, CancellationTokenSource cancellationTokenSource) in C:\Dev\xunit\xunit\src\xunit.execution\Extensions\ReflectionAbstractionExtensions.cs:line 42 ----- Inner Stack Trace ----- at Microsoft.ML.Internal.Internallearn.Test.GlobalBase.Mkl.PptrfInternal(Layout layout, UpLo uplo, Int32 n, Double[] ap) at Microsoft.ML.Internal.Internallearn.Test.GlobalBase.AssemblyInit() in /Users/vsts/agent/2.150.3/work/1/s/test/Microsoft.ML.TestFramework/GlobalBase.cs:line 30 at Microsoft.ML.TestFramework.BaseTestClass..cctor() in /Users/vsts/agent/2.150.3/work/1/s/test/Microsoft.ML.TestFramework/BaseTestClass.cs:line 22

najeeb-kazmi avatar May 09 '19 18:05 najeeb-kazmi

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

rpln avatar Oct 03 '19 17:10 rpln

Fixed after changing CI templates to install libomp version 7.0.0 instead of the latest version.

najeeb-kazmi avatar Apr 02 '20 21:04 najeeb-kazmi