0

I've spent all day trying to figure out how to work mxnet GPU in R on windows. The package installs fine, but on library(mxnet) I get an error:

Error: package or namespace load failed for ‘mxnet’: .onLoad failed in loadNamespace() for 'mxnet', details: call: inDL(x, as.logical(local), as.logical(now), ...) error: unable to load shared object 'C:/Users/Po/Documents/R/win-library/3.4/mxnet/libs/x64/libmxnet.dll': LoadLibrary failure: The specified module could not be found.

Really been taken for a ride with all the 'help' topics. This seems to be a common issue but not widely applicable solution. I've downloaded and updated: CUDA, CUDAnn, NVIDIA drivers, OpenBLAS, cmake, opencv, MS visual studio, git, mlbench, mingw, MS visual cpp community.... the list goes on.

Some solutions say building and compiling is a work around, but frankly building and compiling is so far out of scope I've had to download half dozen programs just to be left with instructions "Use CMake to create a Visual Studio solution in ./build." What does that even mean.

I have checked the directory and am sure libmxnet.dll exists. I feel like I am missing something obvious.

talonmies
  • 70,661
  • 34
  • 192
  • 269
Garglesoap
  • 565
  • 6
  • 18

2 Answers2

1

I will help you resolve this.

I have checked the directory and am sure libmxnet.dll exists. I feel like I am missing something obvious.

if libmxnet.dll exists, and yet we get the missing module error, it means one or more DLLs on which libmxnet.dll depends is missing.

Can you please download Process Monitor from "https://live.sysinternals.com/Procmon.exe" and capture file system activity.

The instructions are

  1. Download "https://live.sysinternals.com/Procmon.exe"
  2. Start "Procmon.exe"
  3. Click Ctrl + L to bring filter UI
  4. Choose "Path" , "ends with", ".dll" then "include" filter from "Display entries matching these conditions"
  5. Click ok. We have configured Procmon to monitor DLL activity
  6. Now try to reproduce the issue which leads to missing module error
  7. From Process Monitor, Choose File | Save option ( or press Ctrl + S )
  8. Ensure that "native process monitor format (PML)" is chosen
  9. Ensure events displayed using current filter is chosen
    Generate the PML file.
  10. Mail the PML file to me at eftiquar@gmail.com
Thomas Fritsch
  • 9,639
  • 33
  • 37
  • 49
Eftiquar
  • 29
  • 1
1

To build and install MXNet yourself, you need the following dependencies. Install the required dependencies:

  1. If [Microsoft Visual Studio 2017(https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Community&rel=15) is not already installed, download and install it. You can download and install the free community edition.
  2. Download and Install CMake GUI version if it is not already installed.
  3. Download and install OpenCV.
  4. Unzip the OpenCV package.
  5. Set the environment variable "OpenCV_DIR" to the value "OpenCV build directory".
  6. If you don't have the Intel Math Kernel Library (MKL) installed, download and install OpenBlas.
  7. Set the environment variable "OpenBLAS_HOME" to point to the "OpenBLAS" directory that contains the "include" and "lib" directories. Typically, you can find the directory in "C:\Program files (x86)\OpenBLAS\".
  8. Download and install CuDNN. To get access to the download link, register as an NVIDIA community user.

After you have installed all of the required dependencies, build the MXNet source code:

  1. Download the MXNet source code from GitHub.
  2. Open native tools command prompt for Visual Studio 2017( choose x64 or x86 native as required)
  3. Start CMake GUI tool installed previously, from within this command prompt
  4. In the CMake tool UI, "Browse Source" button and navigate to folder where MXNet source is downloaded. For example -"/GitHub/incubator-mxnet"
  5. Create a folder under "/GitHub/incubator-mxnet", say releasex64
  6. Click "Browse Build.." and choose folder created above
  7. Click "Configure" button, a dialog prompt appears for choosing generator
  8. Choose appropriate generator, for example Visual Studio 2017 Win64, if building for x64
  9. Retain "use default native compilers" option
  10. Click Finish
  11. Click "Open Project" to open the generated project in Visual Studio IDE
  12. Choose "ALL_BUILD" and build the configuration that you want to build
  13. Find libmxnet.dll under the folder created in step 5 above for example "\GitHub\incubator-mxnet\releasex64\Debug\libmxnet.dll"
Eftiquar
  • 29
  • 1