Skip to content

GLIBC_2.25 requirement of libtokenizers.so #3624

Description

@XDcsy

Hi,
I saw there was an issue #1873 about libtokenizers.so fails to run on CentOS 7 which does not have GLIBC_2.25 support. The issuse seems to be solved after an update on CI which used a CentOS 7 container to build the .so file.

But I am facing the same issue again with a new version of djl ( <djl.version>0.31.1</djl.version> ) and setting export PYTORCH_PRECXX11=true when running on CentOS7.

The full log is:

2025-03-05 11:28:56.683  INFO 22727 --- [           main] ai.djl.pytorch.jni.LibUtils              : Downloading https://publish.djl.ai/pytorch/2.5.1/cpu-precxx11/linux-x86_64/native/lib/libgomp-a34b3233.so.1.gz ...
2025-03-05 11:28:58.020  INFO 22727 --- [           main] ai.djl.pytorch.jni.LibUtils              : Downloading https://publish.djl.ai/pytorch/2.5.1/cpu-precxx11/linux-x86_64/native/lib/libc10.so.gz ...
2025-03-05 11:28:58.797  INFO 22727 --- [           main] ai.djl.pytorch.jni.LibUtils              : Downloading https://publish.djl.ai/pytorch/2.5.1/cpu-precxx11/linux-x86_64/native/lib/libtorch_cpu.so.gz ...
2025-03-05 11:29:10.029  INFO 22727 --- [           main] ai.djl.pytorch.jni.LibUtils              : Downloading https://publish.djl.ai/pytorch/2.5.1/cpu-precxx11/linux-x86_64/native/lib/libtorch.so.gz ...
2025-03-05 11:29:10.387  INFO 22727 --- [           main] ai.djl.pytorch.jni.LibUtils              : Downloading https://publish.djl.ai/pytorch/2.5.1/cpu-precxx11/linux-x86_64/native/lib/libstdc%2B%2B.so.6.gz ...
2025-03-05 11:29:11.056  INFO 22727 --- [           main] ai.djl.pytorch.jni.LibUtils              : Downloading jni https://publish.djl.ai/pytorch/2.5.1/jnilib/0.31.1/linux-x86_64/cpu-precxx11/libdjl_torch.so to cache ...
2025-03-05 11:29:12.317  INFO 22727 --- [           main] ai.djl.pytorch.engine.PtEngine           : PyTorch graph executor optimizer is enabled, this may impact your inference latency and throughput. See: https://docs.djl.ai/master/docs/development/inference_performance_optimization.html#graph-executor-optimization
2025-03-05 11:29:12.318  INFO 22727 --- [           main] ai.djl.pytorch.engine.PtEngine           : Number of inter-op threads is 2
2025-03-05 11:29:12.318  INFO 22727 --- [           main] ai.djl.pytorch.engine.PtEngine           : Number of intra-op threads is 2
2025-03-05 11:29:12.776  INFO 22727 --- [           main] ai.djl.util.Platform                     : Found matching platform from: jar:file:/root/model-driver-1.0-SNAPSHOT.jar!/BOOT-INF/lib/tokenizers-0.31.1.jar!/native/lib/tokenizers.properties
2025-03-05 11:29:12.777  INFO 22727 --- [           main] a.d.huggingface.tokenizers.jni.LibUtils  : Extracting native/lib/linux-x86_64/cpu/libtokenizers.so to cache ...
2025-03-05 11:29:12.836  WARN 22727 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'textEmbeddingController' defined in URL [jar:file:/root/model-driver-1.0-SNAPSHOT.jar!/BOOT-INF/classes!/com/..../controller/TextEmbeddingController.class]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com......controller.TextEmbeddingController]: Constructor threw exception; nested exception is java.lang.UnsatisfiedLinkError: /root/.djl.ai/tokenizers/0.20.3-0.31.1-cpu-linux-x86_64/libtokenizers.so: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by /root/.djl.ai/tokenizers/0.20.3-0.31.1-cpu-linux-x86_64/libtokenizers.so)

Maybe the the support for CentOS7 of libtokenizers.so is broken in some later updates? Could it be fixed or is it possbile to manually build it without GLIBC_2.25?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions