Installation issue

I installed Devsim 2.0.1 and python 3.9.7., encoutner an problem of “ImportError: DLL load failed while importing devsim_py3: module not available”. Anyone has a solution for it?

Hi @maizh
Thanks for trying the software. You need to tell the python interpreter where to find devsim, by setting the PYTHONPATH or using the install.py script. Please see INSTALL.md in the distribution for more details.

The Intel MKL library should also be installed as part of your Anaconda/Miniconda environment.

@maizh , @yw2044163

I forgot to mention that windows will fail with the “ImportError: DLL . . .” above if you have the wrong version of MKL installed:
https://forum.devsim.org/t/new-intel-mkl-issue

Version 2.0.1 of devsim uses the newest MKL, so you can try:

conda install mkl

to get the latest version. If your packages do not work with the newest MKL, you can try devsim version 2.0.0, which uses the previous version of MKL.

1 Like

Thank.
But now when I use
conda install mkl
It installs 2022 version (mkl-2022.0.0-h0e2418a_xxx) with mkl_rt.2.dll
All 2021 versions used mkl_rt.1.dll

you can try that

pip install mkl==2021.4.0

Thanks. Yes, I indeed installed several 2021.x versions that used mkl-rt.1.dll , unfortunately I found many programs cannot run smoothly.
For example, this is what I got when I run the diode_1d.py in the examples folder:

Iteration: 6

  • Device: “MyDevice” RelError: 4.42954e-01 AbsError: 3.95692e-02*
  • Region: “MyRegion” RelError: 4.42954e-01 AbsError: 3.95692e-02*
  •  Equation: "PotentialEquation"     RelError: 4.42954e-01   AbsError: 3.95692e-02*
    

Iteration: 7

  • Device: “MyDevice” RelError: 6.44444e-02 AbsError: 2.91367e-02*
  • Region: “MyRegion” RelError: 6.44444e-02 AbsError: 2.91367e-02*
  •  Equation: "PotentialEquation"     RelError: 6.44444e-02   AbsError: 2.91367e-02*
    

Matrix factorization failed
Traceback (most recent call last):

  • File “diode_1d.py”, line 43, in *
  • solve(type=“dc”, absolute_error=1.0, relative_error=1e-10, maximum_iterations=30)*
    devsim_py3.error: Convergence failure!

Convergence failure error were found everywhere. For this example program, I tested different absolute_error setting, even set back to 1E10 as previous version did and increased the maximum_iterations to 1E5, did not help.
I tested both Msys and win64 packages for windows, I did not find any difference. The CPU that I used is: 11th Gen Intel(R) Core™ i7-1195G7 @ 2.90GHz, 4 Core(s), 8 Logical Processor(s).
I now switched back to DevSim 1.6 version that uses mkl-rt.dll
(installed using :

conda install mkl==2020.2 numpy

as suggested by Juan in
forum.devsim.org /t/ new- intel- mkl -issue/ 37.
Everything becomes fine and I now can get the results exactly as what I have got previously using the old versions of MKL.
Is it possible that my Core 7 CPU was somehow not fully supported by Intel’s new MKL while the DevSim solve() function failed to catch the exception that was throwed by the MKL?

Hi @yonchang,

The MSYS version has problems with detecting floating point exceptions. If you do not need extended precision, please use the WIN64 version. It may also be possible to use the linux version on windows using the Windows Subsystem for Linux, but I have not attempted that.

When devsim 2.0.1 was released I noticed that the numpy version was still using mkl-rt.1, but mkl had moved mkl-rt.2. Since devsim does not depend on numpy, I did the release using the latest available from mkl. This may result in a version of numpy relying on OpenBLAS instead of MKL.

From numpy.show_config()

.
.
.
openblas_info:
    libraries = ['openblas', 'openblas']
.
.
.
blas_opt_info:
    libraries = ['openblas', 'openblas']
.
.
.

This is a very frustrating issue with Intel MKL and Anaconda Python package management. In the near future, I hope to release a version of devsim which allows the user to select the version of MKL, SuperLU, and BLAS at runtime.
https://github.com/devsim/devsim/issues/84
https://github.com/devsim/devsim/issues/85

One possible workaround on Windows is to copy the file mkl-rt.2.dll to mkl-rt.1.dll as appropriate. in the Anaconda environment directory. It will then be found at runtime. I don’t have access to the Windows machine at the moment, but I think this should work.

Thank you! I will give a try and see how it goes.

It seems that MKL put .2 label in all dll filenames in the folder. I got the error message:


1.00000e+18
1.00000e+18
1.00000e+18
1.00000e+18
Region “MyRegion” on device “MyDevice” has equations 0:464
Device “MyDevice” has equations 0:464

INTEL MKL ERROR: The specified module could not be found. mkl_intel_thread.2.dll.
Intel MKL FATAL ERROR: Cannot load mkl_intel_thread.2.dll.

Restarting kernel…

It will be annoying to change every xxxx.1.dll to xxxx.2.dll . .Also, .1 and .2 files have different sizes. I am not sure if it will work…

Sorry about the dll problems. I will try to make it easier in the next release.

Thank you Juan, It is still a great tool !

1 Like

Please try version 2.1.0. DEVSIM should now be flexible with regards to the installed version of Intel MKL.

I have recently tried installing version 2.2, and am also receiving the same “ImportError: DLL load failed while importing devsim_py3: The specified module could not be found.”

I am using a python 3.10.5 virtual environment on Win64. I have the C++ toolkit installed, and have installed mkl and numpy with pip. Pip also says devsim was successfully installed. Are there other libraries or packages I need?

Hi @Rob_1

I am not sure what the C++ toolkit installed. Please make sure it is equivalent to the Visual C++ 2022 redistributable. https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist

In addition make sure that sqlite and zlib is installed:

conda install sqlite zlib

Please let me know if this works for you.