Quantcast
Channel: Intel® oneAPI Math Kernel Library & Intel® Math Kernel Library
Viewing all articles
Browse latest Browse all 2652

Loading MKL 2020 mkl_core.dll resets the DLL search order on Windows

$
0
0

Hello,

this issue was reported at <https://github.com/numpy/numpy/issues/15431>

Loading the `mkl_core.dll` from MKL 2020 resets the DLL search order, probably by calling `SetDllDirectoryA(NULL)`.

This breaks any application relying on the DLL search order set by `SetDllDirectory`.

MKL 2019.5 does not reset the DLL search order.

Here's a Python 3.8 script using numpy+mkl and pywin32 demonstrating the issue:

Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys, ctypes, win32api
>>> mklpath = sys.prefix + '/Lib/site-packages/numpy/DLLs'>>> win32api.SetDllDirectory(mklpath)
>>> print(win32api.GetDllDirectory())
X:\Python38/Lib/site-packages/numpy/DLLs
>>> ctypes.CDLL(mklpath + '/mkl_core.dll')
<CDLL 'X:\Python38\Lib\site-packages\numpy\DLLs\mkl_core.dll', handle 7fff323a0000 at 0x11e427c0af0>
>>> print(win32api.GetDllDirectory())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
pywintypes.error: (0, 'GetDllDirectory', 'No error message is available')

 


Viewing all articles
Browse latest Browse all 2652

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>