From 37773cde418e752cad14efd175e1f35c440f8892 Mon Sep 17 00:00:00 2001 From: Ar-Ray-code Date: Sat, 21 Sep 2024 16:06:28 +0900 Subject: [PATCH 1/5] support ubuntu24 (but there is not tested) --- .../docker/onnxruntime/docker-compose.yaml | 16 ++-- yolox_ros_cpp/docker/onnxruntime/dockerfile | 88 ++++++++----------- .../docker/onnxruntime/ros_entrypoint.sh | 3 +- .../docker/openvino/docker-compose.yaml | 7 +- yolox_ros_cpp/docker/openvino/dockerfile | 23 +++-- .../docker/openvino/ros_entrypoint.sh | 4 +- .../docker/tensorrt/docker-compose.yaml | 17 ++-- yolox_ros_cpp/docker/tensorrt/dockerfile | 36 ++++---- .../docker/tensorrt/ros_entrypoint.sh | 3 +- 9 files changed, 91 insertions(+), 106 deletions(-) diff --git a/yolox_ros_cpp/docker/onnxruntime/docker-compose.yaml b/yolox_ros_cpp/docker/onnxruntime/docker-compose.yaml index 2314989..26fc8c4 100644 --- a/yolox_ros_cpp/docker/onnxruntime/docker-compose.yaml +++ b/yolox_ros_cpp/docker/onnxruntime/docker-compose.yaml @@ -5,17 +5,23 @@ services: build: context: . args: - - BASE_TAB=12.1.0-cudnn8-devel-ubuntu22.04 - image: fateshelled/onnxruntime_yolox_ros:latest + - BASE_TAB=12.6.1-cudnn-devel-ubuntu24.04 network_mode: host - runtime: nvidia + deploy: + resources: + reservations: + devices: + - driver: nvidia + count: 1 + capabilities: [gpu] + environment: - DISPLAY=$DISPLAY volumes: - $HOME/ros2_ws:/root/ros2_ws - /tmp/.X11-unix:/tmp/.X11-unix - devices: - - "/dev/video0:/dev/video0" + # devices: + # - "/dev/video0:/dev/video0" working_dir: /root/ros2_ws tty: true command: bash diff --git a/yolox_ros_cpp/docker/onnxruntime/dockerfile b/yolox_ros_cpp/docker/onnxruntime/dockerfile index 8bf1dbd..f1ead4f 100644 --- a/yolox_ros_cpp/docker/onnxruntime/dockerfile +++ b/yolox_ros_cpp/docker/onnxruntime/dockerfile @@ -1,63 +1,47 @@ -ARG BASE_TAG=11.7.1-cudnn8-devel-ubuntu22.04 -FROM nvcr.io/nvidia/cuda:${BASE_TAG} -ENV DEBIAN_FRONTEND=noninteractive +ARG BASE_TAG=12.6.1-cudnn-devel-ubuntu24.04 +FROM nvidia/cuda:${BASE_TAG} -ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH} -RUN apt update && \ - apt install -y python3-dev python3-pip \ - ca-certificates g++ gcc make git aria2 && \ - apt -y clean && \ - rm -rf /var/lib/apt/lists/* && \ - aria2c -q -d /tmp -o cmake-3.21.0-linux-x86_64.tar.gz https://github.com/Kitware/CMake/releases/download/v3.21.0/cmake-3.21.0-linux-x86_64.tar.gz && \ - tar -zxf /tmp/cmake-3.21.0-linux-x86_64.tar.gz --strip=1 -C /usr -RUN python3 -m pip install -U pip && \ - python3 -m pip install -U numpy setuptools wheel && \ - python3 -m pip cache purge +ENV TZ=Asia/Tokyo +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +ENV DEBIAN_FRONTEND=noninteractive -WORKDIR /workdir -RUN git clone --depth 1 --recursive https://github.com/microsoft/onnxruntime -b v1.12.1 && \ - cd onnxruntime && \ - ./build.sh --cudnn_home /usr/lib/x86_64-linux-gnu/ \ - --cuda_home /usr/local/cuda \ - --use_cuda \ - --config RelWithDebInfo \ - --build_shared_lib \ - --skip_tests && \ - cd build/Linux/RelWithDebInfo && \ - make install && \ - rm -r /workdir/onnxruntime +ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH} -# Install ROS2 -RUN apt update && apt install locales && \ +RUN apt update && apt install -y locales git cmake wget curl gnupg2 lsb-release python3-numpy python3-setuptools python3-wheel && \ locale-gen en_US en_US.UTF-8 && \ update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 && \ apt -y clean && \ rm -rf /var/lib/apt/lists/* ENV LANG=en_US.UTF-8 -RUN apt update && \ - apt install -y git wget curl gnupg2 lsb-release && \ - curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \ - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null && \ - sed -i -e 's/ubuntu .* main/ubuntu jammy main/g' /etc/apt/sources.list.d/ros2.list && \ - apt update && \ - apt install -y ros-dev-tools \ - ros-humble-cv-bridge \ - ros-humble-generate-parameter-library \ - ros-humble-parameter-traits \ - ros-humble-ros-base \ - ros-humble-rqt-image-view \ - ros-humble-v4l2-camera && \ - apt -y clean && \ - rm -rf /var/lib/apt/lists/* && \ - pip install -U pip && \ - pip install catkin_pkg && \ - pip install empy && \ - pip install lark && \ - python3 -m pip cache purge +WORKDIR /workdir +# RUN git clone --depth 1 --recursive https://github.com/microsoft/onnxruntime -b v1.12.1 && \ +# cd onnxruntime && \ +# ./build.sh --cudnn_home /usr/lib/x86_64-linux-gnu/ \ +# --cuda_home /usr/local/cuda \ +# --use_cuda \ +# --config RelWithDebInfo \ +# --build_shared_lib \ +# --skip_tests && \ +# cd build/Linux/RelWithDebInfo && \ +# make install && \ +# rm -r /workdir/onnxruntime +# RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \ +# echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null && \ +# sed -i -e 's/ubuntu .* main/ubuntu noble main/g' /etc/apt/sources.list.d/ros2.list && \ +# apt update && \ +# apt install -y ros-dev-tools \ +# ros-jazzy-cv-bridge \ +# ros-jazzy-generate-parameter-library \ +# ros-jazzy-parameter-traits \ +# ros-jazzy-ros-base \ +# ros-jazzy-rqt-image-view \ +# ros-jazzy-usb-cam \ +# ros-jazzy-vision-msgs && \ +# apt -y clean && \ +# rm -rf /var/lib/apt/lists/* -COPY ./ros_entrypoint.sh /ros_entrypoint.sh -RUN echo "source /ros_entrypoint.sh" >> /root/.bashrc -# ENTRYPOINT ["/ros_entrypoint.sh"] -CMD ["bash"] +# WORKDIR /workspace +# COPY ./ros_entrypoint.sh /ros_entrypoint.sh +# RUN echo "source /ros_entrypoint.sh" >> /root/.bashrc diff --git a/yolox_ros_cpp/docker/onnxruntime/ros_entrypoint.sh b/yolox_ros_cpp/docker/onnxruntime/ros_entrypoint.sh index 7a16b1f..aa7d4f2 100755 --- a/yolox_ros_cpp/docker/onnxruntime/ros_entrypoint.sh +++ b/yolox_ros_cpp/docker/onnxruntime/ros_entrypoint.sh @@ -1,3 +1,2 @@ #!/bin/bash -source /opt/ros/humble/setup.bash -source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash +source /opt/ros/jazzy/setup.bash diff --git a/yolox_ros_cpp/docker/openvino/docker-compose.yaml b/yolox_ros_cpp/docker/openvino/docker-compose.yaml index 04d1594..95ab9c8 100644 --- a/yolox_ros_cpp/docker/openvino/docker-compose.yaml +++ b/yolox_ros_cpp/docker/openvino/docker-compose.yaml @@ -8,11 +8,10 @@ services: environment: - DISPLAY=$DISPLAY volumes: - - ../../../:/root/ros2_ws/src + - $HOME/ros2_ws:/root/ros2_ws - /tmp/.X11-unix:/tmp/.X11-unix - devices: - - "/dev/video0:/dev/video0" + # devices: + # - "/dev/video0:/dev/video0" working_dir: /root/ros2_ws tty: true command: bash - diff --git a/yolox_ros_cpp/docker/openvino/dockerfile b/yolox_ros_cpp/docker/openvino/dockerfile index 3be5630..4cba41f 100644 --- a/yolox_ros_cpp/docker/openvino/dockerfile +++ b/yolox_ros_cpp/docker/openvino/dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:22.04 +FROM ubuntu:24.04 ENV TZ=Asia/Tokyo RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone @@ -16,30 +16,27 @@ ENV LANG=en_US.UTF-8 RUN apt update && \ apt install -y git wget curl gnupg2 lsb-release -# ROS RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null && \ - sed -i -e 's/ubuntu .* main/ubuntu jammy main/g' /etc/apt/sources.list.d/ros2.list + sed -i -e 's/ubuntu .* main/ubuntu noble main/g' /etc/apt/sources.list.d/ros2.list # INTEL OPENVINO RUN wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB && \ apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB && \ - echo "deb https://apt.repos.intel.com/openvino/2024 ubuntu22 main" | tee /etc/apt/sources.list.d/intel-openvino-2024.list + echo "deb https://apt.repos.intel.com/openvino/2024 ubuntu24 main" | tee /etc/apt/sources.list.d/intel-openvino-2024.list -# install ros and openvino RUN apt update && \ apt install -y openvino-2024.2.0 \ ros-dev-tools \ - ros-humble-cv-bridge \ - ros-humble-generate-parameter-library \ - ros-humble-parameter-traits \ - ros-humble-ros-base \ - ros-humble-rqt-image-view \ - ros-humble-v4l2-camera && \ + ros-jazzy-cv-bridge \ + ros-jazzy-generate-parameter-library \ + ros-jazzy-parameter-traits \ + ros-jazzy-ros-base \ + ros-jazzy-rqt-image-view \ + ros-jazzy-usb-cam \ + ros-jazzy-vision-msgs && \ apt -y clean && \ rm -rf /var/lib/apt/lists/* WORKDIR /workspace COPY ./ros_entrypoint.sh /ros_entrypoint.sh RUN echo "source /ros_entrypoint.sh" >> /root/.bashrc -# RUN echo "source /opt/intel/openvino/bin/setupvars.sh " >> /root/.bashrc -CMD ["bash"] \ No newline at end of file diff --git a/yolox_ros_cpp/docker/openvino/ros_entrypoint.sh b/yolox_ros_cpp/docker/openvino/ros_entrypoint.sh index aa815af..aa7d4f2 100755 --- a/yolox_ros_cpp/docker/openvino/ros_entrypoint.sh +++ b/yolox_ros_cpp/docker/openvino/ros_entrypoint.sh @@ -1,4 +1,2 @@ #!/bin/bash -source /opt/ros/humble/setup.bash -source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash - +source /opt/ros/jazzy/setup.bash diff --git a/yolox_ros_cpp/docker/tensorrt/docker-compose.yaml b/yolox_ros_cpp/docker/tensorrt/docker-compose.yaml index 609100f..a459bce 100644 --- a/yolox_ros_cpp/docker/tensorrt/docker-compose.yaml +++ b/yolox_ros_cpp/docker/tensorrt/docker-compose.yaml @@ -5,18 +5,23 @@ services: build: context: . args: - - TENSORRT_VERSION=10.1 - - CUDNN_VERSION=9.2 - - PYTHON_VERSION=3.10 + - TENSORRT_VERSION=12.6 + - PYTHON_VERSION=3.12 network_mode: host - runtime: nvidia + deploy: + resources: + reservations: + devices: + - driver: nvidia + count: 1 + capabilities: [gpu] environment: - DISPLAY=$DISPLAY volumes: - $HOME/ros2_ws:/root/ros2_ws - /tmp/.X11-unix:/tmp/.X11-unix - devices: - - "/dev/video0:/dev/video0" + # devices: + # - "/dev/video0:/dev/video0" working_dir: /root/ros2_ws tty: true command: bash diff --git a/yolox_ros_cpp/docker/tensorrt/dockerfile b/yolox_ros_cpp/docker/tensorrt/dockerfile index 7542f68..f85ddfb 100644 --- a/yolox_ros_cpp/docker/tensorrt/dockerfile +++ b/yolox_ros_cpp/docker/tensorrt/dockerfile @@ -1,8 +1,8 @@ # pytorch/TensorRT/docker/Dockerfile # Base image starts with CUDA -ARG BASE_IMG=nvidia/cuda:12.4.1-devel-ubuntu22.04 +ARG BASE_IMG=nvidia/cuda:12.6.1-devel-ubuntu24.04 FROM ${BASE_IMG} as base -ENV BASE_IMG=nvidia/cuda:12.4.1-devel-ubuntu22.04 +ENV BASE_IMG=nvidia/cuda:12.6.1-devel-ubuntu24.04 ARG TENSORRT_VERSION ENV TENSORRT_VERSION=${TENSORRT_VERSION} @@ -32,8 +32,8 @@ RUN pyenv install -v ${PYTHON_VERSION} RUN pyenv global ${PYTHON_VERSION} # Install TensorRT + dependencies -RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/3bf863cc.pub -RUN add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/ /" +RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/3bf863cc.pub +RUN add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/ /" RUN apt-get update RUN TENSORRT_MAJOR_VERSION=`echo ${TENSORRT_VERSION} | cut -d '.' -f 1` && apt-get install -y tensorrt @@ -48,24 +48,22 @@ ENV LANG=en_US.UTF-8 RUN apt update && \ apt install -y git wget curl gnupg2 lsb-release && \ - curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \ + +RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null && \ - sed -i -e 's/ubuntu .* main/ubuntu jammy main/g' /etc/apt/sources.list.d/ros2.list && \ + sed -i -e 's/ubuntu .* main/ubuntu noble main/g' /etc/apt/sources.list.d/ros2.list && \ apt update && \ - apt install -y ros-dev-tools \ - ros-humble-cv-bridge \ - ros-humble-generate-parameter-library \ - ros-humble-parameter-traits \ - ros-humble-ros-base \ - ros-humble-rqt-image-view \ - ros-humble-v4l2-camera && \ + apt install -y openvino-2024.2.0 \ + ros-dev-tools \ + ros-jazzy-cv-bridge \ + ros-jazzy-generate-parameter-library \ + ros-jazzy-parameter-traits \ + ros-jazzy-ros-base \ + ros-jazzy-rqt-image-view \ + ros-jazzy-usb-cam \ + ros-jazzy-vision-msgs && \ apt -y clean && \ - rm -rf /var/lib/apt/lists/* && \ - pip install -U pip && \ - pip install catkin_pkg && \ - pip install empy==3.3.4 && \ - pip install lark && \ - python3 -m pip cache purge + rm -rf /var/lib/apt/lists/* COPY ./ros_entrypoint.sh /ros_entrypoint.sh RUN echo "source /ros_entrypoint.sh" >> /root/.bashrc diff --git a/yolox_ros_cpp/docker/tensorrt/ros_entrypoint.sh b/yolox_ros_cpp/docker/tensorrt/ros_entrypoint.sh index 7a16b1f..aa7d4f2 100755 --- a/yolox_ros_cpp/docker/tensorrt/ros_entrypoint.sh +++ b/yolox_ros_cpp/docker/tensorrt/ros_entrypoint.sh @@ -1,3 +1,2 @@ #!/bin/bash -source /opt/ros/humble/setup.bash -source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash +source /opt/ros/jazzy/setup.bash From 1bc43a4f9905fb86b2116a417a8c5d2311b0e440 Mon Sep 17 00:00:00 2001 From: Ar-Ray-code Date: Mon, 23 Sep 2024 02:48:07 +0900 Subject: [PATCH 2/5] fix docker.tensorrt --- .../docker/tensorrt/docker-compose.yaml | 1 + yolox_ros_cpp/docker/tensorrt/dockerfile | 23 +++---------------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/yolox_ros_cpp/docker/tensorrt/docker-compose.yaml b/yolox_ros_cpp/docker/tensorrt/docker-compose.yaml index a459bce..9a6b1d6 100644 --- a/yolox_ros_cpp/docker/tensorrt/docker-compose.yaml +++ b/yolox_ros_cpp/docker/tensorrt/docker-compose.yaml @@ -17,6 +17,7 @@ services: capabilities: [gpu] environment: - DISPLAY=$DISPLAY + - NVIDIA_DISABLE_REQUIRE=1 volumes: - $HOME/ros2_ws:/root/ros2_ws - /tmp/.X11-unix:/tmp/.X11-unix diff --git a/yolox_ros_cpp/docker/tensorrt/dockerfile b/yolox_ros_cpp/docker/tensorrt/dockerfile index f85ddfb..6789da1 100644 --- a/yolox_ros_cpp/docker/tensorrt/dockerfile +++ b/yolox_ros_cpp/docker/tensorrt/dockerfile @@ -17,19 +17,7 @@ ENV DEBIAN_FRONTEND=noninteractive # Install basic dependencies RUN apt-get update -RUN apt install -y build-essential manpages-dev wget zlib1g software-properties-common git libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget ca-certificates curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev mecab-ipadic-utf8 - -# Install PyEnv and desired Python version -ENV HOME="/root" -ENV PYENV_DIR="$HOME/.pyenv" -ENV PATH="$PYENV_DIR/shims:$PYENV_DIR/bin:$PATH" -RUN wget -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer &&\ - chmod 755 pyenv-installer &&\ - bash pyenv-installer &&\ - eval "$(pyenv init -)" - -RUN pyenv install -v ${PYTHON_VERSION} -RUN pyenv global ${PYTHON_VERSION} +RUN apt install -y build-essential manpages-dev wget zlib1g software-properties-common git libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev ca-certificates curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev mecab-ipadic-utf8 # Install TensorRT + dependencies RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/3bf863cc.pub @@ -37,8 +25,6 @@ RUN add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/r RUN apt-get update RUN TENSORRT_MAJOR_VERSION=`echo ${TENSORRT_VERSION} | cut -d '.' -f 1` && apt-get install -y tensorrt -ENV DEBIAN_FRONTEND=noninteractive - RUN apt update && apt install locales && \ locale-gen en_US en_US.UTF-8 && \ update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 && \ @@ -47,14 +33,13 @@ RUN apt update && apt install locales && \ ENV LANG=en_US.UTF-8 RUN apt update && \ - apt install -y git wget curl gnupg2 lsb-release && \ + apt install -y git wget curl gnupg2 lsb-release RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null && \ sed -i -e 's/ubuntu .* main/ubuntu noble main/g' /etc/apt/sources.list.d/ros2.list && \ apt update && \ - apt install -y openvino-2024.2.0 \ - ros-dev-tools \ + apt install -y ros-dev-tools \ ros-jazzy-cv-bridge \ ros-jazzy-generate-parameter-library \ ros-jazzy-parameter-traits \ @@ -67,5 +52,3 @@ RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o COPY ./ros_entrypoint.sh /ros_entrypoint.sh RUN echo "source /ros_entrypoint.sh" >> /root/.bashrc -# ENTRYPOINT ["/ros_entrypoint.sh"] -CMD ["bash"] From c747e1437a0c77a10498b17c1867706b1063d530 Mon Sep 17 00:00:00 2001 From: Ar-Ray-code Date: Mon, 23 Sep 2024 11:58:33 +0900 Subject: [PATCH 3/5] fix onnxruntime --- .../docker/onnxruntime/docker-compose.yaml | 1 + yolox_ros_cpp/docker/onnxruntime/dockerfile | 57 +++++++++---------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/yolox_ros_cpp/docker/onnxruntime/docker-compose.yaml b/yolox_ros_cpp/docker/onnxruntime/docker-compose.yaml index 26fc8c4..f12e08d 100644 --- a/yolox_ros_cpp/docker/onnxruntime/docker-compose.yaml +++ b/yolox_ros_cpp/docker/onnxruntime/docker-compose.yaml @@ -17,6 +17,7 @@ services: environment: - DISPLAY=$DISPLAY + - NVIDIA_DISABLE_REQUIRE=1 volumes: - $HOME/ros2_ws:/root/ros2_ws - /tmp/.X11-unix:/tmp/.X11-unix diff --git a/yolox_ros_cpp/docker/onnxruntime/dockerfile b/yolox_ros_cpp/docker/onnxruntime/dockerfile index f1ead4f..643e2fe 100644 --- a/yolox_ros_cpp/docker/onnxruntime/dockerfile +++ b/yolox_ros_cpp/docker/onnxruntime/dockerfile @@ -14,34 +14,33 @@ RUN apt update && apt install -y locales git cmake wget curl gnupg2 lsb-release rm -rf /var/lib/apt/lists/* ENV LANG=en_US.UTF-8 -WORKDIR /workdir -# RUN git clone --depth 1 --recursive https://github.com/microsoft/onnxruntime -b v1.12.1 && \ -# cd onnxruntime && \ -# ./build.sh --cudnn_home /usr/lib/x86_64-linux-gnu/ \ -# --cuda_home /usr/local/cuda \ -# --use_cuda \ -# --config RelWithDebInfo \ -# --build_shared_lib \ -# --skip_tests && \ -# cd build/Linux/RelWithDebInfo && \ -# make install && \ -# rm -r /workdir/onnxruntime +RUN git clone --depth 1 --recursive https://github.com/microsoft/onnxruntime -b v1.19.2 && \ + cd onnxruntime && \ + ./build.sh --cudnn_home /usr/lib/x86_64-linux-gnu/ \ + --cuda_home /usr/local/cuda \ + --use_cuda \ + --config RelWithDebInfo \ + --build_shared_lib \ + --allow_running_as_root \ + --skip_tests && \ + cd build/Linux/RelWithDebInfo && \ + make install -# RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \ -# echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null && \ -# sed -i -e 's/ubuntu .* main/ubuntu noble main/g' /etc/apt/sources.list.d/ros2.list && \ -# apt update && \ -# apt install -y ros-dev-tools \ -# ros-jazzy-cv-bridge \ -# ros-jazzy-generate-parameter-library \ -# ros-jazzy-parameter-traits \ -# ros-jazzy-ros-base \ -# ros-jazzy-rqt-image-view \ -# ros-jazzy-usb-cam \ -# ros-jazzy-vision-msgs && \ -# apt -y clean && \ -# rm -rf /var/lib/apt/lists/* +RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \ + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null && \ + sed -i -e 's/ubuntu .* main/ubuntu noble main/g' /etc/apt/sources.list.d/ros2.list && \ + apt update && \ + apt install -y ros-dev-tools \ + ros-jazzy-cv-bridge \ + ros-jazzy-generate-parameter-library \ + ros-jazzy-parameter-traits \ + ros-jazzy-ros-base \ + ros-jazzy-rqt-image-view \ + ros-jazzy-usb-cam \ + ros-jazzy-vision-msgs && \ + apt -y clean && \ + rm -rf /var/lib/apt/lists/* -# WORKDIR /workspace -# COPY ./ros_entrypoint.sh /ros_entrypoint.sh -# RUN echo "source /ros_entrypoint.sh" >> /root/.bashrc +WORKDIR /workspace +COPY ./ros_entrypoint.sh /ros_entrypoint.sh +RUN echo "source /ros_entrypoint.sh" >> /root/.bashrc From 1002abcc81b21b559b428a06fa247dea412c3973 Mon Sep 17 00:00:00 2001 From: Ar-Ray-code Date: Mon, 23 Sep 2024 12:00:54 +0900 Subject: [PATCH 4/5] fix readme --- yolox_ros_cpp/README.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/yolox_ros_cpp/README.md b/yolox_ros_cpp/README.md index 3e0b73f..11a0133 100644 --- a/yolox_ros_cpp/README.md +++ b/yolox_ros_cpp/README.md @@ -2,9 +2,9 @@ ## Requirements - ROS2 Iron - - ros-iron-generate-parameter-library - - ros-iron-vision-msgs - - ros-iron-usb-cam + - ros-jazzy-generate-parameter-library + - ros-jazzy-vision-msgs + - ros-jazzy-usb-cam - OpenCV 4.x - OpenVINO 2024.* - TensorRT 10.x * @@ -23,7 +23,7 @@ ## Clone YOLOX-ROS ```bash cd ~/ros2_ws/src -git clone --recursive https://github.com/Ar-Ray-code/YOLOX-ROS -b iron +git clone --recursive https://github.com/Ar-Ray-code/YOLOX-ROS -b jazzy ``` ## Model Convert or Download @@ -75,8 +75,7 @@ cd ~/ros2_ws ```bash # build with openvino -source /opt/ros/humble/setup.bash -source /opt/intel/openvino_2021/bin/setupvars.sh +source /opt/ros/jazzy/setup.bash colcon build --symlink-install --cmake-args -DYOLOX_USE_OPENVINO=ON ``` @@ -84,7 +83,7 @@ colcon build --symlink-install --cmake-args -DYOLOX_USE_OPENVINO=ON ```bash # build with tensorrt -source /opt/ros/iron/setup.bash +source /opt/ros/jazzy/setup.bash colcon build --symlink-install --cmake-args -DYOLOX_USE_TENSORRT=ON ``` @@ -95,7 +94,7 @@ colcon build --symlink-install --cmake-args -DYOLOX_USE_TENSORRT=ON https://www.tensorflow.org/lite/guide/build_cmake Below is an example build script. -Please change `${WORKSPACE}` as appropriate for your environment. +Please change `${WORKSPACE}` as appropriate for your envjazzyment. ```bash export WORKSPACE=${HOME}/ws_tflite mkdir -p ${WORKSPACE} From ab58ecd272eaafe856aee5288499395f84ce62fb Mon Sep 17 00:00:00 2001 From: Ar-Ray-code Date: Mon, 23 Sep 2024 12:02:23 +0900 Subject: [PATCH 5/5] v0.4.1 --- yolox_ros_cpp/yolox_cpp/package.xml | 2 +- yolox_ros_cpp/yolox_param/package.xml | 2 +- yolox_ros_cpp/yolox_ros_cpp/package.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/yolox_ros_cpp/yolox_cpp/package.xml b/yolox_ros_cpp/yolox_cpp/package.xml index 895a02a..f18153e 100644 --- a/yolox_ros_cpp/yolox_cpp/package.xml +++ b/yolox_ros_cpp/yolox_cpp/package.xml @@ -2,7 +2,7 @@ yolox_cpp - 0.4.0 + 0.4.1 The yolox_cpp package fateshelled Apache-2.0 License diff --git a/yolox_ros_cpp/yolox_param/package.xml b/yolox_ros_cpp/yolox_param/package.xml index cc3744d..a0bd173 100644 --- a/yolox_ros_cpp/yolox_param/package.xml +++ b/yolox_ros_cpp/yolox_param/package.xml @@ -2,7 +2,7 @@ yolox_param - 0.4.0 + 0.4.1 YOLOX-ROS Parameter Package Ar-Ray-code Apache-2.0 diff --git a/yolox_ros_cpp/yolox_ros_cpp/package.xml b/yolox_ros_cpp/yolox_ros_cpp/package.xml index 8b3bf8f..1f6e181 100644 --- a/yolox_ros_cpp/yolox_ros_cpp/package.xml +++ b/yolox_ros_cpp/yolox_ros_cpp/package.xml @@ -2,7 +2,7 @@ yolox_ros_cpp - 0.4.0 + 0.4.1 The yolox_ros_cpp package fateshelled Apache-2.0 License