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

Error: lazy symbol binding failed: Symbol not found: ___emutls_get_address #8217

Open
arshtepe opened this issue Sep 8, 2019 · 24 comments

Comments

@arshtepe
Copy link

commented Sep 8, 2019

Issue Description

Please describe our issue, along with:
I have error when run my project in 1.0.0-beta5, it is working in 1.0.0-beta4

dyld: lazy symbol binding failed: Symbol not found: ___emutls_get_address
  Referenced from: ~/.javacpp/cache/nd4j-native-1.0.0-beta5-macosx-x86_64.jar/org/nd4j/nativeblas/macosx-x86_64/libnd4jcpu.dylib
  Expected in: /usr/lib/libSystem.B.dylib

Version Information

Please indicate relevant versions, including, if relevant:

  • Deeplearning4j: 1.0.0-beta5
  • Platform information (OS, etc): macOs Mojave 10.14.4
  • CUDA version, if used
  • NVIDIA driver version, if in use

Additional Information

Where applicable, please also provide:

  • Full log or exception stack trace (ideally in a Gist: gist.github.com):
dyld: lazy symbol binding failed: Symbol not found: ___emutls_get_address
  Referenced from: ~/.javacpp/cache/nd4j-native-1.0.0-beta5-macosx-x86_64.jar/org/nd4j/nativeblas/macosx-x86_64/libnd4jcpu.dylib
  Expected in: /usr/lib/libSystem.B.dylib
@saudet

This comment has been minimized.

Copy link
Member

commented Sep 8, 2019

@sshepel Which versions of GCC and Xcode are we building with these days?

@sshepel

This comment has been minimized.

Copy link
Contributor

commented Sep 8, 2019

@saudet for release and generic builds we have:

-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
@raver119

This comment has been minimized.

Copy link
Contributor

commented Sep 8, 2019

@arshtepe can you share the code you're running?

I've been running examples before release, they were running fine. Just ran examples right now - still running fine. Tried lenet example, and some basic lstm/dense examples. No issues as well.

@raver119

This comment has been minimized.

Copy link
Contributor

commented Sep 8, 2019

Screen Shot 2019-09-08 at 15 45 39

@arshtepe

This comment has been minimized.

Copy link
Author

commented Sep 8, 2019

@saudet
Xcode 10.3
Build version 10G8

cmake version 3.15.2
gcc -dumpversion -> 4.2.1
@raver119 sorry I can't share the code :( but I can provide any details which you want

@saudet

This comment has been minimized.

Copy link
Member

commented Sep 8, 2019

@sshepel And the version of Xcode?

@sshepel

This comment has been minimized.

Copy link
Contributor

commented Sep 8, 2019

@saudet Xcode version: 8.3.3

@saudet

This comment has been minimized.

Copy link
Member

commented Sep 9, 2019

GCC 8.x was released beginning of 2018: https://www.gnu.org/software/gcc/releases.html
So let's try to use a version of Xcode that was released around the same time frame. That would be close to Xcode 9.2, which is the last to run on Mac OS X 10.12.6: https://en.wikipedia.org/wiki/Xcode

@sshepel

This comment has been minimized.

Copy link
Contributor

commented Sep 9, 2019

@saudet sure, will do that ASAP.

@sshepel

This comment has been minimized.

Copy link
Contributor

commented Sep 9, 2019

Ok, Xcode has been updated to version 9.2.0. Snapshots are on the way!
@arshtepe could you please try to use snapshots tomorrow to check if the issue has been resolved for you...

@arshtepe

This comment has been minimized.

Copy link
Author

commented Sep 9, 2019

@sshepel okey, I will let you know, thanks :)

@zhaihao

This comment has been minimized.

Copy link

commented Sep 10, 2019

I have the same problem.

code:

import org.nd4s.Implicits._
val arr = (1 to 9).toNDArray(3,3)
println(arr)

output:

19:58:02.671 [info ] o.n.linalg.factory.Nd4jBackend(196)      - Loaded [CpuBackend] backend
19:58:03.135 [info ] o.n.nativeblas.NativeOpsHolder(104)      - Number of threads used for OpenMP: 4
dyld: lazy symbol binding failed: Symbol not found: ___emutls_get_address
19:58:03.602 [info ] org.nd4j.nativeblas.Nd4jBlas(55)         - Number of threads used for OpenMP BLAS: 4
  Referenced from: /Users/zhaihao/.javacpp/cache/nd4j-native-1.0.0-beta5-macosx-x86_64.jar/org/nd4j/nativeblas/macosx-x86_64/libnd4jcpu.dylib
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: ___emutls_get_address
  Referenced from: /Users/zhaihao/.javacpp/cache/nd4j-native-1.0.0-beta5-macosx-x86_64.jar/org/nd4j/nativeblas/macosx-x86_64/libnd4jcpu.dylib
  Expected in: /usr/lib/libSystem.B.dylib

system env:

Mac OSX 10.14.6

$ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
version: 10.3.0.0.1.1562985497
volume: /
location: /
install-time: 1563950915
groups: com.apple.FindSystemFiles.pkg-group

$ cmake --version
cmake version 3.14.5

CMake suite maintained and supported by Kitware (kitware.com/cmake).

$ gcc -v
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

I hope this would help.

@raver119

This comment has been minimized.

Copy link
Contributor

commented Sep 10, 2019

at this moment I'm not sure why it's reproducible for you, but we suppose that's an issue related to thread_local storage specifier, so I've disabled it for macos now. once snapshots rebuilt please try again

@arshtepe

This comment has been minimized.

Copy link
Author

commented Sep 10, 2019

@raver119 I can't update to snapshot, it is loading infinitely
my pom

    <repositories>
        <repository>
            <id>snapshots-repo</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>  <!-- Optional, update daily -->
            </snapshots>
        </repository>
    </repositories>
    <dependencies>
        <dependency>
            <groupId>org.deeplearning4j</groupId>
            <artifactId>deeplearning4j-core</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>

this way doesn't work too

    <repositories>
        <repository>
            <id>snapshots-repo</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>  <!-- Optional, update daily -->
            </snapshots>
        </repository>
    </repositories>
    <dependencies>
        <dependency>
            <groupId>org.deeplearning4j</groupId>
            <artifactId>deeplearning4j-core</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>org.nd4j</groupId>
            <artifactId>nd4j-native-platform</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>org.deeplearning4j</groupId>
            <artifactId>deeplearning4j-modelimport</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>org.deeplearning4j</groupId>
            <artifactId>deeplearning4j-ui_2.12</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>org.nd4j</groupId>
            <artifactId>nd4j-api</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>

@raver119

This comment has been minimized.

Copy link
Contributor

commented Sep 11, 2019

@raver119 I can't update to snapshot, it is loading infinitely

It looks like sonatype has some problems atm, we've noticed similar problems here as well

@arshtepe

This comment has been minimized.

Copy link
Author

commented Sep 11, 2019

now I have new error ,
btw code https://gitlab.com/Eliza_H/cnn_network/blob/master/src/main/java/NetworkModel.java

Exception in thread "main" java.lang.ExceptionInInitializerError
	at org.nd4j.linalg.cpu.nativecpu.ops.NativeOpExecutioner.<init>(NativeOpExecutioner.java:91)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at java.lang.Class.newInstance(Class.java:442)
	at org.nd4j.linalg.factory.Nd4j.initWithBackend(Nd4j.java:5246)
	at org.nd4j.linalg.factory.Nd4j.initContext(Nd4j.java:5153)
	at org.nd4j.linalg.factory.Nd4j.<clinit>(Nd4j.java:182)
	at org.deeplearning4j.nn.conf.NeuralNetConfiguration$Builder.seed(NeuralNetConfiguration.java:579)
	at NetworkCNNModel.execute(NetworkCNNModel.java:115)
	at NetworkCNNModel.main(NetworkCNNModel.java:276)
Caused by: java.lang.RuntimeException: ND4J is probably missing dependencies. For more information, please refer to: http://nd4j.org/getstarted.html
	at org.nd4j.nativeblas.NativeOpsHolder.<init>(NativeOpsHolder.java:106)
	at org.nd4j.nativeblas.NativeOpsHolder.<clinit>(NativeOpsHolder.java:34)
	... 12 more
Caused by: java.lang.UnsatisfiedLinkError: no jnind4jcpu in java.library.path
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
	at java.lang.Runtime.loadLibrary0(Runtime.java:870)
	at java.lang.System.loadLibrary(System.java:1122)
	at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1487)
	at org.bytedeco.javacpp.Loader.load(Loader.java:1190)
	at org.bytedeco.javacpp.Loader.load(Loader.java:1040)
	at org.nd4j.nativeblas.Nd4jCpu.<clinit>(Nd4jCpu.java:10)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at org.nd4j.nativeblas.NativeOpsHolder.<init>(NativeOpsHolder.java:84)
	... 13 more
Caused by: java.lang.UnsatisfiedLinkError: ..../.javacpp/cache/nd4j-native-1.0.0-20190911.011548-14906-macosx-x86_64.jar/org/nd4j/nativeblas/macosx-x86_64/libjnind4jcpu.dylib: dlopen(/Users/artemshtepenko/.javacpp/cache/nd4j-native-1.0.0-20190911.011548-14906-macosx-x86_64.jar/org/nd4j/nativeblas/macosx-x86_64/libjnind4jcpu.dylib, 1): Library not loaded: @rpath/libmkldnn.0.dylib
  Referenced from: ..../.javacpp/cache/nd4j-native-1.0.0-20190911.011548-14906-macosx-x86_64.jar/org/nd4j/nativeblas/macosx-x86_64/./libnd4jcpu.dylib
  Reason: image not found
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
	at java.lang.Runtime.load0(Runtime.java:809)
	at java.lang.System.load(System.java:1086)
	at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1461)
	... 19 more

@raver119

This comment has been minimized.

Copy link
Contributor

commented Sep 12, 2019

@saudet any ideas why it still tries to load libmkldnn?

  1. for x86_64 binary libnd4j doesn't use mkldnn atm.
  2. all libmkldnn references from java were removed.
@raver119

This comment has been minimized.

Copy link
Contributor

commented Sep 12, 2019

p.s. @AlexDBlack tried to run latest snapshot on windows and it runs fine for him.

@saudet

This comment has been minimized.

Copy link
Member

commented Sep 12, 2019

The artifacts are probably just not up-to-date..

@streambuf

This comment has been minimized.

Copy link

commented Sep 15, 2019

i have same problem when try run org.deeplearning4j.examples.convolution.AnimalsClassification
commit 391ec1bcfa69b13804b78103a645f425c1dd5ac0

@saudet

This comment has been minimized.

Copy link
Member

commented Sep 16, 2019

This problem is probably caused by the upgrade to GCC 8.3.
These patches needed to support rpath haven't been upgraded on the CI server:
https://github.com/bytedeco/javacpp-presets/blob/master/ci/install-travis.sh#L218
The workaround for now is to install GCC 8.3 with brew install gcc@8.

@streambuf

This comment has been minimized.

Copy link

commented Sep 16, 2019

gcc -v
gcc version 9.2.0 (Homebrew GCC 9.2.0)
not helped

@streambuf

This comment has been minimized.

Copy link

commented Sep 16, 2019

This problem is probably caused by the upgrade to GCC 8.3.
These patches needed support rpath haven't been upgraded on the CI server:
https://github.com/bytedeco/javacpp-presets/blob/master/ci/install-travis.sh#L218
The workaround for now is to install GCC 8.3 with brew install gcc@8.

It's help me. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.