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

nvidia overlay failing on bionic: x86_64-linux-gnu: no such file or directory #14

Closed
ruffsl opened this issue Jan 10, 2019 · 2 comments
Closed
Labels
bug Something isn't working nvidia Connected to the nvidia extension

Comments

@ruffsl
Copy link
Member

ruffsl commented Jan 10, 2019

The auto generated Dockerfile seems to encounter a build issue in the first stage of it multistage build.

$ rocker --nvidia --user --pull --pulse osrf/ros:crystal-desktop rviz2
Plugins found: ['dev_helpers', 'home', 'nvidia', 'pulse', 'user']
Active extensions ['nvidia', 'pulse', 'user']
Pulling image osrf/ros:crystal-desktop
b'{"status":"Pulling from osrf/ros","id":"crystal-desktop"}\r\n'
b'{"status":"Digest: sha256:62579d806386b2b3ff2ecf3924f0ba39b8d8422fb7979db42e469cfbfd26e19f"}\r\n'
b'{"status":"Status: Image is up to date for osrf/ros:crystal-desktop"}\r\n'
Writing dockerfile to /tmp/tmpg_lv8g3_/Dockerfile
vvvvvv
...
^^^^^^
Building docker file with arguments:  {'path': '/tmp/tmpg_lv8g3_', 'rm': True, 'decode': True, 'nocache': False, 'tag': 'rocker_osrf/ros:crystal-desktop_nvidia_pulse_user'}
building > Step 1/16 : FROM nvidia/opengl:1.0-glvnd-devel-ubuntu18.04 as glvnd
building >  ---> 04c47f164887
building > Step 2/16 : FROM osrf/ros:crystal-desktop
building >  ---> c3d97d8c2f50
building > Step 3/16 : COPY --from=glvnd /usr/local/lib/x86_64-linux-gnu /usr/local/lib/x86_64-linux-gnu
Cannot run if build has not passed.

Would be nice if the rocker could forward the build error to the printout, rather than needing to manually build the same dockerfile to identify the exact error.

$ docker build -t temp /tmp/tmpg_lv8g3_/
Sending build context to Docker daemon  4.096kB
Step 1/16 : FROM nvidia/opengl:1.0-glvnd-devel-ubuntu18.04 as glvnd
 ---> 04c47f164887
Step 2/16 : FROM osrf/ros:crystal-desktop
 ---> c3d97d8c2f50
Step 3/16 : COPY --from=glvnd /usr/local/lib/x86_64-linux-gnu /usr/local/lib/x86_64-linux-gnu
COPY failed: stat /var/lib/docker/overlay2/471568f79754e1b366acbc4647bda7de3ccc8bde738d60023154c746cbcb85a7/merged/usr/local/lib/x86_64-linux-gnu: no such file or directory

Dockerfile

# Preamble from extension [nvidia]
# Ubuntu 16.04 with nvidia-docker2 beta opengl support
FROM nvidia/opengl:1.0-glvnd-devel-ubuntu18.04 as glvnd

# Preamble from extension [pulse]

# Preamble from extension [user]


FROM osrf/ros:crystal-desktop
# Snippet from extension [nvidia]
# Open nvidia-docker2 GL support
COPY --from=glvnd /usr/local/lib/x86_64-linux-gnu /usr/local/lib/x86_64-linux-gnu
COPY --from=glvnd /usr/local/lib/i386-linux-gnu /usr/local/lib/i386-linux-gnu
COPY --from=glvnd /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu
COPY --from=glvnd /usr/lib/i386-linux-gnu /usr/lib/i386-linux-gnu

COPY --from=glvnd /usr/local/share/glvnd/egl_vendor.d/10_nvidia.json /usr/local/share/glvnd/egl_vendor.d/10_nvidia.json

# if the path is alreaady present don't fail because of being unable to append
RUN ( echo '/usr/local/lib/x86_64-linux-gnu' >> /etc/ld.so.conf.d/glvnd.conf && ldconfig || grep -q /usr/local/lib/x86_64-linux-gnu /etc/ld.so.conf.d/glvnd.conf ) && \
    ( echo '/usr/local/lib/i386-linux-gnu' >> /etc/ld.so.conf.d/glvnd.conf &&  ldconfig || grep -q /usr/local/lib/i386-linux-gnu /etc/ld.so.conf.d/glvnd.conf )

ENV LD_LIBRARY_PATH /usr/local/lib/x86_64-linux-gnu:/usr/local/lib/i386-linux-gnu${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

ENV NVIDIA_VISIBLE_DEVICES ${NVIDIA_VISIBLE_DEVICES:-all}
ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics

# Snippet from extension [pulse]
RUN mkdir -p /etc/pulse
RUN echo '\n\
# Connect to the hosts server using the mounted UNIX socket\n\
default-server = unix:/run/user/1000/pulse/native\n\
\n\
# Prevent a server running in the container\n\
autospawn = no\n\
daemon-binary = /bin/true\n\
\n\
# Prevent the use of shared memory\n\
enable-shm = false\n\
\n'\
> /etc/pulse/client.conf

# Snippet from extension [user]
# make sure sudo is installed to be able to give user sudo access in docker
RUN apt-get update \
 && apt-get install -y \
    sudo \
 && apt-get clean


RUN useradd -U --uid 1000 -ms /bin/bash ubuntu \
 && echo "ubuntu:ubuntu" | chpasswd \
 && adduser ubuntu sudo \
 && echo "ubuntu ALL=NOPASSWD: ALL" >> /etc/sudoers.d/ubuntu

# Commands below run as the developer user
USER ubuntu
@tfoote tfoote added the bug Something isn't working label Jan 10, 2019
@tfoote
Copy link
Collaborator

tfoote commented Jan 10, 2019

Hmm I can't reproduce this issue:

$ rocker --nvidia --user --pull --pulse osrf/ros:crystal-desktop rviz2 Plugins found: ['dev_helpers', 'home', 'nvidia', 'pulse', 'user'] Active extensions ['nvidia', 'pulse', 'user'] Pulling image osrf/ros:crystal-desktop b'{"status":"Pulling from osrf/ros","id":"crystal-desktop"}\r\n' b'{"status":"Digest: sha256:62579d806386b2b3ff2ecf3924f0ba39b8d8422fb7979db42e469cfbfd26e19f"}\r\n' b'{"status":"Status: Image is up to date for osrf/ros:crystal-desktop"}\r\n' Writing dockerfile to /tmp/tmpslr3q80k/Dockerfile vvvvvv # Preamble from extension [nvidia] # Ubuntu 16.04 with nvidia-docker2 beta opengl support FROM nvidia/opengl:1.0-glvnd-devel-ubuntu16.04 as glvnd

Preamble from extension [pulse]

Preamble from extension [user]

FROM osrf/ros:crystal-desktop

Snippet from extension [nvidia]

Open nvidia-docker2 GL support

COPY --from=glvnd /usr/local/lib/x86_64-linux-gnu /usr/local/lib/x86_64-linux-gnu
COPY --from=glvnd /usr/local/lib/i386-linux-gnu /usr/local/lib/i386-linux-gnu
COPY --from=glvnd /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu
COPY --from=glvnd /usr/lib/i386-linux-gnu /usr/lib/i386-linux-gnu

COPY --from=glvnd /usr/local/share/glvnd/egl_vendor.d/10_nvidia.json /usr/local/share/glvnd/egl_vendor.d/10_nvidia.json

if the path is alreaady present don't fail because of being unable to append

RUN ( echo '/usr/local/lib/x86_64-linux-gnu' >> /etc/ld.so.conf.d/glvnd.conf && ldconfig || grep -q /usr/local/lib/x86_64-linux-gnu /etc/ld.so.conf.d/glvnd.conf ) &&
( echo '/usr/local/lib/i386-linux-gnu' >> /etc/ld.so.conf.d/glvnd.conf && ldconfig || grep -q /usr/local/lib/i386-linux-gnu /etc/ld.so.conf.d/glvnd.conf )

ENV LD_LIBRARY_PATH /usr/local/lib/x86_64-linux-gnu:/usr/local/lib/i386-linux-gnu${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

ENV NVIDIA_VISIBLE_DEVICES ${NVIDIA_VISIBLE_DEVICES:-all}
ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics

Snippet from extension [pulse]

RUN mkdir -p /etc/pulse
RUN echo '\n\

Connect to the hosts server using the mounted UNIX socket\n\

default-server = unix:/run/user/1000/pulse/native\n
\n\

Prevent a server running in the container\n\

autospawn = no\n
daemon-binary = /bin/true\n
\n\

Prevent the use of shared memory\n\

enable-shm = false\n
\n'\

/etc/pulse/client.conf

Snippet from extension [user]

make sure sudo is installed to be able to give user sudo access in docker

RUN apt-get update
&& apt-get install -y
sudo
&& apt-get clean

RUN useradd -U --uid 1000 -ms /bin/bash tfoote
&& echo "tfoote:tfoote" | chpasswd
&& adduser tfoote sudo
&& echo "tfoote ALL=NOPASSWD: ALL" >> /etc/sudoers.d/tfoote

Commands below run as the developer user

USER tfoote

^^^^^^
Building docker file with arguments: {'rm': True, 'path': '/tmp/tmpslr3q80k', 'nocache': False, 'decode': True, 'tag': 'rocker_osrf/ros:crystal-desktop_nvidia_pulse_user'}
building > Step 1/16 : FROM nvidia/opengl:1.0-glvnd-devel-ubuntu16.04 as glvnd
building > ---> 9bf691023f43
building > Step 2/16 : FROM osrf/ros:crystal-desktop
building > ---> c3d97d8c2f50
building > Step 3/16 : COPY --from=glvnd /usr/local/lib/x86_64-linux-gnu /usr/local/lib/x86_64-linux-gnu
building > ---> Using cache
building > ---> 498b47d0c958
building > Step 4/16 : COPY --from=glvnd /usr/local/lib/i386-linux-gnu /usr/local/lib/i386-linux-gnu
building > ---> Using cache
building > ---> 56dade6f28cc
building > Step 5/16 : COPY --from=glvnd /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu
building > ---> Using cache
building > ---> d9c2cd51de92
building > Step 6/16 : COPY --from=glvnd /usr/lib/i386-linux-gnu /usr/lib/i386-linux-gnu
building > ---> Using cache
building > ---> f92176bc7541
building > Step 7/16 : COPY --from=glvnd /usr/local/share/glvnd/egl_vendor.d/10_nvidia.json /usr/local/share/glvnd/egl_vendor.d/10_nvidia.json
building > ---> Using cache
building > ---> 9f57e8a712dc
building > Step 8/16 : RUN ( echo '/usr/local/lib/x86_64-linux-gnu' >> /etc/ld.so.conf.d/glvnd.conf && ldconfig || grep -q /usr/local/lib/x86_64-linux-gnu /etc/ld.so.conf.d/glvnd.conf ) && ( echo '/usr/local/lib/i386-linux-gnu' >> /etc/ld.so.conf.d/glvnd.conf && ldconfig || grep -q /usr/local/lib/i386-linux-gnu /etc/ld.so.conf.d/glvnd.conf )
building > ---> Using cache
building > ---> 6c8e23dd281c
building > Step 9/16 : ENV LD_LIBRARY_PATH /usr/local/lib/x86_64-linux-gnu:/usr/local/lib/i386-linux-gnu${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
building > ---> Using cache
building > ---> 6fbdf26b45e9
building > Step 10/16 : ENV NVIDIA_VISIBLE_DEVICES ${NVIDIA_VISIBLE_DEVICES:-all}
building > ---> Using cache
building > ---> cc2e1f68e5f9
building > Step 11/16 : ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics
building > ---> Using cache
building > ---> b9503a789fdc
building > Step 12/16 : RUN mkdir -p /etc/pulse
building > ---> Running in a6fb598c8159
building > Removing intermediate container a6fb598c8159
building > ---> 05e276f4c3a7
building > Step 13/16 : RUN echo '\ndefault-server = unix:/run/user/1000/pulse/native\n\nautospawn = no\ndaemon-binary = /bin/true\n\nenable-shm = false\n\n'> /etc/pulse/client.conf
building > ---> Running in 054799a5fc57
building > Removing intermediate container 054799a5fc57
building > ---> 3cb97f7b765e
building > Step 14/16 : RUN apt-get update && apt-get install -y sudo && apt-get clean
building > ---> Running in cceb22bf956a
building > Get:1 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
building > Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]
building > Get:3 http://packages.ros.org/ros2/ubuntu bionic InRelease [2562 B]
building > Get:4 http://packages.ros.org/ros2/ubuntu bionic/main amd64 Packages [206 kB]
building > Get:5 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [303 kB]
building > Get:6 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
building > Get:7 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
building > Get:8 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1344 kB]
building > Get:9 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [135 kB]
building > Get:10 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [1365 B]
building > Get:11 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [11.3 MB]
building > Get:12 http://archive.ubuntu.com/ubuntu bionic/restricted amd64 Packages [13.5 kB]
building > Get:13 http://archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [186 kB]
building > Get:14 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [6933 B]
building > Get:15 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [628 kB]
building > Get:16 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [903 kB]
building > Get:17 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [10.7 kB]
building > Get:18 http://archive.ubuntu.com/ubuntu bionic-backports/universe amd64 Packages [3655 B]
building > Fetched 15.6 MB in 4s (3647 kB/s)
Reading package lists...
building > Reading package lists...
building > Building dependency tree...
building >
Reading state information...
building > The following NEW packages will be installed:
building > sudo
building > 0 upgraded, 1 newly installed, 0 to remove and 22 not upgraded.
Need to get 428 kB of archives.
After this operation, 1765 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic/main amd64 sudo amd64 1.8.21p2-3ubuntu1 [428 kB]
building > debconf: delaying package configuration, since apt-utils is not installed

building > Fetched 428 kB in 1s (355 kB/s)
building > Selecting previously unselected package sudo.
(Reading database ...
building > (Reading database ... 5%
building > (Reading database ... 10%
building > (Reading database ... 15%
building > (Reading database ... 20%
building > (Reading database ... 25%
building > (Reading database ... 30%
building > (Reading database ... 35%
building > (Reading database ... 40%
(Reading database ... 90%ase ... 45%
(Reading database ... 101501 files and directories currently installed.)
building > Preparing to unpack .../sudo_1.8.21p2-3ubuntu1_amd64.deb ...
building > Unpacking sudo (1.8.21p2-3ubuntu1) ...
building > Setting up sudo (1.8.21p2-3ubuntu1) ...
building > Removing intermediate container cceb22bf956a
building > ---> bcb88c9e29c5
building > Step 15/16 : RUN useradd -U --uid 1000 -ms /bin/bash tfoote && echo "tfoote:tfoote" | chpasswd && adduser tfoote sudo && echo "tfoote ALL=NOPASSWD: ALL" >> /etc/sudoers.d/tfoote
building > ---> Running in b7b13f6db91d
building > Adding user tfoote' to group sudo' ...
building > Adding user tfoote to group sudo
building > Done.
building > Removing intermediate container b7b13f6db91d
building > ---> 63b810881911
building > Step 16/16 : USER tfoote
building > ---> Running in 0478bee3e6fc
building > Removing intermediate container 0478bee3e6fc
building > ---> 0fdc821b3890
building > Successfully built 0fdc821b3890
building > Successfully tagged rocker_osrf/ros:crystal-desktop_nvidia_pulse_user
xauth: /tmp/.docker.xauth not writable, changes will be ignored
Failed setting up XAuthority with command xauth nlist :0 | sed -e 's/^..../ffff/' | xauth -f /tmp/.docker.xauth nmerge -
Failed to precondition for extension [nvidia] with error: Command 'xauth nlist :0 | sed -e 's/^..../ffff/' | xauth -f /tmp/.docker.xauth nmerge -' returned non-zero exit status 1
deactivating
Executing command:
docker run -it --rm -e DISPLAY -e TERM -e QT_X11_NO_MITSHM=1 -e XAUTHORITY=/tmp/.docker.xauth -v /tmp/.docker.xauth:/tmp/.docker.xauth -v /tmp/.X11-unix:/tmp/.X11-unix -v /etc/localtime:/etc/localtime:ro --runtime=nvidia --security-opt seccomp=unconfined -v /run/user/1000/pulse:/run/user/1000/pulse --device /dev/snd -e PULSE_SERVER=unix:/run/user/1000/pulse/native -v /run/user/1000/pulse/native:/run/user/1000/pulse/native --group-add 29 rocker_osrf/ros:crystal-desktop_nvidia_pulse_user rviz2
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-tfoote'
[INFO] [rviz2]: Stereo is NOT SUPPORTED
[INFO] [rviz2]: OpenGl version: 4.5 (GLSL 4.5)
[INFO] [rviz2]: Stereo is NOT SUPPORTED

Ahh looking closer you're running on bionic while I'm running on xenial. I guess that the files are in different locations in the bionic base image. :-\ It looks like we'll need more conditional logic.

@tfoote tfoote changed the title x86_64-linux-gnu: no such file or directory nvidia overlay failing on bionic: x86_64-linux-gnu: no such file or directory Jan 10, 2019
@tfoote tfoote added the nvidia Connected to the nvidia extension label Jan 10, 2019
@ruffsl
Copy link
Member Author

ruffsl commented Jan 10, 2019

For bionic and up, wouldn't we only need to install libglvnd-dev and libglvnd0?

See back to osrf/docker_templates#33 (comment)

tfoote added a commit that referenced this issue Jan 10, 2019
tfoote added a commit that referenced this issue Jan 31, 2019
Resolves #14

Build on top of the image based os detection and eliminate os detection dependency.
tfoote added a commit that referenced this issue Feb 1, 2019
Resolves #14

Build on top of the image based os detection and eliminate os detection dependency.
@tfoote tfoote closed this as completed in 0195c8a Feb 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working nvidia Connected to the nvidia extension
Projects
None yet
Development

No branches or pull requests

2 participants