Docker can ensure that all developers in a project have a common, consistent development environment. It is recommended for beginners, casual users, people who are unfamiliar with Ubuntu.
- Install Nvidia driver
- Install Docker Engine
- Install Docker compose
- Install NVIDIA Container Toolkit
$ git clone https://github.com/Natsu-Akatsuki/RangeNet-TensorRT ~/rangenet/src/rangenet
$ wget -c https://github.com/Natsu-Akatsuki/RangeNet-TensorRT/releases/download/v0.0.0-alpha/model.onnx -O ~/rangenet/src/rangenet/model/model.onnx
See more in https://hub.docker.com/repository/docker/877381/rangenet/general.
Version | Status |
---|---|
877381/rangenet:ubuntu20.04_cuda11.1.1_tensorrt10.6_noetic | |
877381/rangenet:ubuntu20.04_cuda12.4.1_tensorrt10.6_noetic | |
877381/rangenet:ubuntu22.04_cuda12.4.1_tensorrt10.6_humble |
The image size is about 20-26 GB (after uncompressed), so make sure you have enough space
# e.g. docker pull 877381/rangenet:ubuntu20.04_cuda12.4.1_tensorrt10.6_noetic
$ docker pull <image_name>
# Rename the image (remove the Docker user prefix)
$ TAG=ubuntu20.04_cuda12.4.1_tensorrt10.6_noetic && docker tag 877381/rangenet:${TAG} rangenet:${TAG}
- Open
generate_dockerfile.py
and modify the content to suit your needs.
# {22.04, 20.04}
UBUNTU_VERSION = "20.04"
# {noetic, humble}
ROS_VERSION = "noetic"
# {10.6}
TENSORRT_VERSION = "10.6"
- If you want to use other version CUDA and cuDNN, you can modify the basic image in
generate_dockerfile.py
. See more images in https://hub.docker.com/r/nvidia/cuda/tags.
# {22.04, 20.04}
ubuntu_version = "20.04"
# {noetic, humble}
ros_version = "noetic"
tensorrt_version = "10.6"
# {11.1.1, 12.4.1 (require: nvidia-driver 550)}
cuda_version = "12.4.1"
- Run
generate_dockerfile.py
to generate the Dockerfile
$ python3 generate_dockerfile.py
- cd to the directory containing the Dockerfile and run the following command to build the image
# Here is an example of building the image
$ cd ubuntu20.04_cuda11.1.1_tensorrt10.6_noetic
$ bash build_image.sh
After the image is built, you can run the container with the following command
# Please replace the image name with the name of the image you built or pulled
$ cd ~/rangenet/src/rangenet/docker/ubuntu20.04_cuda11.1.1_tensorrt10.6_noetic
# Please change the mount path in docker-compose.yml
$ docker compose up
# Open an another terminal
$ docker exec -it rangenet /bin/bash
# In container
$ cd ~/rangenet/src/rangenet/
$ mkdir build
$ unset ROS_VERSION && cd build && cmake .. && make -j4
$ ./demo