Deepstream 6.0 + Container Builder build for Jetson nano 4GB fails again

Ahoi everyone,

I faced some issues with the container_builder before and fixed them to finally build my first container and pushed it to a Azure Container Registry following guide Exercise - Build and publish cross-platform DeepStream container images - Training | Microsoft Learn - I used a different app - deepstream-test1 but with modified graph components outlined here Deepstream 6.0 + Graph Composer 1.0.0 execution issue and the first issue with the container build here
Deepstream 6.0 + Container Builder build for Jetson nano 4GB fails - there you can see that Step 4/10 : RUN true was executed

Now I had to adapt my graph and wanted to build a new version of the container but face new issues with the build at Stage 4/10 which never happened before

Step 4/10 : RUN true
 ---> [Warning] The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64/v3) and no specific platform was requested
 ---> Running in 7f4cf5ea59cd
exec /bin/sh: exec format error
The command '/bin/sh -c true' returned a non-zero code: 1

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU)
GPU
NAME=“Ubuntu”
VERSION=“18.04.6 LTS (Bionic Beaver)”
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME=“Ubuntu 18.04.6 LTS”
VERSION_ID=“18.04”
HOME_URL=“https://www.ubuntu.com/”
SUPPORT_URL=“https://help.ubuntu.com/”
BUG_REPORT_URL=“Bugs : Ubuntu
PRIVACY_POLICY_URL=“Data privacy | Ubuntu
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

• DeepStream Version
Deepstream 6.0 installed per Quickstart Guide — DeepStream 6.0 Release documentation

• JetPack Version (valid for Jetson only)
NA

• TensorRT Version
TensorRT 8.0.1

• NVIDIA GPU Driver Version (valid for GPU only)
image

• Issue Type( questions, new requirements, bugs)
When running the following command to start the Container Builder it fails
CMD executed

sudo container_builder -c ds_test1_container_builder_jetson.yaml -d /opt/nvidia/graph-composer/config/target_aarch64.yaml

Output:

ubuntu@nvidia-ds6-us1804:/opt/nvidia/deepstream/deepstream-6.0/reference_graphs/TEST2$ sudo container_builder -c ds_test1_container_builder_jetson.yaml -d /opt/nvidia/graph-composer/config/target_aarch64.yaml
2024-07-16 16:33:04,052 - ContainerBuilder.container_builder.docker_manager - INFO - Auto selected base image: nvcr.io/nvidia/deepstream-l4t:6.0-samples
2024-07-16 16:33:04,052 - ContainerBuilder.container_builder.docker_manager - INFO - start building stage image test-jhiufopufiopwea
2024-07-16 16:33:04,069 - ContainerBuilder.container_builder.docker_templ.docker_templ_maker - INFO - writing docker content to /home/ubuntu/.cache/container_builder/.dockerfile_2510
2024-07-16 16:33:04,069 - ContainerBuilder.container_builder.docker_manager - INFO - docker file /home/ubuntu/.cache/container_builder/.dockerfile_2510 generated
2024-07-16 16:33:04,069 - ContainerBuilder.container_builder.docker_manager - INFO - start preparing work folder: /home/ubuntu/.cache/container_builder/.workfolder_2510
2024-07-16 16:33:04,070 - ContainerBuilder.container_builder.docker_workfolder - INFO - copying local files to work folder
2024-07-16 16:33:04,525 - ContainerBuilder.container_builder.docker_workfolder - INFO - Work folder: /home/ubuntu/.cache/container_builder/.workfolder_2510/final_image is ready
2024-07-16 16:33:05,961 - Registry - INFO - Installing graph ...
2024-07-16 16:33:05,983 - Registry - INFO - Extension update found for extension: NvDsBaseExt
2024-07-16 16:33:05,983 - Registry - INFO - Old version: 0.0.3 New version: 0.0.4
2024-07-16 16:33:05,986 - Registry - INFO - 
Requested target configuration: 
  arch: aarch64 os: linux distribution: ubuntu_18.04 cuda: 10.2 cudnn: 8.0.3 tensorrt: 8.0.1.6 deepstream: 6.0 vpi: 1.1.12 

Selected extension variants: 
MultimediaExtension 
  Version: 1.0.0 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 
StandardExtension 
  Version: 1.0.1 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 cuda: 10.2 
NvDsInterfaceExt 
  Version: 0.0.3 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 deepstream: 6.0 
NvDsBaseExt 
  Version: 0.0.4 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 deepstream: 6.0 
NvDsSourceExt 
  Version: 0.0.6 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 deepstream: 6.0 
NvDsMuxDemuxExt 
  Version: 0.0.4 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 deepstream: 6.0 
NvDsInferenceExt 
  Version: 0.0.4 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 deepstream: 6.0 
NvDsSampleModelsExt 
  Version: 0.0.4 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 deepstream: 6.0 
NvDsOutputSinkExt 
  Version: 0.0.3 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 deepstream: 6.0 
NvDsVisualizationExt 
  Version: 0.0.3 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 deepstream: 6.0 
NvDsInferenceUtilsExt 
  Version: 0.0.5 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 deepstream: 6.0 

2024-07-16 16:33:52,257 - ContainerBuilder.container_builder.docker_manager - INFO - work folder: /home/ubuntu/.cache/container_builder/.workfolder_2510 is ready
2024-07-16 16:33:52,257 - ContainerBuilder.container_builder.docker_manager - INFO - start build docker file /home/ubuntu/.cache/container_builder/.dockerfile_2510
Step 1/10 : FROM  nvcr.io/nvidia/deepstream-l4t:6.0-samples AS final_image
 ---> 1e08ebd4f227
Step 2/10 : ARG DEBIAN_FRONTEND=noninteractive
 ---> [Warning] The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64/v3) and no specific platform was requested
 ---> Running in bcfb2369df91
Removing intermediate container bcfb2369df91
 ---> 48b56abbb2c0
Step 3/10 : COPY ["final_image", "/"]
 ---> 0118c4e5b1f7
Step 4/10 : RUN true
 ---> [Warning] The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64/v3) and no specific platform was requested
 ---> Running in 7f4cf5ea59cd
exec /bin/sh: exec format error
The command '/bin/sh -c true' returned a non-zero code: 1
2024-07-16 16:34:07,314 - ContainerBuilder.container_builder.docker_builder - ERROR - docker build failed on file: /home/ubuntu/.cache/container_builder/.dockerfile_2510, buildError:The command '/bin/sh -c true' returned a non-zero code: 1
Traceback (most recent call last):
  File "container_builder/docker_builder.py", line 113, in build_from
  File "container_builder/docker_builder.py", line 72, in _internal_build
  File "container_builder/docker_builder.py", line 53, in _print_chunk
docker.errors.BuildError: The command '/bin/sh -c true' returned a non-zero code: 1
2024-07-16 16:34:07,314 - ContainerBuilder.container_builder.docker_manager - ERROR - build image test-jhiufopufiopwea on dockerfile /home/ubuntu/.cache/container_builder/.dockerfile_2510 failed
2024-07-16 16:34:07,314 - ContainerBuilder.container_builder.docker_manager - ERROR - build stage image test-jhiufopufiopwea failed
2024-07-16 16:34:07,335 - ContainerBuilder.container_builder.container_builder - ERROR - build config file: ds_test1_container_builder_jetson.yaml failed
ubuntu@nvidia-ds6-us1804:/opt/nvidia/deepstream/deepstream-6.0/reference_graphs/TEST2$

• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)

Executing

sudo container_builder -c ds_test1_container_builder_jetson.yaml -d /opt/nvidia/graph-composer/config/target_aarch64.yaml

• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

This is the default ds_test1_container_builder_jetson.yaml file i used to try to build the container

---
# final stage
unique_stage: final_image
base_image: auto
stage_model: clean_stage

local_copy_files:
- src: "/opt/nvidia/graph-composer/graph_composer-1.0.0_arm64.deb"
dst: "/tmp/"
- src: "parameters.yaml"
dst: "/workspace/deepstream-test1/" # ends with '/' is folder

custom_runs:
- "apt install -y /tmp/graph_composer-1.0.0_arm64.deb && rm -rf /tmp/graph-composer-1.0.0_arm64.deb"
- 
work_folder: /workspace/deepstream-test1/

env_list:
PATH: "/opt/nvidia/graph-composer/:$PATH"
LD_LIBRARY_PATH: "/opt/nvidia/graph-composer/:$LD_LIBRARY_PATH"
DISPLAY: ":0"

# Setup entrypoint
entrypoint:
- "gxe"
- "--manifest"
- "deepstream-test1_manifest.yaml"
- "--app"
- "deepstream-test1.yaml,parameters.yaml"
---
# Container Builder Config
container_builder: main # required
graph:
graph_files: [ deepstream-test1.yaml ]
graph_dst: /workspace/deepstream-test1/
manifest_dst: /workspace/deepstream-test1/deepstream-test1_manifest.yaml
ext_install_root: /workspace/deepstream-test1/
docker_build:
image_name: test-jhiufopufiopwea

nvcr.io login was successfull

ubuntu@nvidia-ds6-us1804:~$ docker login nvcr.io
Authenticating with existing credentials...
WARNING! Your password will be stored unencrypted in /home/ubuntu/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded
ubuntu@nvidia-ds6-us1804:~

as well as registry repo sync -n ngc-public

ubuntu@nvidia-ds6-us1804:/opt/nvidia/deepstream/deepstream-6.0/reference_graphs/TEST2$ sudo registry repo sync -n ngc-public
2024-07-16 16:38:08,829 - Registry - INFO - Syncing repo ngc-public ...
2024-07-16 16:38:09,686 - Registry - INFO - 28 extensions found
2024-07-16 16:38:10,291 - Registry - INFO - Syncing extension NvDsBaseExt version 0.0.4
2024-07-16 16:38:17,069 - Registry - INFO - Syncing extension NvDsBaseExt version 0.0.3
2024-07-16 16:38:24,972 - Registry - INFO - Syncing extension NvDsAnalyticsExt version 0.0.3
2024-07-16 16:38:31,583 - Registry - INFO - Syncing extension NvDsCloudMsgExt version 0.0.3
2024-07-16 16:38:38,628 - Registry - INFO - Syncing extension NvDsConverterExt version 0.0.3
2024-07-16 16:38:45,578 - Registry - INFO - Syncing extension NvDsDewarperExt version 0.0.4
2024-07-16 16:38:52,213 - Registry - INFO - Syncing extension NvDsInferenceExt version 0.0.4
2024-07-16 16:38:58,450 - Registry - INFO - Syncing extension NvDsInferenceExt version 0.0.3
2024-07-16 16:39:05,927 - Registry - INFO - Syncing extension NvDsInferenceUtilsExt version 0.0.5
2024-07-16 16:39:12,006 - Registry - INFO - Syncing extension NvDsInferenceUtilsExt version 0.0.4
2024-07-16 16:39:18,634 - Registry - INFO - Syncing extension NvDsInterfaceExt version 0.0.3
2024-07-16 16:39:25,317 - Registry - INFO - Syncing extension NvDsMuxDemuxExt version 0.0.4
2024-07-16 16:39:32,022 - Registry - INFO - Syncing extension NvDsOpticalFlowExt version 0.0.3
2024-07-16 16:39:39,255 - Registry - INFO - Syncing extension NvDsOutputSinkExt version 0.0.3
2024-07-16 16:39:47,653 - Registry - INFO - Syncing extension NvDsSampleExt version 0.0.3
2024-07-16 16:39:54,217 - Registry - INFO - Syncing extension NvDsSampleModelsExt version 0.0.4
2024-07-16 16:40:01,093 - Registry - INFO - Syncing extension NvDsSourceExt version 0.0.6
2024-07-16 16:40:08,355 - Registry - INFO - Syncing extension NvDsTemplateExt version 0.0.3
2024-07-16 16:40:15,350 - Registry - INFO - Syncing extension NvDsTrackerExt version 0.0.3
2024-07-16 16:40:21,943 - Registry - INFO - Syncing extension NvDsTranscodeExt version 0.0.3
2024-07-16 16:40:28,988 - Registry - INFO - Syncing extension NvDsTritonExt version 0.0.3
2024-07-16 16:40:36,734 - Registry - INFO - Syncing extension NvDsVisualizationExt version 0.0.3
2024-07-16 16:40:43,514 - Registry - INFO - Syncing extension StandardExtension version 1.0.1
2024-07-16 16:40:52,134 - Registry - INFO - Syncing extension NvDsBodyPose2D version 0.0.4
2024-07-16 16:40:58,030 - Registry - INFO - Syncing extension NvDsBodyPose2D version 0.0.3
2024-07-16 16:41:04,598 - Registry - INFO - Syncing extension NvDsFacialLandmarks version 0.0.7
2024-07-16 16:41:10,696 - Registry - INFO - Syncing extension NvDsFacialLandmarks version 0.0.4
2024-07-16 16:41:17,299 - Registry - INFO - Syncing extension NvDsEmotionExt version 0.0.5
2024-07-16 16:41:24,031 - Registry - INFO - Syncing extension NvDsEmotionExt version 0.0.4
2024-07-16 16:41:31,659 - Registry - INFO - Syncing extension NvDsEmotionExt version 0.0.3
2024-07-16 16:41:38,454 - Registry - INFO - Syncing extension NvDsGazeExt version 0.0.5
2024-07-16 16:41:44,560 - Registry - INFO - Syncing extension NvDsGazeExt version 0.0.4
2024-07-16 16:41:50,492 - Registry - INFO - Syncing extension NvDsGazeExt version 0.0.3
2024-07-16 16:41:57,154 - Registry - INFO - Syncing extension NvDsHeartRateExt version 0.0.3
2024-07-16 16:42:03,668 - Registry - INFO - Syncing extension MultimediaExtension version 1.0.0
2024-07-16 16:42:11,078 - Registry - INFO - Syncing extension NvDsGesture version 0.0.3
2024-07-16 16:42:17,184 - Registry - INFO - Syncing extension NvDsGesture version 0.0.2
2024-07-16 16:42:23,891 - Registry - INFO - Syncing extension NvDsActionRecognitionExt version 0.0.1
Repository synced
ubuntu@nvidia-ds6-us1804:/opt/nvidia/deepstream/deepstream-6.0/reference_graphs/TEST2$
$ docker --version
Docker version 24.0.2, build cb74dfc

As always really appreciating your help and Input as I go my way learning to get this AI project running.

BR Maximilian

I tried your yml file, container_buider doesn’t work properly with it.
It looks like some other files are missing.

From the error log above, it seems that there is an error in the docker build stage. Can you share this dockerfile?

Are you using DS-6.0 to build a docker image of Jetson on x86?

Ahoi,

yes I run DS-6.0 on a x86 image to build the container for a Jetson Nano 4GB
I use the deepstream-test1 default folder with every file untouched only updated the file with a valid image name

ubuntu@nvidia-ds6-us1804:/opt/nvidia/deepstream/deepstream-6.0/reference_graphs/deepstream-test1$ ls -la
total 36
drwxr-xr-x  2 root root 4096 Jul 13 23:02 .
drwxr-xr-x 18 root root 4096 Jul 15 23:44 ..
-rw-r--r--  1 root root 5790 Oct 18  2021 deepstream-test1.yaml
-rw-r--r--  1 root root 1494 Oct 18  2021 ds_test1_container_builder_dgpu.yaml
-rw-r--r--  1 root root 1675 Oct 18  2021 ds_test1_container_builder_jetson.yaml
-rw-r--r--  1 root root  912 Oct 18  2021 parameters.yaml
-rw-r--r--  1 root root 4718 Oct 18  2021 README
ubuntu@nvidia-ds6-us1804:/opt/nvidia/deepstream/deepstream-6.0/reference_graphs/deepstream-test1$

This is the default yml file

---
# final stage
unique_stage: final_image
base_image: auto
stage_model: clean_stage

local_copy_files:
- src: "/opt/nvidia/graph-composer/graph_composer-1.0.0_arm64.deb"
  dst: "/tmp/"
- src: "parameters.yaml"
  dst: "/workspace/deepstream-test1/" # ends with '/' is folder

custom_runs:
 - "apt install -y /tmp/graph_composer-1.0.0_arm64.deb && rm -rf /tmp/graph-composer-1.0.0_arm64.deb"

work_folder: /workspace/deepstream-test1/

env_list:
  PATH: "/opt/nvidia/graph-composer/:$PATH"
  LD_LIBRARY_PATH: "/opt/nvidia/graph-composer/:$LD_LIBRARY_PATH"
  DISPLAY: ":0"

# Setup entrypoint
entrypoint:
- "gxe"
- "--manifest"
- "deepstream-test1_manifest.yaml"
- "--app"
- "deepstream-test1.yaml,parameters.yaml"
---
# Container Builder Config
container_builder: main # required
graph:
  graph_files: [ deepstream-test1.yaml ]
  graph_dst: /workspace/deepstream-test1/
  manifest_dst: /workspace/deepstream-test1/deepstream-test1_manifest.yaml
  ext_install_root: /workspace/deepstream-test1/
docker_build:
    image_name: container_build_17072024:deepstream-test1-jetson

This is the DEBUG output of my container build.

ubuntu@nvidia-ds6-us1804:/opt/nvidia/deepstream/deepstream-6.0/reference_graphs/deepstream-test1$ sudo container_builder -c ds_test1_container_builder_jetson.yaml -d /opt/nvidia/graph-composer/config/target_aarch64.yaml --log-level DEBUG
2024-07-17 13:51:07,525 - ContainerBuilder.container_builder.container_builder - DEBUG - container_builder is running in PyInstaller
2024-07-17 13:51:07,531 - ContainerBuilder.container_builder.builder_config - DEBUG - Reading Docker Manager config file
2024-07-17 13:51:07,537 - ContainerBuilder.container_builder.docker_manager - INFO - Auto selected base image: nvcr.io/nvidia/deepstream-l4t:6.0-samples
2024-07-17 13:51:07,537 - ContainerBuilder.container_builder.docker_manager - INFO - start building stage image container_build_17072024:deepstream-test1-jetson
2024-07-17 13:51:07,537 - ContainerBuilder.container_builder.docker_templ.templ_render - DEBUG - searching templ_folder:clean_stage
2024-07-17 13:51:07,537 - ContainerBuilder.container_builder.docker_templ.templ_render - DEBUG - loading templ_file:clean_stage
2024-07-17 13:51:07,554 - ContainerBuilder.container_builder.docker_templ.templ_render - DEBUG - rendering docker base template context
2024-07-17 13:51:07,554 - ContainerBuilder.container_builder.docker_templ.templ_render - DEBUG - rendered dockerfile result:


FROM  nvcr.io/nvidia/deepstream-l4t:6.0-samples AS final_image
ARG DEBIAN_FRONTEND=noninteractive









COPY ["final_image", "/"]
RUN true






ENV PATH="/opt/nvidia/graph-composer/:$PATH"
ENV LD_LIBRARY_PATH="/opt/nvidia/graph-composer/:$LD_LIBRARY_PATH"
ENV DISPLAY=":0"


WORKDIR /workspace/deepstream-test1/


RUN apt install -y /tmp/graph_composer-1.0.0_arm64.deb && rm -rf /tmp/graph-composer-1.0.0_arm64.deb




ENTRYPOINT [ \
 "gxe",  "--manifest",  "deepstream-test1_manifest.yaml",  "--app",  "deepstream-test1.yaml,parameters.yaml"  ]

2024-07-17 13:51:07,554 - ContainerBuilder.container_builder.docker_templ.docker_templ_maker - INFO - writing docker content to /home/ubuntu/.cache/container_builder/.dockerfile_4012
2024-07-17 13:51:07,554 - ContainerBuilder.container_builder.docker_manager - INFO - docker file /home/ubuntu/.cache/container_builder/.dockerfile_4012 generated
2024-07-17 13:51:07,554 - ContainerBuilder.container_builder.docker_manager - INFO - start preparing work folder: /home/ubuntu/.cache/container_builder/.workfolder_4012
2024-07-17 13:51:07,554 - ContainerBuilder.container_builder.docker_workfolder - DEBUG - Start preparing folder: /home/ubuntu/.cache/container_builder/.workfolder_4012/final_image
2024-07-17 13:51:07,554 - ContainerBuilder.container_builder.docker_workfolder - INFO - copying local files to work folder
2024-07-17 13:51:07,554 - ContainerBuilder.container_builder.docker_workfolder - DEBUG - copying src: /opt/nvidia/graph-composer/graph_composer-1.0.0_arm64.deb to dst: /home/ubuntu/.cache/container_builder/.workfolder_4012/final_image/tmp
2024-07-17 13:51:07,565 - ContainerBuilder.container_builder.docker_workfolder - DEBUG - copying src: /opt/nvidia/deepstream/deepstream-6.0/reference_graphs/deepstream-test1/parameters.yaml to dst: /home/ubuntu/.cache/container_builder/.workfolder_4012/final_image/workspace/deepstream-test1
2024-07-17 13:51:07,565 - ContainerBuilder.container_builder.docker_workfolder - INFO - Work folder: /home/ubuntu/.cache/container_builder/.workfolder_4012/final_image is ready
2024-07-17 13:51:08,792 - ContainerBuilder.container_builder.graph_handler - DEBUG - getting registry version
2024-07-17 13:51:08,792 - ContainerBuilder.container_builder.graph_handler - DEBUG - get existing repo list: default,ngc-public
2024-07-17 13:51:08,792 - ContainerBuilder.container_builder.graph_handler - DEBUG - starting install graph /opt/nvidia/deepstream/deepstream-6.0/reference_graphs/deepstream-test1/deepstream-test1.yaml
2024-07-17 13:51:08,792 - ContainerBuilder.container_builder.graph_handler - DEBUG - copying graph_file: /opt/nvidia/deepstream/deepstream-6.0/reference_graphs/deepstream-test1/deepstream-test1.yaml to dst: /home/ubuntu/.cache/container_builder/.workfolder_4012/final_image/workspace/deepstream-test1/deepstream-test1.yaml
2024-07-17 13:51:08,792 - ContainerBuilder.container_builder.graph_handler - DEBUG - downloading extension archives into /home/ubuntu/.cache/container_builder/.workfolder_4012/final_image
2024-07-17 13:51:08,792 - ContainerBuilder.container_builder.graph_handler - DEBUG - generate graph manifest /workspace/deepstream-test1/deepstream-test1_manifest.yaml
2024-07-17 13:51:08,792 - ContainerBuilder.container_builder.graph_handler - DEBUG - installing registry on graph ['/opt/nvidia/deepstream/deepstream-6.0/reference_graphs/deepstream-test1/deepstream-test1.yaml']
2024-07-17 13:51:08,795 - Registry - INFO - Installing graph ...
2024-07-17 13:51:08,815 - Registry - INFO - 
Requested target configuration: 
  arch: aarch64 os: linux distribution: ubuntu_18.04 cuda: 10.2 cudnn: 8.0.3 tensorrt: 8.0.1.6 deepstream: 6.0 vpi: 1.1.12 

Selected extension variants: 
MultimediaExtension 
  Version: 1.0.0 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 
StandardExtension 
  Version: 1.0.1 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 cuda: 10.2 
NvDsInterfaceExt 
  Version: 0.0.3 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 deepstream: 6.0 
NvDsBaseExt 
  Version: 0.0.4 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 deepstream: 6.0 
NvDsInferenceExt 
  Version: 0.0.4 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 deepstream: 6.0 
NvDsInferenceUtilsExt 
  Version: 0.0.5 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 deepstream: 6.0 
NvDsSourceExt 
  Version: 0.0.6 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 deepstream: 6.0 
NvDsMuxDemuxExt 
  Version: 0.0.4 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 deepstream: 6.0 
NvDsOutputSinkExt 
  Version: 0.0.3 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 deepstream: 6.0 
NvDsSampleModelsExt 
  Version: 0.0.4 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 deepstream: 6.0 
NvDsVisualizationExt 
  Version: 0.0.3 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 deepstream: 6.0 

2024-07-17 13:51:51,355 - ContainerBuilder.container_builder.graph_handler - DEBUG - unpacking extension archives: /home/ubuntu/.cache/container_builder/.workfolder_4012/final_image/deepstream-test1.tar.gz
2024-07-17 13:51:53,056 - ContainerBuilder.container_builder.graph_handler - DEBUG - graph /opt/nvidia/deepstream/deepstream-6.0/reference_graphs/deepstream-test1/deepstream-test1.yaml installed by registry
2024-07-17 13:51:53,057 - ContainerBuilder.container_builder.graph_handler - DEBUG - get existing repo list: default,ngc-public
2024-07-17 13:51:53,057 - ContainerBuilder.container_builder.graph_handler - DEBUG - registry closed
2024-07-17 13:51:53,058 - ContainerBuilder.container_builder.docker_manager - INFO - work folder: /home/ubuntu/.cache/container_builder/.workfolder_4012 is ready
2024-07-17 13:51:53,058 - ContainerBuilder.container_builder.docker_manager - INFO - start build docker file /home/ubuntu/.cache/container_builder/.dockerfile_4012
2024-07-17 13:51:53,058 - ContainerBuilder.container_builder.docker_builder - DEBUG - starting build image container_build_17072024:deepstream-test1-jetson with network host
2024-07-17 13:51:54,293 - ContainerBuilder.container_builder.docker_builder - DEBUG - Start printing docker build log:
Step 1/10 : FROM  nvcr.io/nvidia/deepstream-l4t:6.0-samples AS final_image
 ---> 1e08ebd4f227
Step 2/10 : ARG DEBIAN_FRONTEND=noninteractive
 ---> [Warning] The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64/v3) and no specific platform was requested
 ---> Running in 9427e599d694
Removing intermediate container 9427e599d694
 ---> 3e23901d2ac4
Step 3/10 : COPY ["final_image", "/"]
 ---> 3670f199bbf1
Step 4/10 : RUN true
 ---> [Warning] The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64/v3) and no specific platform was requested
 ---> Running in 959960f42d56
exec /bin/sh: exec format error
The command '/bin/sh -c true' returned a non-zero code: 1
2024-07-17 13:52:04,060 - ContainerBuilder.container_builder.docker_builder - ERROR - docker build failed on file: /home/ubuntu/.cache/container_builder/.dockerfile_4012, buildError:The command '/bin/sh -c true' returned a non-zero code: 1
Traceback (most recent call last):
  File "container_builder/docker_builder.py", line 113, in build_from
  File "container_builder/docker_builder.py", line 72, in _internal_build
  File "container_builder/docker_builder.py", line 53, in _print_chunk
docker.errors.BuildError: The command '/bin/sh -c true' returned a non-zero code: 1
2024-07-17 13:52:04,060 - ContainerBuilder.container_builder.docker_manager - ERROR - build image container_build_17072024:deepstream-test1-jetson on dockerfile /home/ubuntu/.cache/container_builder/.dockerfile_4012 failed
2024-07-17 13:52:04,060 - ContainerBuilder.container_builder.docker_manager - ERROR - build stage image container_build_17072024:deepstream-test1-jetson failed
2024-07-17 13:52:04,082 - ContainerBuilder.container_builder.container_builder - ERROR - build config file: ds_test1_container_builder_jetson.yaml failed
ubuntu@nvidia-ds6-us1804:/opt/nvidia/deepstream/deepstream-6.0/reference_graphs/deepstream-test1$ 

As per your fast reply I thought to go over the documentation again…
I figured that I forgot to run the ARM64 support on x86/64 systems

sudo apt install qemu-user-static binfmt-support
sudo docker run --rm --privileged multiarch/qemu-user-static --reset --persistent yes --credential yes

At this stage I’m back to my initial forum entry - Deepstream 6.0 + Container Builder build for Jetson nano 4GB fails

changing my build file to the values I figured out in that post and it all worked :)

Updated ds_test1_container_builder_jetson.yaml for my container build

---
# final stage
unique_stage: final_image
base_image: nvcr.io/nvidia/deepstream-l4t:6.0.1-base
stage_model: clean_stage

local_copy_files:
- src: "/opt/nvidia/graph-composer/graph_composer-1.0.0_arm64.deb"
dst: "/tmp/"
- src: "parameters.yaml"
dst: "/workspace/deepstream-test1/" # ends with '/' is folder
- src: "/tmp/rsync_3.1.0-2_arm64.deb"
dst: "/tmp/"

custom_runs:
- "apt install -y libpopt0"
- "dpkg -i /tmp/rsync_3.1.0-2_arm64.deb"
- "apt install -y /tmp/graph_composer-1.0.0_arm64.deb && rm -rf /tmp/graph-composer-1.0.0_arm64.deb"

work_folder: /workspace/deepstream-test1/

env_list:
PATH: "/opt/nvidia/graph-composer/:$PATH"
LD_LIBRARY_PATH: "/opt/nvidia/graph-composer/:$LD_LIBRARY_PATH"
DISPLAY: ":0"

# Setup entrypoint
entrypoint:
- "gxe"
- "--manifest"
- "deepstream-test1_manifest.yaml"
- "--app"
- "deepstream-test1.yaml,parameters.yaml"

---
# Container Builder Config
container_builder: main # required
graph:
graph_files: [ deepstream-test1.yaml ]
graph_dst: /workspace/deepstream-test1/
manifest_dst: /workspace/deepstream-test1/deepstream-test1_manifest.yaml
ext_install_root: /workspace/deepstream-test1/
docker_build:
image_name: deepstream-test1-jetson_17072024

and it all went through

ubuntu@nvidia-ds6-us1804:/opt/nvidia/deepstream/deepstream-6.0/reference_graphs/TEST2$ sudo container_builder -c ds_test1_container_builder_jetson.yaml -d /opt/nvidia/graph-composer/config/target_aarch64.yaml --log-level DEBUG
2024-07-17 14:40:58,020 - ContainerBuilder.container_builder.container_builder - DEBUG - container_builder is running in PyInstaller
2024-07-17 14:40:58,025 - ContainerBuilder.container_builder.builder_config - DEBUG - Reading Docker Manager config file
2024-07-17 14:40:58,029 - ContainerBuilder.container_builder.docker_manager - INFO - base_image set in config file nvcr.io/nvidia/deepstream-l4t:6.0.1-base
2024-07-17 14:40:58,029 - ContainerBuilder.container_builder.docker_manager - INFO - start building stage image deepstream-test1-jetson_17072024
2024-07-17 14:40:58,030 - ContainerBuilder.container_builder.docker_templ.templ_render - DEBUG - searching templ_folder:clean_stage
2024-07-17 14:40:58,030 - ContainerBuilder.container_builder.docker_templ.templ_render - DEBUG - loading templ_file:clean_stage
2024-07-17 14:40:58,047 - ContainerBuilder.container_builder.docker_templ.templ_render - DEBUG - rendering docker base template context
2024-07-17 14:40:58,047 - ContainerBuilder.container_builder.docker_templ.templ_render - DEBUG - rendered dockerfile result:


FROM  nvcr.io/nvidia/deepstream-l4t:6.0.1-base AS final_image
ARG DEBIAN_FRONTEND=noninteractive









COPY ["final_image", "/"]
RUN true






ENV PATH="/opt/nvidia/graph-composer/:$PATH"
ENV LD_LIBRARY_PATH="/opt/nvidia/graph-composer/:$LD_LIBRARY_PATH"
ENV DISPLAY=":0"


WORKDIR /workspace/deepstream-test1/


RUN apt install -y libpopt0
RUN dpkg -i /tmp/rsync_3.1.0-2_arm64.deb
RUN apt install -y /tmp/graph_composer-1.0.0_arm64.deb && rm -rf /tmp/graph-composer-1.0.0_arm64.deb




ENTRYPOINT [ \
 "gxe",  "--manifest",  "deepstream-test1_manifest.yaml",  "--app",  "deepstream-test1.yaml,parameters.yaml"  ]

2024-07-17 14:40:58,047 - ContainerBuilder.container_builder.docker_templ.docker_templ_maker - INFO - writing docker content to /home/ubuntu/.cache/container_builder/.dockerfile_5597
2024-07-17 14:40:58,047 - ContainerBuilder.container_builder.docker_manager - INFO - docker file /home/ubuntu/.cache/container_builder/.dockerfile_5597 generated
2024-07-17 14:40:58,047 - ContainerBuilder.container_builder.docker_manager - INFO - start preparing work folder: /home/ubuntu/.cache/container_builder/.workfolder_5597
2024-07-17 14:40:58,047 - ContainerBuilder.container_builder.docker_workfolder - DEBUG - Start preparing folder: /home/ubuntu/.cache/container_builder/.workfolder_5597/final_image
2024-07-17 14:40:58,047 - ContainerBuilder.container_builder.docker_workfolder - INFO - copying local files to work folder
2024-07-17 14:40:58,047 - ContainerBuilder.container_builder.docker_workfolder - DEBUG - copying src: /opt/nvidia/graph-composer/graph_composer-1.0.0_arm64.deb to dst: /home/ubuntu/.cache/container_builder/.workfolder_5597/final_image/tmp
2024-07-17 14:40:58,058 - ContainerBuilder.container_builder.docker_workfolder - DEBUG - copying src: /opt/nvidia/deepstream/deepstream-6.0/reference_graphs/TEST2/parameters.yaml to dst: /home/ubuntu/.cache/container_builder/.workfolder_5597/final_image/workspace/deepstream-test1
2024-07-17 14:40:58,058 - ContainerBuilder.container_builder.docker_workfolder - DEBUG - copying src: /tmp/rsync_3.1.0-2_arm64.deb to dst: /home/ubuntu/.cache/container_builder/.workfolder_5597/final_image/tmp
2024-07-17 14:40:58,059 - ContainerBuilder.container_builder.docker_workfolder - INFO - Work folder: /home/ubuntu/.cache/container_builder/.workfolder_5597/final_image is ready
2024-07-17 14:40:59,281 - ContainerBuilder.container_builder.graph_handler - DEBUG - getting registry version
2024-07-17 14:40:59,281 - ContainerBuilder.container_builder.graph_handler - DEBUG - get existing repo list: ngc-public,default
2024-07-17 14:40:59,281 - ContainerBuilder.container_builder.graph_handler - DEBUG - starting install graph /opt/nvidia/deepstream/deepstream-6.0/reference_graphs/TEST2/deepstream-test1.yaml
2024-07-17 14:40:59,282 - ContainerBuilder.container_builder.graph_handler - DEBUG - copying graph_file: /opt/nvidia/deepstream/deepstream-6.0/reference_graphs/TEST2/deepstream-test1.yaml to dst: /home/ubuntu/.cache/container_builder/.workfolder_5597/final_image/workspace/deepstream-test1/deepstream-test1.yaml
2024-07-17 14:40:59,282 - ContainerBuilder.container_builder.graph_handler - DEBUG - downloading extension archives into /home/ubuntu/.cache/container_builder/.workfolder_5597/final_image
2024-07-17 14:40:59,282 - ContainerBuilder.container_builder.graph_handler - DEBUG - generate graph manifest /workspace/deepstream-test1/deepstream-test1_manifest.yaml
2024-07-17 14:40:59,282 - ContainerBuilder.container_builder.graph_handler - DEBUG - installing registry on graph ['/opt/nvidia/deepstream/deepstream-6.0/reference_graphs/TEST2/deepstream-test1.yaml']
2024-07-17 14:40:59,284 - Registry - INFO - Installing graph ...
2024-07-17 14:40:59,307 - Registry - INFO - Extension update found for extension: NvDsBaseExt
2024-07-17 14:40:59,307 - Registry - INFO - Old version: 0.0.3 New version: 0.0.4
2024-07-17 14:40:59,309 - Registry - INFO - 
Requested target configuration: 
  arch: aarch64 os: linux distribution: ubuntu_18.04 cuda: 10.2 cudnn: 8.0.3 tensorrt: 8.0.1.6 deepstream: 6.0 vpi: 1.1.12 

Selected extension variants: 
MultimediaExtension 
  Version: 1.0.0 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 
StandardExtension 
  Version: 1.0.1 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 cuda: 10.2 
NvDsInterfaceExt 
  Version: 0.0.3 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 deepstream: 6.0 
NvDsBaseExt 
  Version: 0.0.4 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 deepstream: 6.0 
NvDsSourceExt 
  Version: 0.0.6 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 deepstream: 6.0 
NvDsMuxDemuxExt 
  Version: 0.0.4 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 deepstream: 6.0 
NvDsInferenceExt 
  Version: 0.0.4 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 deepstream: 6.0 
NvDsSampleModelsExt 
  Version: 0.0.4 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 deepstream: 6.0 
NvDsOutputSinkExt 
  Version: 0.0.3 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 deepstream: 6.0 
NvDsVisualizationExt 
  Version: 0.0.3 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 deepstream: 6.0 
NvDsInferenceUtilsExt 
  Version: 0.0.5 Variant: arch: aarch64 os: linux distribution: ubuntu_18.04 deepstream: 6.0 

2024-07-17 14:41:42,024 - ContainerBuilder.container_builder.graph_handler - DEBUG - unpacking extension archives: /home/ubuntu/.cache/container_builder/.workfolder_5597/final_image/deepstream-test1.tar.gz
2024-07-17 14:41:43,670 - ContainerBuilder.container_builder.graph_handler - DEBUG - graph /opt/nvidia/deepstream/deepstream-6.0/reference_graphs/TEST2/deepstream-test1.yaml installed by registry
2024-07-17 14:41:43,670 - ContainerBuilder.container_builder.graph_handler - DEBUG - get existing repo list: ngc-public,default
2024-07-17 14:41:43,670 - ContainerBuilder.container_builder.graph_handler - DEBUG - registry closed
2024-07-17 14:41:43,671 - ContainerBuilder.container_builder.docker_manager - INFO - work folder: /home/ubuntu/.cache/container_builder/.workfolder_5597 is ready
2024-07-17 14:41:43,671 - ContainerBuilder.container_builder.docker_manager - INFO - start build docker file /home/ubuntu/.cache/container_builder/.dockerfile_5597
2024-07-17 14:41:43,671 - ContainerBuilder.container_builder.docker_builder - DEBUG - starting build image deepstream-test1-jetson_17072024 with network host
2024-07-17 14:41:44,920 - ContainerBuilder.container_builder.docker_builder - DEBUG - Start printing docker build log:
Step 1/12 : FROM  nvcr.io/nvidia/deepstream-l4t:6.0.1-base AS final_image
 ---> b7b630713447
Step 2/12 : ARG DEBIAN_FRONTEND=noninteractive
 ---> [Warning] The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64/v3) and no specific platform was requested
 ---> Running in 452f8ed35907
Removing intermediate container 452f8ed35907
 ---> 0b75fd93b98e
Step 3/12 : COPY ["final_image", "/"]
 ---> d7e718719ef0
Step 4/12 : RUN true
 ---> [Warning] The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64/v3) and no specific platform was requested
 ---> Running in 3727d3c061d8
Removing intermediate container 3727d3c061d8
 ---> 7d9c3c01d8ac
Step 5/12 : ENV PATH="/opt/nvidia/graph-composer/:$PATH"
 ---> [Warning] The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64/v3) and no specific platform was requested
 ---> Running in 7458acd638ed
Removing intermediate container 7458acd638ed
 ---> e3c31735f90d
Step 6/12 : ENV LD_LIBRARY_PATH="/opt/nvidia/graph-composer/:$LD_LIBRARY_PATH"
 ---> [Warning] The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64/v3) and no specific platform was requested
 ---> Running in cae1a185ceb5
Removing intermediate container cae1a185ceb5
 ---> 4091c1be4030
Step 7/12 : ENV DISPLAY=":0"
 ---> [Warning] The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64/v3) and no specific platform was requested
 ---> Running in 0cdf964e3560
Removing intermediate container 0cdf964e3560
 ---> ba71e86107ad
Step 8/12 : WORKDIR /workspace/deepstream-test1/
 ---> [Warning] The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64/v3) and no specific platform was requested
 ---> Running in d186bcf91c56
Removing intermediate container d186bcf91c56
 ---> ad501746c30c
Step 9/12 : RUN apt install -y libpopt0
 ---> [Warning] The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64/v3) and no specific platform was requested
 ---> Running in 03a52c0786ca
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  libpopt0
0 upgraded, 1 newly installed, 0 to remove and 10 not upgraded.
Need to get 22.8 kB of archives.
After this operation, 115 kB of additional disk space will be used.
Get:1 http://ports.ubuntu.com/ubuntu-ports bionic/main arm64 libpopt0 arm64 1.16-11 [22.8 kB]
Fetched 22.8 kB in 0s (117 kB/s)    
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libpopt0:arm64.
(Reading database ... 38036 files and directories currently installed.)
Preparing to unpack .../libpopt0_1.16-11_arm64.deb ...
Unpacking libpopt0:arm64 (1.16-11) ...
Setting up libpopt0:arm64 (1.16-11) ...
Processing triggers for libc-bin (2.27-3ubuntu1.4) ...
Removing intermediate container 03a52c0786ca
 ---> ec8d0dd6fb6e
Step 10/12 : RUN dpkg -i /tmp/rsync_3.1.0-2_arm64.deb
 ---> [Warning] The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64/v3) and no specific platform was requested
 ---> Running in 86af21fee77d
Selecting previously unselected package rsync.
(Reading database ... 38042 files and directories currently installed.)
Preparing to unpack /tmp/rsync_3.1.0-2_arm64.deb ...
Unpacking rsync (3.1.0-2) ...
Setting up rsync (3.1.0-2) ...
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of restart.
Removing intermediate container 86af21fee77d
 ---> 6896da557fff
Step 11/12 : RUN apt install -y /tmp/graph_composer-1.0.0_arm64.deb && rm -rf /tmp/graph-composer-1.0.0_arm64.deb
 ---> [Warning] The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64/v3) and no specific platform was requested
 ---> Running in 000727aa3510
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'graph-composer' instead of '/tmp/graph_composer-1.0.0_arm64.deb'
The following NEW packages will be installed:
  graph-composer
0 upgraded, 1 newly installed, 0 to remove and 11 not upgraded.
Need to get 0 B/23.0 MB of archives.
After this operation, 406 MB of additional disk space will be used.
Get:1 /tmp/graph_composer-1.0.0_arm64.deb graph-composer arm64 1.0.0 [23.0 MB]
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package graph-composer.
(Reading database ... 38071 files and directories currently installed.)
Preparing to unpack .../graph_composer-1.0.0_arm64.deb ...
Unpacking graph-composer (1.0.0) ...
Setting up graph-composer (1.0.0) ...
update-alternatives: using /opt/nvidia/graph-composer/libgxf_core.so to provide /usr/lib/aarch64-linux-gnu/libgxf_core.so (gxf_core) in auto mode
update-alternatives: using /opt/nvidia/graph-composer/gxe to provide /usr/bin/gxe (gxe) in auto mode
update-alternatives: using /opt/nvidia/graph-composer/registry to provide /usr/bin/registry (registry) in auto mode
Processing triggers for libc-bin (2.27-3ubuntu1.4) ...
Removing intermediate container 000727aa3510
 ---> 24f415785859
Step 12/12 : ENTRYPOINT [  "gxe",  "--manifest",  "deepstream-test1_manifest.yaml",  "--app",  "deepstream-test1.yaml,parameters.yaml"  ]
 ---> [Warning] The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64/v3) and no specific platform was requested
 ---> Running in bc03ce08816b
Removing intermediate container bc03ce08816b
 ---> 00c30b1c497f
Successfully built 00c30b1c497f
Successfully tagged deepstream-test1-jetson_17072024:latest
2024-07-17 14:42:24,826 - ContainerBuilder.container_builder.docker_builder - INFO - docker build image on file:/home/ubuntu/.cache/container_builder/.dockerfile_5597, successfully
2024-07-17 14:42:24,826 - ContainerBuilder.container_builder.docker_manager - INFO - build image deepstream-test1-jetson_17072024 on dockerfile /home/ubuntu/.cache/container_builder/.dockerfile_5597 sucessfully
2024-07-17 14:42:24,826 - ContainerBuilder.container_builder.docker_manager - INFO - build final image deepstream-test1-jetson_17072024 sucessfully
2024-07-17 14:42:24,826 - ContainerBuilder.container_builder.docker_manager - INFO - start pruning images
2024-07-17 14:42:24,831 - ContainerBuilder.container_builder.docker_builder - DEBUG - docker image prune, dangling True
2024-07-17 14:42:24,834 - ContainerBuilder.container_builder.docker_manager - INFO - Container builder build config sucessfully
ubuntu@nvidia-ds6-us1804:/opt/nvidia/deepstream/deepstream-6.0/reference_graphs/TEST2$

Cheers Maximilian

So everything works fine now,glad to hear that.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.