GithubHelp home page GithubHelp logo

Comments (6)

mrm-mmh avatar mrm-mmh commented on July 3, 2024 3

I've been able to find a workaround by adding sudo rights to the user in the run.sh and launching with sudo:

#!/bin/bash

XSOCK=/tmp/.X11-unix
XAUTH=$HOME/.Xauthority

VOLUMES="--volume=$XSOCK:$XSOCK:rw
         --volume=$XAUTH:$XAUTH:rw
         --volume=$(pwd)/autoware-contents:/home/autoware/autoware-contents:ro"

RUNTIME=""
DOCKER_VERSION=$(docker version --format '{{.Client.Version}}' | cut --delimiter=. --fields=1,2)
if [[ $DOCKER_VERSION < "19.03" ]] && ! type nvidia-docker; then
    RUNTIME="--gpus all"
else
    RUNTIME="--runtime=nvidia"
fi

docker run \
    -it --rm \
    $VOLUMES \
    --env="XAUTHORITY=${XAUTH}" \
    --env="DISPLAY=${DISPLAY}" \
    --privileged \
    --net=host \
    --user $(id -u ${USER}):$(id -g ${USER}) \
    --group-add sudo \
    $RUNTIME \
    carla-autoware:latest

sudo ./run.sh

However, I agree with wuxiaohua1011 that the container should be adapted so that sudo is not required.

Hope that helps for now!

from carla-autoware.

wuxiaohua1011 avatar wuxiaohua1011 commented on July 3, 2024 2

I've been able to find a workaround by adding sudo rights to the user in the run.sh and launching with sudo:

#!/bin/bash

XSOCK=/tmp/.X11-unix
XAUTH=$HOME/.Xauthority

VOLUMES="--volume=$XSOCK:$XSOCK:rw
         --volume=$XAUTH:$XAUTH:rw
         --volume=$(pwd)/autoware-contents:/home/autoware/autoware-contents:ro"

RUNTIME=""
DOCKER_VERSION=$(docker version --format '{{.Client.Version}}' | cut --delimiter=. --fields=1,2)
if [[ $DOCKER_VERSION < "19.03" ]] && ! type nvidia-docker; then
    RUNTIME="--gpus all"
else
    RUNTIME="--runtime=nvidia"
fi

docker run \
    -it --rm \
    $VOLUMES \
    --env="XAUTHORITY=${XAUTH}" \
    --env="DISPLAY=${DISPLAY}" \
    --privileged \
    --net=host \
    --user $(id -u ${USER}):$(id -g ${USER}) \
    --group-add sudo \
    $RUNTIME \
    carla-autoware:latest

sudo ./run.sh

However, I agree with wuxiaohua1011 that the container should be adapted so that sudo is not required.

Hope that helps for now!

Nice, it works great, thank you so much!

from carla-autoware.

wuxiaohua1011 avatar wuxiaohua1011 commented on July 3, 2024

Actually, I looked into this issue a bit, and it seems like this stack overflow says that you actually cannot start a docker at the root directory or something like that
https://stackoverflow.com/questions/40636618/how-to-start-a-chrooted-directory-as-a-docker-container

Which means that the docker file might have a small problem?

from carla-autoware.

charles-lei avatar charles-lei commented on July 3, 2024

I have the same problem.

from carla-autoware.

twada-cats avatar twada-cats commented on July 3, 2024

I also have same problem when run.sh is executed. I changed user as root before execution.
$ sudo su
$ ./run.sh
It did not works. Can you tell us how to solve it?

from carla-autoware.

joel-mb avatar joel-mb commented on July 3, 2024

Hi! The issue should be fixed now (#103). Feel free to re-open the issue if needed.

from carla-autoware.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.