Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Building MxNet on Win10 with CPP package, CUDA9 and MKL 2018 #10049

@EternalSaga

Description

@EternalSaga

Description

I'm trying to build mxnet on win10 with cpp package. After some hard efforts, I built the libmxnet.dll successfully. But I cannot generate the op.h file through the python script OpWrapperGenerator.py.
Python tells me that some unknown modules cannot be found when generating the op.h header file. Perhaps it is resulted by the MKL path, but I have no idea how to fix it.

Environment info (Required)

Win10
VS2015
MKL2018
CUDA9
CUDNN7
python3.6

##Diagnose Information
----------Python Info----------
Version : 3.6.4
Compiler : MSC v.1900 64 bit (AMD64)
Build : ('v3.6.4:d48eceb', 'Dec 19 2017 06:54:40')
Arch : ('64bit', 'WindowsPE')
------------Pip Info-----------
Version : 9.0.1
Directory : C:\Program Files\Python36\lib\site-packages\pip
----------MXNet Info-----------
No MXNet installed.
----------System Info----------
Platform : Windows-10-10.0.16299-SP0
system : Windows
node : DESKTOP-TE2BP5I
release : 10
version : 10.0.16299
----------Hardware Info----------
machine : AMD64
processor : Intel64 Family 6 Model 158 Stepping 10, GenuineIntel
Name
Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz

----------Network Test----------
Setting timeout: 10
Timing for MXNet: https://github.com/apache/incubator-mxnet, DNS: 0.0792 sec, LOAD: 1.6584 sec.
Timing for Gluon Tutorial(en): http://gluon.mxnet.io, DNS: 0.3294 sec, LOAD: 1.9067 sec.
Error open Gluon Tutorial(cn): https://zh.gluon.ai, The read operation timed out, DNS finished in 0.544719934463501 sec.
Timing for FashionMNIST: https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/dataset/fashion-mnist/train-labels-idx1-ubyte.gz, DNS: 0.1333 sec, LOAD: 1.2828 sec.
Timing for PYPI: https://pypi.python.org/pypi/pip, DNS: 0.0939 sec, LOAD: 6.4636 sec.
Timing for Conda: https://repo.continuum.io/pkgs/free/, DNS: 0.0620 sec, LOAD: 14.4082 sec.

Package used (Python/R/Scala/Julia):
(I'm using ...)
I want to use mxnet through C++.

Build info (Required if built from source)

mxnetbuilt

Compiler (gcc/clang/mingw/visual studio):
visual studio
MXNet commit hash:
(Paste the output of git rev-parse HEAD here.)

Build config:
(Paste the content of config.mk, or the build command.)

Error Message:

When this command is running, this message shows.
python OpWrapperGenerator.py D:/Program
mingAndStudy/cpp library/mxnet/build/Release/libmxnet.dll
Traceback (most recent call last):
File "OpWrapperGenerator.py", line 425, in
raise(e)
File "OpWrapperGenerator.py", line 419, in
f.write(patternStr % ParseAllOps())
File "OpWrapperGenerator.py", line 314, in ParseAllOps
cdll.libmxnet = cdll.LoadLibrary(sys.argv[1])
File "C:\Program Files\Python36\lib\ctypes_init_.py", line 426, in LoadLibrary
return self.dlltype(name)
File "C:\Program Files\Python36\lib\ctypes_init
.py", line 348, in init
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] 找不到指定的模块。

Minimum reproducible example

(If you are using your own code, please provide a short script that reproduces the error. Otherwise, please provide link to the existing example.)

Steps to reproduce

After building the libmxnet.dll with mkl, cd to the folder incubator-mxnet\cpp-package\scripts,
run
python OpWrapperGenerator.py path_to_the_libmxnet.dll

What have you tried to solve it?

I tried to add opencv/build/bin/x64 and mkl/lib/intel_64_win to environment varialbes PATH.
Obviously it is useless becasue intel has not provided any shared library for mkl. <--------- This is wrong.

Additional Efforts

After building the libmxnet.dll, I tried to install it for python. The installation is successful, but when I import the mxnet package, there is a similar error for python install.

import mxnet
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\yueji\Anaconda3\lib\site-packages\mxnet-1.2.0-py3.6.egg\mxnet_init_.py", line 25, in
from . import engine
File "C:\Users\yueji\Anaconda3\lib\site-packages\mxnet-1.2.0-py3.6.egg\mxnet\engine.py", line 23, in
from .base import _LIB, check_call
File "C:\Users\yueji\Anaconda3\lib\site-packages\mxnet-1.2.0-py3.6.egg\mxnet\base.py", line 113, in
_LIB = _load_lib()
File "C:\Users\yueji\Anaconda3\lib\site-packages\mxnet-1.2.0-py3.6.egg\mxnet\base.py", line 105, in load_lib
lib = ctypes.CDLL(lib_path[0], ctypes.RTLD_LOCAL)
File "C:\Users\yueji\Anaconda3\lib\ctypes_init
.py", line 348, in init
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] 找不到指定的模块。

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions