AI challenge 2024の環境構築で失敗する
Q&A
Closed
解決したいこと
現在、勉強用にAI Challenge 2024にチャレンジしています。
AWSIMの起動確認を完了させたいのですがdocker_run.sh
の実行で失敗してしまいます。
環境はデュアルブートでUbuntu22.04で行っています。
問題箇所
実行箇所
./docker_run.sh dev gpu
エラー部分
Step 6/6 : CMD [ "" ]
---> Running in f77dda5a79ab
---> Removed intermediate container f77dda5a79ab
---> a60cf3812170
Successfully built a60cf3812170
Successfully tagged rocker:os_detect_aichallenge-2024-dev
running, docker run -it --rm a60cf3812170
output: Unable to find image 'a60cf3812170:latest' locally
docker: Error response from daemon: pull access denied for a60cf3812170, repository does not exist or may require 'docker login'.
See 'docker run --help'.
/tmp/detect_os failed:
> Unable to find image 'a60cf3812170:latest' locally
> docker: Error response from daemon: pull access denied for a60cf3812170, repository does not exist or may require 'docker login'.
> See 'docker run --help'.
WARNING unable to detect os for base image 'aichallenge-2024-dev', maybe the base image does not exist
結果全体
Extension volume doesn't support default arguments. Please extend it.
Active extensions ['devices', 'network', 'nvidia', 'privileged', 'user', 'volume', 'x11']
Step 1/6 : FROM golang:1.19 as detector
---> 80b76a6c918c
Step 2/6 : RUN git clone -q https://github.com/dekobon/distro-detect.git && cd distro-detect && git checkout -q 5f5b9c724b9d9a117732d2a4292e6288905734e1 && CGO_ENABLED=0 go build .
---> Using cache
---> 43ed39d00ea2
Step 3/6 : FROM aichallenge-2024-dev
---> 1ae9729c29af
Step 4/6 : COPY --from=detector /go/distro-detect/distro-detect /tmp/detect_os
---> 324d23dded2b
Step 5/6 : ENTRYPOINT [ "/tmp/detect_os", "-format", "json-one-line" ]
---> Running in 58c3c57b4b86
---> Removed intermediate container 58c3c57b4b86
---> 29e7d85795ad
Step 6/6 : CMD [ "" ]
---> Running in f77dda5a79ab
---> Removed intermediate container f77dda5a79ab
---> a60cf3812170
Successfully built a60cf3812170
Successfully tagged rocker:os_detect_aichallenge-2024-dev
running, docker run -it --rm a60cf3812170
output: Unable to find image 'a60cf3812170:latest' locally
docker: Error response from daemon: pull access denied for a60cf3812170, repository does not exist or may require 'docker login'.
See 'docker run --help'.
/tmp/detect_os failed:
> Unable to find image 'a60cf3812170:latest' locally
> docker: Error response from daemon: pull access denied for a60cf3812170, repository does not exist or may require 'docker login'.
> See 'docker run --help'.
WARNING unable to detect os for base image 'aichallenge-2024-dev', maybe the base image does not exist
該当するソースコード
docker_run.sh
#!/bin/bash
target=${1}
device=${2}
case "${target}" in
"eval")
volume="output:/output"
;;
"dev")
volume="output:/output aichallenge:/aichallenge"
;;
*)
echo "invalid argument (use 'dev' or 'eval')"
exit 1
;;
esac
case "${device}" in
"cpu")
opts=""
;;
"gpu")
opts="--nvidia"
;;
*)
echo "invalid argument (use 'gpu' or 'cpu')"
exit 1
;;
esac
mkdir -p output
# shellcheck disable=SC2086
rocker ${opts} --x11 --device /dev/dri --user --net host --privileged --volume ${volume} -- "aichallenge-2024-${target}"
DockerFile
# FROM osrf/ros:humble-desktop AS common
FROM ghcr.io/automotiveaichallenge/autoware-universe:humble-latest AS common
RUN apt-get update
RUN apt-get -y install libgl1-mesa-glx libgl1-mesa-dri
RUN apt-get -y install iproute2
RUN apt-get -y install wmctrl
RUN apt-get -y install ros-humble-rqt-tf-tree
RUN apt-get -y install ros-humble-rqt-graph
# PATH="$PATH:/root/.local/bin"
# PATH="/usr/local/cuda/bin:$PATH"
ENV XDG_RUNTIME_DIR=/tmp/xdg
ENV ROS_LOCALHOST_ONLY=1
ENV RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
FROM common AS dev
ENV RCUTILS_COLORIZED_OUTPUT=1
FROM common AS eval
ENV RCUTILS_COLORIZED_OUTPUT=0
RUN mkdir /ws
RUN git clone --depth 1 https://github.com/AutomotiveAIChallenge/aichallenge-2024 /ws/repository
RUN mv /ws/repository/aichallenge /aichallenge
RUN rm -rf /aichallenge/simulator
RUN rm -rf /aichallenge/workspace/src/aichallenge_submit
RUN chmod 777 /aichallenge
COPY aichallenge/simulator/ /aichallenge/simulator/
COPY submit/aichallenge_submit.tar.gz /ws
RUN tar zxf /ws/aichallenge_submit.tar.gz -C /aichallenge/workspace/src
RUN rm -rf /ws
RUN bash -c ' \
source /autoware/install/setup.bash; \
cd /aichallenge/workspace; \
rosdep update; \
rosdep install -y -r -i --from-paths src --ignore-src --rosdistro $ROS_DISTRO; \
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release'
ENTRYPOINT []
CMD ["bash", "/aichallenge/run_evaluation.bash"]
自分で試したこと
docker login
などを実施しました。
ビルドが悪いのかもしれないと思い、docker_build.sh
もみてみましたが気になる部分はありませんでした。
ビルドコマンド
docker build --target "dev" -t "aichallenge-2024-dev" .
こちらは問題なくビルドできていそうでした。
その他イメージがあるのか確認しました。
docker imageの結果
REPOSITORY TAG IMAGE ID CREATED SIZE
aichallenge-2024-dev latest 9c685e5d146f 2 days ago 14.1GB
ghcr.io/automotiveaichallenge/autoware-universe humble-latest bea365a548de 3 months ago 14GB
最後に
もし他に必要な情報や出していたらまずいものがあれば教えてくださいm(_ _)m
更新分 1
環境設定が干渉してる?
echo $PYTHONPATH
/opt/ros/humble/lib/python3.10/site-packages:/opt/ros/humble/local/lib/python3.10/dist-packages:/opt/ros/humble/local/lib/python3.10/dist-packages
更新分 2
sudo
でやるとうまく行くけどユーザが変わる
herniababy@herniababy-XA5R-R37:~/aichallenge-2024$ sudo rocker --nvidia --x11 --device /dev/dri --user --net host --privileged --volume dev -- "aichallenge-2024-dev"
結果
Extension volume doesn't support default arguments. Please extend it.
Active extensions ['devices', 'network', 'nvidia', 'privileged', 'user', 'volume', 'x11']
Step 1/6 : FROM golang:1.19 as detector
---> 80b76a6c918c
Step 2/6 : RUN git clone -q https://github.com/dekobon/distro-detect.git && cd distro-detect && git checkout -q 5f5b9c724b9d9a117732d2a4292e6288905734e1 && CGO_ENABLED=0 go build .
---> Using cache
---> 43ed39d00ea2
Step 3/6 : FROM aichallenge-2024-dev
---> 1ae9729c29af
Step 4/6 : COPY --from=detector /go/distro-detect/distro-detect /tmp/detect_os
---> 3063ce96d832
Step 5/6 : ENTRYPOINT [ "/tmp/detect_os", "-format", "json-one-line" ]
---> Running in 45a75d4e1762
---> Removed intermediate container 45a75d4e1762
---> 7a223ffa45b8
Step 6/6 : CMD [ "" ]
---> Running in 857c3f501988
---> Removed intermediate container 857c3f501988
---> aa68709effd7
Successfully built aa68709effd7
Successfully tagged rocker:os_detect_aichallenge-2024-dev
running, docker run -it --rm aa68709effd7
output: {"name":"Ubuntu","id":"ubuntu","version":"22.04","lsb_release":{"DISTRIB_CODENAME":"jammy","DISTRIB_DESCRIPTION":"Ubuntu 22.04.4 LTS","DISTRIB_ID":"Ubuntu","DISTRIB_RELEASE":"22.04"},"os_release":{"BUG_REPORT_URL":"https://bugs.launchpad.net/ubuntu/","HOME_URL":"https://www.ubuntu.com/","ID":"ubuntu","ID_LIKE":"debian","NAME":"Ubuntu","PRETTY_NAME":"Ubuntu 22.04.4 LTS","PRIVACY_POLICY_URL":"https://www.ubuntu.com/legal/terms-and-policies/privacy-policy","SUPPORT_URL":"https://help.ubuntu.com/","UBUNTU_CODENAME":"jammy","VERSION":"22.04.4 LTS (Jammy Jellyfish)","VERSION_CODENAME":"jammy","VERSION_ID":"22.04"}}
Writing dockerfile to /tmp/tmpmipbyptz/Dockerfile
vvvvvv
# Preamble from extension [devices]
# Preamble from extension [network]
# 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 [privileged]
# Preamble from extension [user]
# Preamble from extension [volume]
# Preamble from extension [x11]
FROM aichallenge-2024-dev
USER root
# Snippet from extension [devices]
# Snippet from extension [network]
# Snippet from extension [nvidia]
RUN apt-get update && apt-get install -y --no-install-recommends \
libglvnd0 \
libgl1 \
libglx0 \
libegl1 \
libgles2 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=glvnd /usr/share/glvnd/egl_vendor.d/10_nvidia.json /usr/share/glvnd/egl_vendor.d/10_nvidia.json
ENV NVIDIA_VISIBLE_DEVICES ${NVIDIA_VISIBLE_DEVICES:-all}
ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES:-all}
# Snippet from extension [privileged]
# Snippet from extension [user]
# make sure sudo is installed to be able to give user sudo access in docker
RUN if ! command -v sudo >/dev/null; then \
apt-get update \
&& apt-get install -y sudo \
&& apt-get clean; \
fi
# Detected user is root, which already exists so not creating new user.
# Snippet from extension [volume]
# Snippet from extension [x11]
USER root
# User Snippet from extension [devices]
# User Snippet from extension [network]
# User Snippet from extension [nvidia]
# User Snippet from extension [privileged]
# User Snippet from extension [user]
# User Snippet from extension [volume]
# User Snippet from extension [x11]
^^^^^^
Building docker file with arguments: {'path': '/tmp/tmpmipbyptz', 'rm': True, 'nocache': False, 'pull': False}
building > Step 1/9 : FROM nvidia/opengl:1.0-glvnd-devel-ubuntu18.04 as glvnd
building > ---> 9d806b36b807
building > Step 2/9 : FROM aichallenge-2024-dev
building > ---> 1ae9729c29af
building > Step 3/9 : USER root
building > ---> Using cache
building > ---> 2fc0dd9124e3
building > Step 4/9 : RUN apt-get update && apt-get install -y --no-install-recommends libglvnd0 libgl1 libglx0 libegl1 libgles2 && rm -rf /var/lib/apt/lists/*
building > ---> Using cache
building > ---> 646179ef4633
building > Step 5/9 : COPY --from=glvnd /usr/share/glvnd/egl_vendor.d/10_nvidia.json /usr/share/glvnd/egl_vendor.d/10_nvidia.json
building > ---> Using cache
building > ---> 145f6974b1fc
building > Step 6/9 : ENV NVIDIA_VISIBLE_DEVICES ${NVIDIA_VISIBLE_DEVICES:-all}
building > ---> Using cache
building > ---> c02dfb45ea18
building > Step 7/9 : ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES:-all}
building > ---> Using cache
building > ---> 086bb576e0e4
building > Step 8/9 : RUN if ! command -v sudo >/dev/null; then apt-get update && apt-get install -y sudo && apt-get clean; fi
building > ---> Using cache
building > ---> e74aef60235e
building > Step 9/9 : USER root
building > ---> Using cache
building > ---> 979b2c2fa80e
building > Successfully built 979b2c2fa80e
Executing command:
docker run --rm -it --device /dev/dri --network host --gpus all --privileged -v /home/herniababy/aichallenge-2024/dev:/home/herniababy/aichallenge-2024/dev -e DISPLAY -e TERM -e QT_X11_NO_MITSHM=1 -e XAUTHORITY=/tmp/.dockere4fly97t.xauth -v /tmp/.dockere4fly97t.xauth:/tmp/.dockere4fly97t.xauth -v /tmp/.X11-unix:/tmp/.X11-unix -v /etc/localtime:/etc/localtime:ro 979b2c2fa80e
root@herniababy-XA5R-R37:/autoware#