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

p16s: gazebo fails from docker: "libGL error: MESA-LOADER: failed to retrieve device information" #819

Closed
130s opened this issue Apr 4, 2023 · 3 comments
Labels
problem_broken-unfunctional-cando Can't do XX because existing functionality is broken

Comments

@130s
Copy link
Collaborator

130s commented Apr 4, 2023

Reported in https://github.com/kinu-garage/essay_in_idleness/issues/121#issuecomment-1496031987

Issue

$ export DOCKER_APP=d130s:galactic-focal-caira2023
rocker --x11 --user --nvidia --home $DOCKER_APP

:

building > Step 11/11 : WORKDIR /home/n130s
building >  ---> Using cache
building >  ---> 176d0f2b36b9
building > Successfully built 176d0f2b36b9
Executing command: 
docker run --rm -it -v /home/n130s:/home/n130s   --gpus all  -e DISPLAY -e TERM   -e QT_X11_NO_MITSHM=1   -e XAUTHORITY=/tmp/.dockergpmf2zu8.xauth -v /tmp/.dockergpmf2zu8.xauth:/tmp/.dockergpmf2zu8.xauth   -v /tmp/.X11-unix:/tmp/.X11-unix   -v /etc/localtime:/etc/localtime:ro  176d0f2b36b9 gazebo
libGL error: MESA-LOADER: failed to retrieve device information

Tried

Using https://stackoverflow.com/questions/71010343/ I still get the same error.
$ export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
$ rocker --x11 --user --nvidia --home $DOCKER_APP gazebo

:

Successfully tagged rocker:os_detect_d130s_galactic-focal-caira2023
running,  docker run -it --rm d1583a934897
output:  ERROR: ld.so: object '/usr/lib64/libstdc++.so.6' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
('Ubuntu', '20.04', 'focal')

Traceback (most recent call last):
  File "/usr/bin/rocker", line 33, in <module>
    sys.exit(load_entry_point('rocker==0.2.10', 'console_scripts', 'rocker')())
  File "/usr/lib/python3/dist-packages/rocker/cli.py", line 66, in main
    dig = DockerImageGenerator(active_extensions, args_dict, base_image)
  File "/usr/lib/python3/dist-packages/rocker/core.py", line 210, in __init__
    self.dockerfile = generate_dockerfile(active_extensions, self.cliargs, base_image)
  File "/usr/lib/python3/dist-packages/rocker/core.py", line 344, in generate_dockerfile
    dockerfile_str += el.get_preamble(args_dict) + '\n'
  File "/usr/lib/python3/dist-packages/rocker/nvidia_extension.py", line 118, in get_preamble
    return em.expand(preamble, self.get_environment_subs(cliargs))
  File "/usr/lib/python3/dist-packages/rocker/nvidia_extension.py", line 98, in get_environment_subs
    detected_os = detect_os(cliargs['base_image'], print, nocache=cliargs.get('nocache', False))
  File "/usr/lib/python3/dist-packages/rocker/os_detector.py", line 84, in detect_os
    _detect_os_cache[image_name] = literal_eval(output.strip())
  File "/usr/lib/python3.10/ast.py", line 62, in literal_eval
    node_or_string = parse(node_or_string.lstrip(" \t"), mode='eval')
  File "/usr/lib/python3.10/ast.py", line 50, in parse
    return compile(source, filename, mode, flags,
  File "<unknown>", line 1
    ERROR: ld.so: object '/usr/lib64/libstdc++.so.6' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
         ^
SyntaxError: invalid syntax

Finding where the file is:

$ find / -name libstdc++.so.6 2>/dev/null
/snap/core20/1518/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/snap/core20/1852/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/snap/core22/583/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/snap/gnome-42-2204/68/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/snap/gnome-42-2204/65/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/snap/core18/2714/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/snap/core18/2721/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/snap/core/14784/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/snap/core/14946/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/home/noodler/data/Dropbox/UPenn_Robotics_wk1/matlab_R2016a_glnxa64/bin/glnxa64/libstdc++.so.6
/home/noodler/data/Dropbox/Matlab_2012_Student/bin/glnx86/libstdc++.so.6
/usr/lib/x86_64-linux-gnu/libstdc++.so.6

Found the path of non-snap file is different, although the one from the forum is still present.

$ ll /usr/lib/x86_64-linux-gnu/libstdc++.so.6
lrwxrwxrwx 1 root root 19 May 13  2022 /usr/lib/x86_64-linux-gnu/libstdc++.so.6 -> libstdc++.so.6.0.30
@130s 130s changed the title p16s: gazebo fails from docker p16s: gazebo fails from docker: "libGL error: MESA-LOADER: failed to retrieve device information" Apr 4, 2023
@130s 130s added the problem_broken-unfunctional-cando Can't do XX because existing functionality is broken label Apr 4, 2023
@130s
Copy link
Collaborator Author

130s commented Apr 4, 2023

Embedded export LD_PRELOAD=/usr/lib64/libstdc++.so.6 in the docker image.

In the img:

# find /usr -iname libstdc++.so.6 2>/dev/null
/usr/lib/x86_64-linux-gnu/libstdc++.so.6

In entrypoint, added this but still the same error. Added this to .bashrc too, NG.

# Experimenting workaround for https://github.com/kinu-garage/hut_10sqft/issues/819
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6

@130s
Copy link
Collaborator Author

130s commented Apr 4, 2023

Adding --volume /dev:/dev -- resolved the issue even after removing LD_PRELOAD hacks. So entire command:

$ rocker --x11 --user --nvidia --volume /dev:/dev -- $DOCKER_APP gazebo

@130s 130s closed this as completed Apr 4, 2023
@130s
Copy link
Collaborator Author

130s commented Apr 25, 2023

It just happened again to me (with the updated version of the same Docker image) and I reported osrf/rocker#206 (comment), but the same solution #819 (comment) worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem_broken-unfunctional-cando Can't do XX because existing functionality is broken
Projects
None yet
Development

No branches or pull requests

1 participant