Combining Jetson Containers

I would like to have one docker container running that includes all the functionalities from the Isaac ROS Docker Image, and has the Jetson-compatible libraries for

  1. Transformers
  2. PyTorch
  3. NanoLLM

I’m not a Docker expert, and have spent way too much time trying different things (e.g., copying the Dockerfile from Jetson-containers Pytorch ML system, manually installing NanoLLM requirements combining all the jetson, etc.
I have also attempted to use the jetson-containers build command

$ jetson-containers build --name=my_container pytorch transformers ros:humble-desktop

But, frankly, things are bit confusing, especially when it comes to integrating with NanoLLM (specifically the RIVA ASR + Llamaspeak functionality)

Any help will be appreciated.

Hi @augustmille, have you tried building on top of your desired container image (in this case Isaac ROS) with --base=my_image:latest ?

I would first try just installing PyTorch on top, like jetson-containers build --name=my_image:pytorch --base=my_image:latest pytorch

Hello @dusty_nv,
I haven’t had the best of luck with the jetson-containers command.
Nevertheless, I gave it another try. See my results below

Steps: jetson-containers build --name=isaac_ros_l4tpytorch:r0.0.1 --base=isaac_ros_dev-aarch64:latest l4t-pytorch

Expected: A new image combining the isaac_ros_dev-aarch64:latest and l4t-pytorch

Actual:

cat: ‘/usr/local/cuda/version*’: No such file or directory
Traceback (most recent call last):
File “”, line 198, in _run_module_as_main
File “”, line 88, in _run_code
File “/ssd/jetson-containers/jetson_containers/build.py”, line 103, in
build_container(args.name, args.packages, args.base, args.build_flags, args.simulate, args.skip_tests, args.test_only, args.push, args.no_github_api)
File “/ssd/jetson-containers/jetson_containers/container.py”, line 150, in build_container
test_container(container_name, pkg, simulate)
File “/ssd/jetson-containers/jetson_containers/container.py”, line 322, in test_container
status = subprocess.run(cmd.replace(NEWLINE, ’ ‘), executable=’/bin/bash’, shell=True, check=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/ssd/anaconda3/lib/python3.11/subprocess.py”, line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘docker run -t --rm --runtime=nvidia --network=host --volume /ssd/jetson-containers/packages/cuda/cuda:/test --volume /ssd/jetson-containers/data:/data --workdir /test isaac_ros_l4tpytorch:r0.0.1-r35.4.1-cuda /bin/bash -c ‘/bin/bash test.sh’ 2>&1 | tee /ssd/jetson-containers/logs/20240515_024852/test/isaac_ros_l4tpytorch_r0.0.1-r35.4.1-cuda_test.sh.txt; exit ${PIPESTATUS[0]}’ returned non-zero exit status 1.

It looks like it is failing during the test stage to find CUDA in the container for some reason…you can skip this for now with --skip-tests=all and perhaps that will at least build the container for you. If it still fails, please post the entire build log here. Later I will try building ROS Humble + PyTorch container images that you could base it off instead. It sounds like you want NanoLLM in there too?

Hi @dusty_nv , thanks for your response.
Spent more time with the NanoLLM documentation and see below for what I’m attempting to do, and the ideal options:

Goal: Build a container that combines nano_llm and Isaac_ros.
The assumption here is that this container will contain all the dependencies required for the nano_llm and isaac_ros features to be used without error

Attempts #1: Attempted to ‘extend’ the isaac_ros container with llama and pytorch by creating a Dockerfile.llamaspeak and Docker.pytorch, and modifying the .isaac_ros_common-config files according.

  • Result: Was able to get some container going, but all of the ROS packages and environments seemed to be overwritten in a super non-deterministic way.

Attempt #2: Used jetson-container to build things (as per the original post). See thread for results

Attempt #3: jetson-containers build --name=nano_llm-ros_core:r1.0 nano_llm ros:humble-ros-core --skip-tests=all

  • Results: See below

clarations “-D _GLIBCXX_ASSERTIONS” -O3
cuda/_cuda/ccuda.cpp:224:12: fatal error: longintrepr.h: No such file or directory
224 | include “longintrepr.h”
| ^~~~~~~~~~~~~~~
compilation terminated.
error: command ‘/usr/bin/aarch64-linux-gnu-gcc’ failed with exit code 1
The command ‘/bin/sh -c pip3 install --no-cache-dir cuda-python==${CUDA_PYTHON_VERSION} || /tmp/build_cuda_python.sh’ returned a non-zero code: 1
Traceback (most recent call last):
File “”, line 198, in _run_module_as_main
File “”, line 88, in _run_code
File “/ssd/jetson-containers/jetson_containers/build.py”, line 103, in
build_container(args.name, args.packages, args.base, args.build_flags, args.simulate, args.skip_tests, args.test_only, args.push, args.no_github_api)
File “/ssd/jetson-containers/jetson_containers/container.py”, line 143, in build_container
status = subprocess.run(cmd.replace(NEWLINE, ’ ‘), executable=’/bin/bash’, shell=True, check=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/ssd/anaconda3/lib/python3.11/subprocess.py”, line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘DOCKER_BUILDKIT=0 docker build --network=host --tag nano_llm-ros_core:r1.0-l4t-r35.4.1-cuda-python --file /ssd/jetson-containers/packages/cuda/cuda-python/Dockerfile --build-arg BASE_IMAGE=nano_llm-ros_core:r1.0-l4t-r35.4.1-pytorch_2.2 --build-arg CUDA_PYTHON_VERSION=“11.4.0” /ssd/jetson-containers/packages/cuda/cuda-python 2>&1 | tee /ssd/jetson-containers/logs/20240515_161718/build/nano_llm-ros_core_r1.0-l4t-r35.4.1-cuda-python.txt; exit ${PIPESTATUS[0]}’ returned non-zero exit status 1.

Let me know which logs would be most useful.
FYI: Do let me know how to quickly pull the logs (it’s been a long day and night (lol), and I suspect that it would take me a while to figure this out.

OK gotcha - I am trying this now, to get ros:humble-desktop built in the same container as nano_llm. I agree that it’s a good idea to figure out and have ROS nodes for the LLM/VLMs.

FYI, accomplished the goal (see below) by manually building a new Docker image with ROS2 included on top of the dustynv/nano_llm:r35.4.1 image.

Goal: Build a container that combines nano_llm and Isaac_ros .

High-level Steps:

  1. Pulled the dustynv/nano_llm:r35.4.1 image:
    docker pull dustynv/nano_llm:r35.4.1
  2. Created a new Dockerfile in /ssd/workspaces/isaac_ros-dev/src/isaac_ros_common/docker/Dockerfile.isaac_ros_nano_llm, and pasted the contents from jetson-containers/packages/ros/Dockerfile.ros2 into this Dockerfile, with a few minor path modification
  3. Created a script that built a new Docker image based on dustynv/nano_llm:r35.4.1 and the previously-mentioend Dockerfile
  4. Started a container based on the new image.

It would be very useful to be able to use the jetson-containers tool to do all of this. So, i’m looking forward to the jetson-containers fixes from your team.

Awesome, yes - glad to hear you got it working on your end @augustmille . I have been building this on JP6 (just in the reverse, nano_llm on top of ros:humble-desktop) and just working through some OpenCV issue currently. I will push the fixes when it’s all working 👍

OK, it built and passed the tests! Here is the image: dustynv/ros:humble-llm-r36.3.0

This is with ros:humble-desktop and NanoLLM - I will commit the fixes and also try rebuilding this for JetPack 5 too. Also curious to hear more about your plans @augustmille , I would like to create more ROS nodes for LLM/VLM/ViT if you wanted to work together?

ps I built the above image with this command:

jetson-containers build --name=dustynv/ros:humble-llm ros:humble-desktop nano_llm

OK, the JP5 version is up now too: dustynv/ros:humble-llm-r35.4.1

Thank you for all your help.
Will try our soon.
Would love to share my plans with you and the team.
Not yet comfortable sharing in public yet. But, let me know if there is a more private channel to do so. I’d appreciate all the help that I can get.

1 Like