Skip to content

libtorch_cpu.so link libm.so issue:GLIBC_2.29 not found #159454

@Pulp-fiction-42

Description

@Pulp-fiction-42

🐛 Describe the bug

when I try to
import torch
I encounter the problem:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/tmp/ipykernel_3237544/4265195184.py in <cell line: 1>()
----> 1 import torch

~/.conda/envs/dnabert2/lib/python3.8/site-packages/torch/__init__.py in <module>
    190     if USE_GLOBAL_DEPS:
    191         _load_global_deps()
--> 192     from torch._C import *  # noqa: F403
    193 
    194 # Appease the type checker; ordinarily this binding is inserted by the

ImportError: /usr/lib64/libm.so.6: version `GLIBC_2.29' not found (required by /home/share/huadjyin/home/lihuyang/.conda/envs/dnabert2/lib/python3.8/site-packages/torch/lib/libtorch_cpu.so)

and I am working on a cluster, so there is a .so file satisfy the GLIBC version
/home/HPCBase/compilers/gcc/12.3.1/libc/lib/libm.so.6
I export this path file into .bashrc and it worked when I use Python interpreter to import torch in terminal shell
but in Jupyter Notebook, Neither adding environment variables to kernel.json nor adding the following code to jupyter_notebook_config.py works:

import os
c = get_config()
os.environ['LD_PRELOAD'] = '/home/HPCBase/compilers/gcc/12.3.1/libc/lib/libm.so.6'
c.Spawner.env.update({'LD_PRELOAD': os.environ['LD_PRELOAD']})

Why I can't just load the $LD_PRELOAD into Jupyter Notebook???

Versions

when I try to
import torch
I encounter the problem:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/tmp/ipykernel_3237544/4265195184.py in <cell line: 1>()
----> 1 import torch

~/.conda/envs/dnabert2/lib/python3.8/site-packages/torch/__init__.py in <module>
    190     if USE_GLOBAL_DEPS:
    191         _load_global_deps()
--> 192     from torch._C import *  # noqa: F403
    193 
    194 # Appease the type checker; ordinarily this binding is inserted by the

ImportError: /usr/lib64/libm.so.6: version `GLIBC_2.29' not found (required by /home/share/huadjyin/home/lihuyang/.conda/envs/dnabert2/lib/python3.8/site-packages/torch/lib/libtorch_cpu.so)

and I am working on a cluster, so there is a .so file satisfy the GLIBC version
/home/HPCBase/compilers/gcc/12.3.1/libc/lib/libm.so.6
I export this path file into .bashrc and it worked when I use Python interpreter to import torch in terminal shell
but in Jupyter Notebook, Neither adding environment variables to kernel.json nor adding the following code to jupyter_notebook_config.py works:

import os
c = get_config()
os.environ['LD_PRELOAD'] = '/home/HPCBase/compilers/gcc/12.3.1/libc/lib/libm.so.6'
c.Spawner.env.update({'LD_PRELOAD': os.environ['LD_PRELOAD']})

Why I can't just load the $LD_PRELOAD into Jupyter Notebook???

cc @ezyang @gchanan @zou3519 @kadeng @msaroufim @seemethere @malfet @atalman

Metadata

Metadata

Assignees

No one assigned

    Labels

    high prioritymodule: binariesAnything related to official binaries that we release to usersmodule: buildBuild system issuesneeds reproductionEnsure you have actionable steps to reproduce the issue. Someone else needs to confirm the repro.triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions