Comments (13)
Currently I have started to change Dockerfile and ansible scripts, the main ideas:
- Use cuda runtime images as base
- Only runtime packages of TensorRT are installed
- Only minimal set of ROS packages are installed
- Multistage image build, copy install folder
from autoware.
I've created this discussion on re-layering of the dockerfile/image:
https://github.com/orgs/autowarefoundation/discussions/3469
from autoware.
Merge this issue with autowarefoundation/autoware.universe#4111.
from autoware.
With docker image built from nvidia/cuda:11.4.0-runtime-ubuntu20.04, and runtime dependencies installed for autoware, the disk usage of /usr/local/cuda-11.4
folder could be reduced by 2.2GB.
Original: 4.0G /usr/local/cuda-11.4
New: 1.8G /usr/local/cuda-11.4
DNN related runtime dependencies:
libcudnn8
libnvinfer8
libnvinfer-plugin8
libnvonnxparsers8
libnvparsers8
from autoware.
Currently I'm thinking of two approaches of this work:
-
Reduce size of
prebuilt
image
Considering the prebuilt images is for users to try out Autoware quickly, dev environment could be remove from it. -
Keep current
prebuilt
image and build anotherruntime
image
This allows users to rebuild partial of Autoware, not the whole project using prebuilt image, then runtime image may be provided just for execution.
The main concept of size reducing:
- Only use runtime libraries for CUDA/TensorRT (This could save ~2.2GB)
- Only copy the
install
folder or maybe also keepsrc
folder (This could save up to ~3.3GB)
@kenji-miyake, what's your opinion about it ?
from autoware.
@Sharrrrk Thank you for investigating this issue!
I totally agree with you, and either option seems okay. The first option would be better as a first step because it's simpler.
from autoware.
@Sharrrrk thanks for taking this on!
For inspiration, you could take a look at the images layers which ROS and NVIDIA have used to create their Docker images. See
- https://github.com/osrf/docker_images/blob/3f4fbca923d80f834f3a89b5960bad5582652519/ros/galactic/ubuntu/focal/ros-core/Dockerfile
- https://hub.docker.com/layers/nvidia/cuda/11.4.2-runtime-ubuntu18.04/images/sha256-9fd4770341bd8f2cd754b70d552dfd0cc5e6e3ed1406449f00b1c5bb944133b0?context=explore
I'd recommend building up a new container and not removing from an existing one.
from autoware.
Hi @kasperornmeck, I looked into the docker file of Nvidia and ROS, Nvidia used a script from outside to install all the packages, and for ROS, it's just like what have been implented in current ansible script. So I would say that use nvidia runtime docker image as base would be a good and neat approach. I will modify the ansible srcipts (add a variant that only installs runtime dependencies) and the Docker file (use mutlti stage build) of course, so that the prebuilt
image could reduce it's size in later build.
from autoware.
Hi @kasperornmeck, I looked into the docker file of Nvidia and ROS, Nvidia used a script from outside to install all the packages, and for ROS, it's just like what have been implented in current ansible script. So I would say that use nvidia runtime docker image as base would be a good and neat approach. I will modify the ansible srcipts (add a variant that only installs runtime dependencies) and the Docker file (use mutlti stage build) of course, so that the prebuilt
image could reduce it's size in later build.
from autoware.
Hi @Sharrrrk
I was installing the NVIDIA driver using the runfile (local) method. You might already be aware of this but you can install only the driver, or any of the other software by selecting/deselecting, e.g., all the runtime dependencies.
lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
x CUDA Installer x
x - [X] Driver x
x [X] 515.65.01 x
x - [ ] CUDA Toolkit 11.7 x
x - [ ] CUDA Libraries 11.7 x
x + [ ] CUDA Development 11.7 x
x - [ ] CUDA Runtime 11.7 x
x [ ] cuda-cudart x
x [ ] cuda-nvrtc x
x [ ] libcublas11 x
x [ ] libcufft x
x [ ] libcurand x
x [ ] libcusolver x
x [ ] libcusparse x
x [ ] libnpp x
x [ ] libnvjpeg x
x - [ ] CUDA Tools 11.7 x
x + [ ] CUDA Command Line Tools 11.7 x
x + [ ] CUDA Visual Tools 11.7 x
x - [ ] CUDA Compiler 11.7 x
x [ ] cuda-cuobjdump x
x x
x Up/Down: Move | Left/Right: Expand | 'Enter': Select | 'A': Advanced options x
from autoware.
Hi @kasperornmeck thanks for the information, I will compare the docker size between manually install and cuda-runtime.
from autoware.
@Sharrrrk have you created a PR for these changes? If so, please link it to the Issue.
from autoware.
Closing this issue since it will be addressed by:
from autoware.
Related Issues (20)
- Test highway localization feasibility of Current Autoware Pipe-Line HOT 34
- Implementing lane detection method for lane level localization purposes HOT 2
- Collect Urban Dataset for Autoware and Autoware Labs HOT 25
- Report results of the weekly scenario tests publicly as dashboard
- Autoware weekly scenario tests are failing. HOT 2
- Docker Image OpenADK with CUDA support has an issue with CUDA installation HOT 2
- Prune and document the docker packages HOT 3
- Migration from autoware_auto_msgs to autoware_msgs
- Enhancing scenario_simulator_v2 to print or visualize parameters/modifiers used for test iterations
- When the display scale is set to 200% the Rviz window always crashes HOT 1
- `docker-build-and-push` should not push an image for every commit to main
- `docker-build-and-push-main` is failing HOT 4
- compare_map_segmentation
- Missing environment variables in devel Docker container
- Separation of `autoware_common` to `autoware_cmake`, `autoware_utils` and `autoware_lanelet2_extension` HOT 2
- `docker/build.sh` fails with `ssh_auth_sock: no such file or directory` HOT 1
- Only `cuda` jobs generate empty cache on `build-main` and `build-main-self-hosted` workflows
- Autoware packages release from ROS buildfarm
- Add lightweight docker build option HOT 2
- CMake error during installation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autoware.