Skip to content

Conversation

@ruffsl
Copy link
Member

@ruffsl ruffsl commented Jun 28, 2018

libglvnd0 seems to already be installed from ros-robot, so I just needed to set the ENVs.
Ties in with osrf/docker_templates#41

One odd thing however is that I can not run rviz on melodic from a ubuntu 16.04 host running nvidia-docker2. Not sure why yet. Example:

Details
#!/usr/bin/env bash

# Runs a docker container with the image created by build_demo.bash
# Requires
#   docker
#   nvidia-docker2
#   an X server
# Recommended
#   A joystick mounted to /dev/input/js0 or /dev/input/js1


# Make sure processes in the container can connect to the x server
# Necessary so gazebo can create a context for OpenGL rendering (even headless)
XAUTH=/tmp/.docker.xauth
if [ ! -f $XAUTH ]
then
    xauth_list=$(xauth nlist :0 | sed -e 's/^..../ffff/')
    if [ ! -z "$xauth_list" ]
    then
        echo $xauth_list | xauth -f $XAUTH nmerge -
    else
        touch $XAUTH
    fi
    chmod a+r $XAUTH
fi

docker run -it --rm \
  --runtime=nvidia \
  --env DISPLAY \
  --env QT_X11_NO_MITSHM=1 \
  --env XAUTHORITY=$XAUTH \
  --volume "$XAUTH:$XAUTH" \
  --volume "/tmp/.X11-unix:/tmp/.X11-unix" \
  --volume "/etc/localtime:/etc/localtime:ro" \
  --volume "/dev/input:/dev/input" \
  --privileged \
  osrf/ros:melodic-desktop-bionic \
  bash -c "roscore & rviz"

<\details>


root@590ee20f885a:/# rviz
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
[ INFO] [1530146048.886593550]: rviz version 1.13.1
[ INFO] [1530146048.886641829]: compiled against Qt version 5.9.5
[ INFO] [1530146048.886652215]: compiled against OGRE version 1.9.0 (Ghadamon)
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
[ INFO] [1530146050.064950979]: Stereo is NOT SUPPORTED
[ INFO] [1530146050.066417371]: OpenGl version: 4.5 (GLSL 4.5).
libpng warning: iCCP: known incorrect sRGB profile
Segmentation fault (core dumped)

<\details>

libglvnd0 seems to already be installed from ros-robot
@AustinDeric
Copy link

AustinDeric commented Jul 14, 2018

@ruffsl I also get the segfault. I notice this image is not based on the nvidia/cuda ubuntu image therefore the `nvidia-smi command doesn't work.

I have some (and it looks like you do too) ros-nvidia images based on the nvidia/cuda docker image:
https://github.com/ros-industrial/docker/blob/master/ros-core-nvidia/kinetic/Dockerfile

Why not have an "official" ros docker image based on the nvidia/cuda image? I also think that solves this problem. I still get the segfault with the nvidia ubuntu image.

Here is my dockerfile: # nvidia-docker build -t rosindustrial/ros-core-nvidia:latest . FROM nvidia/cuda:9.2-devel-ubuntu16.04 LABEL maintainer "Austin.Deric@gmail.org"

Setup your sources.list

RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu xenial main" > /etc/apt/sources.list.d/ros-latest.list'

Set up your keys

RUN apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116

Installation

RUN apt-get update && apt-get install -y
ros-kinetic-desktop-full
&& rm -rf /var/lib/apt/lists/*

Initialize rosdep

RUN rosdep init
RUN rosdep update

RUN echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc

RUN apt-get update && apt-get install -y
python-rosinstall
python-rosinstall-generator
python-wstool
build-essential
&& rm -rf /var/lib/apt/lists/*

Or, you can pull it here:
https://hub.docker.com/r/austinderic/ros-desktop-full/

@ruffsl
Copy link
Member Author

ruffsl commented Jul 18, 2018

Ok, looks like it might be an issue with the current release binary of rviz:

ros-melodic-rviz/now 1.13.1-0bionic.20180710.192735 amd64 [installed,local]

As I just created a child image that builds rviz from source using current devel branch and that seems to run fine without segfaulting. See gist here:

https://gist.github.com/ruffsl/e7ca631a618ece3eb0be8e4bf168accb

Which is odd given that that release above stems from the current head of the devel branch:
ros-visualization/rviz@070835c

@ruffsl ruffsl requested a review from tfoote November 6, 2018 00:31
@ruffsl
Copy link
Member Author

ruffsl commented Nov 6, 2018

@tfoote @flx42 , I just checked this again today, and it seem the issue with rviz above has been resolved, and I can't reproduce the issue. Let me know if you have any suggestions.

Copy link
Contributor

@tfoote tfoote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we have the ability to run docker images in nvidia docker without baking in the nvidia before hand using: https://github.com/osrf/rocker

I think it makes sense to not bake those things into the core images.

@ruffsl
Copy link
Member Author

ruffsl commented Jan 3, 2019

Now that we have the ability to run docker images in nvidia docker without baking in the nvidia before hand

Sounds fair. Seeing how modifing the envs in images alone would still require additional run arguments to set the environment, display, drivers, etc, it makes sense to outsource such configuration directly to such tools as well.

@ruffsl ruffsl closed this Jan 3, 2019
@ruffsl ruffsl deleted the ros-desktop branch June 12, 2021 02:30
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

Successfully merging this pull request may close these issues.

3 participants