Code Monkey home page Code Monkey logo

Comments (6)

Craigacp avatar Craigacp commented on May 29, 2024

XGBoost4j needs to be compiled from source on Linux distributions which use musl libc. Or you can install glibc (though on that specific version used in Tribuo 4.3.1 it tries to autodetect musl and that autodetection will confuse things).

There are issues in XGBoost's GitHub page with more details, e.g. dmlc/xgboost#7921.

We have a note about XGBoost's binary support in the javadocs - https://github.com/oracle/tribuo/blob/main/Common/XGBoost/src/main/java/org/tribuo/common/xgboost/XGBoostTrainer.java#L65

from tribuo.

nmicra avatar nmicra commented on May 29, 2024

I've tried to install additional C/C++ libraries, as it was mentioned in the note, you've mentioned, but no luck.

Docker Image: openjdk:17-jdk-alpine3.14
Additional libraries:

Still facing exception:
Caused by: java.io.FileNotFoundException: File /lib/linux-musl/x86_64/libxgboost4j.so was not found inside JAR. at ml.dmlc.xgboost4j.java.NativeLibLoader.createTempFileFromResource(NativeLibLoader.java:298) at ml.dmlc.xgboost4j.java.NativeLibLoader.loadLibraryFromJar(NativeLibLoader.java:241) at ml.dmlc.xgboost4j.java.NativeLibLoader.initXGBoost(NativeLibLoader.java:176) at ml.dmlc.xgboost4j.java.XGBoostJNI.<clinit>(XGBoostJNI.java:34) ... 120 more
Any recommendations?
Can you recommend any other openjdk docker image where XGBoost can run smoothly?

from tribuo.

Craigacp avatar Craigacp commented on May 29, 2024

If you use an image based on RHEL/CentOS/OL or Ubuntu it should use glibc and it'll be fine. In the next version we'll pull in the updated XGBoost with the override, but at the moment it's autodetecting musl and you need to compile XGBoost for musl to make it work.

from tribuo.

nmicra avatar nmicra commented on May 29, 2024

Just tried to switch to Ubuntu, I've used the mcr.microsoft.com/openjdk/jdk:17-ubuntu image, but got similar error.
Caused by: [CIRCULAR REFERENCE: java.lang.UnsatisfiedLinkError: /tmp/libxgboost4j8168818628742633668.so: libgomp.so.1: cannot open shared object file: No such file or directory]

from tribuo.

Craigacp avatar Craigacp commented on May 29, 2024

That's because you need OpenMP to get parallelization and the XGBoost binary the developers produce requires it. You can recompile XGBoost without it (and it'll be much slower), or install the libgomp1 package into your docker image.

from tribuo.

nmicra avatar nmicra commented on May 29, 2024

@Craigacp thank you!
The following workaround worked for me.

  1. Create your image FROM mcr.microsoft.com/openjdk/jdk:17-ubuntu
  2. RUN apt-get update && apt-get install -y libgomp1 && rm -rf /var/lib/apt/lists/*

from tribuo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.