Rumarino-Team / Task_Module

States utilized for completing the tasks for the RoboSub competition
0 stars 3 forks source link

Optimize Docker Image for Camera Module to Fit Jetson-TX2 Memory Constraints #3

Open Cruiz102 opened 7 months ago

Cruiz102 commented 7 months ago

Overview

The Docker image used for running the camera module is significantly larger than the memory limits of our target hardware, the Jetson-TX2. It's essential to modify the production vision Docker to align with these hardware constraints.

Proposed Solutions for Docker Optimization

  1. Remove Unnecessary Dependencies Problem: The current Docker image includes extra Python and OpenCV dependencies that may be contributing to its large size. Solution: Identify and remove any non-essential Python and OpenCV dependencies from the Docker image. Removed unnecesary python and OpenCV dependencies.

In production we can remove the cuda installed by the ZED and and include the one in the host. Use a docker volume for sharing the ros noetic dependencies between others containers.

  1. Optimize CUDA Usage Problem: The Docker image includes a separate CUDA installation via ZED, which may be redundant. Solution: Remove the CUDA installation from the Docker image and leverage the CUDA version already installed on the host (Jetson-TX2). This should reduce the image size significantly.
  2. Utilize Docker Volumes for ROS Noetic Dependencies Suggestion: Implement Docker volumes to share ROS Noetic dependencies across different containers. This approach can help reduce the size of each individual Docker image by avoiding duplicate dependencies.

Create a bash script for automatizating all this commands and create the Documentation probably in a wiki on how this problem got resolved.

Cruiz102 commented 7 months ago

The code with the zed-ros-wrapper docker works correctly with the camera connected to the Jetson. For production we need to test if a .trt can runs well inside the jetson host. We need to create that tensorrt engine with a model and test if it can run correctly. I am trying to experiment with a yolov5.onnx. That needs further testing.

Cruiz102 commented 7 months ago

Found the binaries and the dependencies necessary for running tensoRT on the host. Going to create the .sh file for the volume.