Error Loading lvanlys.dll in LabVIEW. Initialization Routine Failed

Updated May 3, 2023

Reported In

Software

  • LabVIEW 2019 SP1
  • LabVIEW 2019
  • LabVIEW 2018 SP1
  • LabVIEW 2018
  • LabVIEW 2017 SP1
  • LabVIEW 2017
  • LabVIEW 2016
  • LabVIEW 2015 SP1

Operating System

  • Windows

Issue Details

When I run my LabVIEW vi which contains functions like the Mean.vi which in turn uses the lvanlys.dll, I get the error message below.
I use a LabVIEW version which is or is older than 2019 SP1 on a Windows 10 machine. 

Error loading "C:\Program Files\National Instruments\LabVIEW version\resource\lvanlys.dll"
A dynamic link library (DLL) initialization routine failed.
Error message
 

Solution

In LabVIEW version 2019 SP1 and older is a bug which can lead to this error message. In newer versions this bug was fixed. This issue is often related to Intel's Math Kernel Library (MKL), it is called by LabVIEW when using math functions.

The issue can be resolved for affected versions by setting a user and a system variable on your system. To set these variables will also influence all applications using MKL, not only NI Software.
In the following the process is described for Windows 10. 

Please follow the steps below to set the user and system variables:
  1. Open Control Panel >> System and Security >> System
  2. Click Advanced system settings
Advances System Settings
  1. Click Environment Variable on the Advanced tab
System Properties
  1. Click New to create a user variable
Environment Variables
  1. Enter MKL_DEBUG_CPU_TYPE as Variable name, as Variable value, then click OK Add variable
  2. Click New to create system variables
Environment variables
  1. Type MKL_DEBUG_CPU_TYPE as Variable name, 4 as Variable value, then click OK
Add variables
  1. Select OK in Environment Variables window
Ok step
  1. Select OK in System Properties window
Ok step
  1. Restart your computer.
 
 

Additional Information


 

Was this information helpful?

Yes

No