Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failed cause mxnet.dll is not a valid Win32 application #22

Closed
ntbdusty opened this issue Jan 23, 2020 · 6 comments
Closed

Build failed cause mxnet.dll is not a valid Win32 application #22

ntbdusty opened this issue Jan 23, 2020 · 6 comments

Comments

@ntbdusty
Copy link

ntbdusty commented Jan 23, 2020

Hello, guys. Could you help me?
When I tried to build app I've got an error
"Unable to load library 'C:\Users\Default.mxnet\cache\1.6.0-b-SNAPSHOT-20200120mkl-win-x86_64\mxnet.dll':
2020-01-23T03:20:04.060+0300 [ERROR] [system.err] %1 is not a valid Win32 application."

Command for build is "./gradlew run -Dmain=ai.djl.examples.training.TrainMnist"

It's strange, because I have the environment showed below:

java version "1.8.0_241"
Java(TM) SE Runtime Environment (build 1.8.0_241-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.241-b07, mixed mode)

Microsoft Windows [Version 10.0.17763.864]
OS Name Microsoft Windows 10 Enterprise LTSC
Version 10.0.17763 Build 17763
System Type x64-based PC

Gradle 6.0.1
Build time: 2019-11-18 20:25:01 UTC
Revision: fad121066a68c4701acd362daf4287a7c309a0f5

Kotlin: 1.3.50
Groovy: 2.5.8
Ant: Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM: 1.8.0_162 (Oracle Corporation 25.162-b12)
OS: Windows 10 10.0 amd64

@frankfliu
Copy link
Contributor

frankfliu commented Jan 23, 2020

@ntbdusty
"Unable to load library 'C:\Users\Default.mxnet\cache\1.6.0-b-SNAPSHOT-20200120mkl-win-x86_64\mxnet.dll'
This message looks suspicious. Somehow java think you are running as user "Default", that's strange.

Would you please run following command and collect the output:

cd integration
..\gradlew debugEnv

If you are login as administrator in Windows, the correct location of mxnet.dll should look like following:

C:\Users\Administrator\.mxnet\cache\1.6.0-b-SNAPSHOT-20200120mkl-win-x86_64\mxnet.dll

Somehow your path missing a \ after Default

@ntbdusty
Copy link
Author

ntbdusty commented Jan 23, 2020

Ouch, I have to explain, do not pay attention to it. I just replaced manually real user name.
It should looks like "" 'C:\Users\UserName.mxnet\cache\1.6.0-b-SNAPSHOT-20200120mkl-win-x86_64\mxnet.dll'
Also, see logs in attach:
build.log
debugEnv.log

@frankfliu
Copy link
Contributor

@ntbdusty
I guess this is caused by you running gradle in MingW64 shell. Please try to run gradle in command prompt.

@ntbdusty
Copy link
Author

@frankfliu
Unfortunately, the same result in command prompt. =(

@frankfliu
Copy link
Contributor

frankfliu commented Jan 23, 2020

@ntbdusty
This is really strange, mxnet.dll is a 64-bit DLL, and your java and windows are both 64-bit. Somehow your system trying to load mxnet.dll in 32-bit mode and failed.

Can you try one more thing: delete C:\Users\UserName.mxnet folder and try it again?
Another thing to try is: install vs2015 redistribution package, see: https://github.com/awslabs/djl/blob/master/docs/development/troubleshooting.md#3-build-fails-on-windows-caused-by-unsatisfiedlinkerror

@ntbdusty
Copy link
Author

@frankfliu
Many thanks, reinstalling vs2015 solved the problem.
I should have read Troubleshooting more accurate.

aksrajvanshi added a commit to aksrajvanshi/djl that referenced this issue Mar 18, 2021
Lokiiiiii pushed a commit to Lokiiiiii/djl that referenced this issue Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants