Help with nvcr.io/nvidia/l4t-jetpack:r35.4.1 and Docker

I am new to Docker and Jetson development. I have been having a rough time getting my Jetson set up with l4t-jetpack:r35.4.1. Is there a dockerfile and docker-requirements.txt available to get my environment on the jetson set up so I can start coding?

I keep running into package version issues for various parts of my project. grpcio and TTS are particularly complainy

Thanks!

Hello @joe.andolina,

Would it be possible for you to share a bit more detail on what specific requirements do you need in order for you to be unblocked ?

Are you having issues with package version on Docker or on the Jetson host?

You could reference for example this Dockerfile from Dusty that is based on the l4t version of your interest in accordance to your blogpost title.

Please let us know if you are able to share a bit more details on your project requirements so we can provide you with better assistance.

best regards,
Andrew

Thanks a million for the response!
I am working with a Boston Dynamics Spot and its CoreIO payload computer. I was able to get the image onto and working with the device. There was a lot of additional requirements and wheels needed in order to run my python app.

As I am new to Docker, isnt there a way to take the image and deploy it onto the Jetson without all the additional mumbo jumbo. Then if I need libraries and stuff, shouldn’t I be able to reference them from within the image?

Does the following look right in order to deploy a fresh environment from the docker image in question?

# Dockerfile for Jetson Speech App (l4t-base:35.4.1 with ARM-friendly setup)
FROM nvcr.io/nvidia/l4t-base:35.4.1
ENV DEBIAN_FRONTEND=noninteractive

# Install system dependencies
RUN apt-get update && apt-get install -y \
    python3-pip \
    python3-dev \
    python3-opencv \
    python3-numpy \
    libportaudio2 \
    portaudio19-dev \
    python3-pyaudio \
    build-essential \
    cmake \
    git \
    libsndfile1 \
    ffmpeg \
    libffi-dev \
    libblas-dev \
    curl \
    wget \
    && rm -rf /var/lib/apt/lists/*

# Upgrade pip
RUN python3 -m pip install --upgrade pip

# Add wheels download script
COPY download_wheels.py /app/download_wheels.py 
WORKDIR /app/

# Download ARM wheels before install
RUN python3 /app/download_wheels.py

# Install Python dependencies from safe requirements
COPY docker-requirements-gpu.txt /app/docker-requirements-gpu.txt
RUN python3 -m pip install --find-links=/app/wheels -r /app/docker-requirements-gpu.txt
RUN python3 -m pip install TTS==0.10.2

Hello @joe.andolina,

Thanks for getting back!
Your project sounds amazing just from what you mentioned about the HW you are using.

Before trying to answer your questions, please allow me to give you a quick rundown of Docker.

You can think of Docker as a tool that allows you to create “virtual machine instances”, where you can choose the base OS image you are going to be working with, as well as the other extra libraries you need to install on top for you specific use case.

That is the reason we have Dockerfiles. They allow you to define and specify every requirement you need on your custom Docker Image, which ensures consistency, ease of maintenance and replicability.

For instance, you could start with a base Ubuntu image. And, let’s say that for example, you need to install OpenCV for a specific computer vision feature on your application. Then you can make sure to install the OpenCV library on your Dockerfile. So at the end, your custom Docker image is based on Ubuntu, however, it has extra libraries you added specific to your system.

Once you built your image, you can deploy it into a Docker container. Which in essence is like flashing a machine with your image.

Now, let me try to answer your questions one by one.

  1. Is there a way to take the image and deploy it onto the Jetson without all the additional mumbo jumbo?

Yes. Once you have a custom Docker image that works for you, with all the bells and whistles you need, you can save it and deploy it into other Jetson boards without having to go through the process of building the image again.

In order to achieve this, you have a couple of options:

1.1. You can save the Docker image into a tar file:

docker save --output <your_image_name>.tar your_image_name

copy it over to your Jetson:

scp <your_image_name>.tar <jetson_username>@<jetson_ip>:~/

and docker load it there

ssh <jetson_username>@<jetson_ip>:~/
docker load -i <your_image_name>.tar

1.2. You can push it to docker hub

docker push <your_image_name>

And later docker pull it from your Jetson device

docker pull <your_image_name>
  1. shouldn’t I be able to reference them from within the image?

If you added all the required dependencies on the Dockerfile for your custom Image, you should definitely be able to use them from inside your container.

  1. Does the following look right in order to deploy a fresh environment from the docker image in question?

Yes, your Dockerfile will help you create a custom Docker image based on nvcr.io/nvidia/l4t-base:35.4.1, and it also adds some libraries at a host level, as well as installing some other libraries using pip.

Hope this answer helps clearing a bit the fog for you.
Docker at the beginning is a bit of a learning curve since it has a lot of different options and tools, but once you learn to use it, you will love it.

Please let us know if you still have questions, we love to help.

Also, don’t hesitate to reach out if you need some assistance with setting up your Docker, you can contact me directly at support@proventusnova.com.

best regards,
Andrew
Embedded Software Engineer at ProventusNova

Thank you for all the info. Sadly I wont be with the device till next week. I will test again then but this is a huge head start. Every time I have tried to use Docker I get overwhelmed and walk away. This time it is brutal due to the hardware architecture differences. Regardless, I will get through this one way or another. Ill keep you posted.

Hey @joe.andolina,

Sure, any time!

Keep us posed, and once you get access to the board, please hit us up if you need any further help with Docker. I would be down to scheduling some time with you to help you get started.

best regards,
Andrew
Embedded Software Engineer at ProventusNova