GithubHelp home page GithubHelp logo

Comments (13)

Sharrrrk avatar Sharrrrk commented on July 24, 2024 4

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.

xmfcx avatar xmfcx commented on July 24, 2024 1

I've created this discussion on re-layering of the dockerfile/image:

https://github.com/orgs/autowarefoundation/discussions/3469

from autoware.

kaspermeck-arm avatar kaspermeck-arm commented on July 24, 2024 1

Merge this issue with autowarefoundation/autoware.universe#4111.

from autoware.

Sharrrrk avatar Sharrrrk commented on July 24, 2024

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.

Sharrrrk avatar Sharrrrk commented on July 24, 2024

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 another runtime 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 keep src folder (This could save up to ~3.3GB)

@kenji-miyake, what's your opinion about it ?

from autoware.

kenji-miyake avatar kenji-miyake commented on July 24, 2024

@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.

kaspermeck-arm avatar kaspermeck-arm commented on July 24, 2024

@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

I'd recommend building up a new container and not removing from an existing one.

from autoware.

Sharrrrk avatar Sharrrrk commented on July 24, 2024

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.

Sharrrrk avatar Sharrrrk commented on July 24, 2024

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.

kaspermeck-arm avatar kaspermeck-arm commented on July 24, 2024

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.

Sharrrrk avatar Sharrrrk commented on July 24, 2024

Hi @kasperornmeck thanks for the information, I will compare the docker size between manually install and cuda-runtime.

from autoware.

BonoloAWF avatar BonoloAWF commented on July 24, 2024

@Sharrrrk have you created a PR for these changes? If so, please link it to the Issue.

from autoware.

xmfcx avatar xmfcx commented on July 24, 2024

Closing this issue since it will be addressed by:

from autoware.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.