Skip to content

Commit

Permalink
Merge pull request #9 from Ar-Ray-code/features/fix-dockerfile
Browse files Browse the repository at this point in the history
update Dockerfile
  • Loading branch information
Ar-Ray-code authored Sep 20, 2022
2 parents 67011e6 + dfe0354 commit 30766b2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM nvidia/cuda:11.7.0-devel-ubuntu22.04
FROM nvidia/cuda:11.7.0-cudnn8-devel-ubuntu22.04

ENV TZ=Asia/Tokyo
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
Expand All @@ -23,6 +23,7 @@ RUN apt update && \
apt install -y git && \
apt install -y xterm && \
apt install -y wget && \
apt install -y pciutils && \
apt -y clean && \
rm -rf /var/lib/apt/lists/*

Expand All @@ -33,11 +34,13 @@ RUN bash darknet_ros/rm_darknet_CMakeLists.sh
WORKDIR /home/ros2_ws/
COPY ./yolov4-tiny-docker.bash /home/ros2_ws/yolov4-tiny-docker.bash

RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1
# RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/local/cuda/lib64/stubs/libcuda.so.1
RUN LD_LIBRARY_PATH=/usr/local/cuda/lib64/stubs/:$LD_LIBRARY_PATH

# USE Usb Camera
CMD ["bash"]
# ================================
# docker build . -t darknet-ros-fp16
# docker run --rm -it --device /dev/video0:/dev/video0:mwr -e DISPLAY=$DISPLAY --runtime nvidia -v /tmp/.X11-unix:/tmp/.X11-unix darknet-ros-fp16 /bin/bash
# git clone https://github.com/Ar-Ray-code/darknet_ros_fp16.git
# docker build -t darknet_ros_fp16 ./darknet_ros_fp16/.
# # (connect webcamera)
# docker run --rm -it --device /dev/video0:/dev/video0:mwr -e DISPLAY=$DISPLAY --gpus all -v /tmp/.X11-unix:/tmp/.X11-unix darknet_ros_fp16 /bin/bash
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,6 @@ darknet_ros + ROS2 Humble + OpenCV4 + CUDA 11 + __CUDNN (FP16)__ :fire::fire::fi

<br>

<!-- ## Installation & Run
```bash
xhost +
# Pull docker image from dockerhub
docker pull ray255ar/darknet-ros-fp16
# Run
docker run --rm -it \
--device /dev/video0:/dev/video0:mwr \
-e DISPLAY=$DISPLAY --runtime nvidia \
-v /tmp/.X11-unix:/tmp/.X11-unix ray255ar/darknet-ros-fp16 \
/bin/bash yolov4-tiny-docker.bash
``` -->



## Installation 🐢

Expand All @@ -73,6 +58,21 @@ $ darknet_ros_yolov4/darknet_ros/rm_darknet_CMakeLists.sh
$ cd ~/ros2_ws
$ colcon build --symlink-install
```

### NVIDIA-Docker

- Driver version : 515.65.01
- NVIDIA Docker2
- NVIDIA Graphics card (Tested : RTX3060Ti)

```bash
git clone https://github.com/Ar-Ray-code/darknet_ros_fp16.git
docker build -t darknet_ros_fp16 ./darknet_ros_fp16/.

# connect webcamera
docker run --rm -it --device /dev/video0:/dev/video0:mwr -e DISPLAY=$DISPLAY --gpus all -v /tmp/.X11-unix:/tmp/.X11-unix darknet_ros_fp16 /bin/bash
```

### Edit CMakeLists.txt

#### Options
Expand Down

0 comments on commit 30766b2

Please sign in to comment.