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

version `GLIBC_2.27' not found #989

Closed
langzeng opened this issue Mar 4, 2023 · 8 comments
Closed

version `GLIBC_2.27' not found #989

langzeng opened this issue Mar 4, 2023 · 8 comments

Comments

@langzeng
Copy link

langzeng commented Mar 4, 2023

Hi, I'm trying to install torch in R on a server through install_torch(). It comes with the error:

Error in cpp_lantern_init(file.path(install_path(), "lib")) :
.../R/lib/liblantern.so - /lib64/libm.so.6: version `GLIBC_2.27' not found (required by .../R/lib/./libtorch_cpu.so)

The GLIBC version on the server is 2.17 and I can not update the version. Do you have any idea how to solve the problem? I was thinking to install a previous version of torch by install_torch(version="previous version") but it seems don't work.

I'm able to use Python (3.8) and PyTorch (1.13.1) on that server. Is that possible to force R Torch installation to use the existing python like:
library(reticulate)
use_python("...python3.8/bin/python")

@pelacables
Copy link

did you find a solution to this issue?

@dfalbel
Copy link
Member

dfalbel commented Apr 28, 2023

Hi, setting Sys.setenv(PRECXX11ABI=1) and then install_torch() should fix, as this will install LibTorch with pre C++ 11 that doesn't require a newer Glibc.

@dfalbel
Copy link
Member

dfalbel commented May 12, 2023

I'll close for now, please reopen if you still have problems.

@dfalbel dfalbel closed this as completed May 12, 2023
@pelacables
Copy link

thanks! that solved the problem, sorry, your first answer got lost in my inbox.

@ykaeber
Copy link

ykaeber commented Feb 9, 2025

This fix does not work for the new torch version which requires glibc 2.29. Is there any other way to get torch working without glibc 2.29?

Warning message:
ℹ torch failed to start, restart your R session to try again.
ℹ You might need to reinstall torch using install_torch()
✖ [...]/R/site-library/torch/lib/liblantern.so - /lib64/libm.so.6: version
GLIBC_2.29' not found (required by [...]/R/site-library/torch/lib/liblantern.so) Caused by error in cpp_lantern_init(): ! [...]/R/site-library/torch/lib/liblantern.so - /lib64/libm.so.6: version GLIBC_2.29' not found (required by [...]/R/site-library/torch/lib/liblantern.so)

@dfalbel
Copy link
Member

dfalbel commented Feb 10, 2025

@ykaeber , what's your OS version ? I can try taking a look, but would need more info.

@rdinnager
Copy link
Collaborator

I am getting the same issue as @ykaeber, same error message when installing torch 0.14.2.
This is the OS version:

lsb_release -a
LSB Version:	:core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID:	RedHatEnterprise
Description:	Red Hat Enterprise Linux release 8.10 (Ootpa)
Release:	8.10
Codename:	Ootpa

I am working on an HPC system, so I have no control over what GLIBC is installed. The version installed currently is 2.28:

ldd --version
ldd (GNU libc) 2.28
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

For now I have downgraded to torch 0.13.0, which works fine for now, but eventually would like to get access to the new version of LibTorch in 0.14.0. I will also be asking about upgrading GLIBC on the HPC system, but this is not likely to happen anytime soon of course. Would appreciate it if anyone had any possible workarounds!

@dfalbel
Copy link
Member

dfalbel commented Feb 24, 2025

Thank for repoting @rdinnager! just to confirm. Did you set Sys.setenv(PRECXX11ABI=1) so it installs a version that requires a lower glibc version?

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

5 participants