Torizon cpp code with gstreamer build failed

Hello,
I’m trying to build cpp application based on makefile and it is created using sample project from vs code extension. This application is using gstreamer and opencv libraries.

The board I’m using is Verdin imx8 plus and carrier board is Yavia board.
The torizon version is-
Linux verdin-imx8mp-15128223 6.6.54-7.1.0-g3493ccd66900 #1-Torizon SMP PREEMPT Tue Dec 17 21:04:41 UTC 2024 aarch64 GNU/Linux

Right now I’m getting some build errors related to makefile looking like either some libraries are missing in docker or some changes are needed in Makefile. I’ve also tried to build the same app using yocto sdk the build was successful.

Please have a look into errors.

Executing task: pwsh -nop .conf/validateDepsRunning.ps1

:warning: VALIDATING ENVIRONMENT

:white_check_mark: Environment is valid!

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: bash -c [[ ! -z “10.20.24.106” ]] && true || false

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: bash -c [[ “aarch64” == “aarch64” ]] && true || false

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: sleep 1

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: sshpass -p neogen scp -P 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /home/gaurav-c/tiscamera/docker-compose.yml torizon@10.20.24.106:~/

Warning: Permanently added ‘10.20.24.106’ (ED25519) to the list of known hosts.

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: DOCKER_HOST=10.20.24.106:2375 docker image prune -f --filter=dangling=true

Total reclaimed space: 0B

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: docker compose -p torizon stop tiscam tiscam-debug && docker compose -p torizon rm -f tiscam tiscam-debug

No stopped containers

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: pwsh -nop /home/gaurav-c/tiscamera/.conf/torizonPackages.ps1 arm64

Applying torizonPackages.json …
Applying to Dockerfile.debug …
:white_check_mark: Dockerfile.debug
Applying to Dockerfile.sdk …
:white_check_mark: Dockerfile.sdk
Applying to Dockerfile …
:white_check_mark: Dockerfile
torizonPackages.json applied

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: DOCKER_HOST= docker build --pull -f /home/gaurav-c/tiscamera/Dockerfile.sdk /home/gaurav-c/tiscamera -t cross-toolchain-arm64-tiscam --build-arg IMAGE_ARCH=arm64 --build-arg GPU=-imx8 --build-arg APP_ROOT=/home/torizon/app

[+] Building 1.8s (8/8) FINISHED docker:default
=> [internal] load build definition from Dockerfile.sdk 0.0s
=> => transferring dockerfile: 1.16kB 0.0s
=> WARN: InvalidDefaultArgInFrom: Default value for ARG torizon/debian-cross-toolchain-${IMAGE_ARCH}:${CROSS_SDK_BASE_ 0.0s
=> [internal] load metadata for docker.io/torizon/debian-cross-toolchain-arm64:3.2.0 1.7s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 56B 0.0s
=> [1/4] FROM docker.io/torizon/debian-cross-toolchain-arm64:3.2.0@sha256:0c1389af168fab4942b68525591c8ff0722f40d3f10a 0.0s
=> CACHED [2/4] RUN apt-get -q -y update && apt-get -q -y install && apt-get clean && apt-get autoremove & 0.0s
=> CACHED [3/4] RUN apt-get -q -y update && apt-get -q -y install pkg-config:arm64 libgstreamer1.0-0:arm 0.0s
=> CACHED [4/4] WORKDIR /home/torizon/app 0.0s
=> exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:f0a5bc5730f2361a29f589b1a50f3c4c3f144509c75f3039376f2fedcc5402a8 0.0s
=> => naming to Docker Hub Container Image Library | App Containerization 0.0s

1 warning found (use docker --debug to expand):

  • InvalidDefaultArgInFrom: Default value for ARG torizon/debian-cross-toolchain-${IMAGE_ARCH}:${CROSS_SDK_BASE_TAG} results in empty or invalid base image name (line 16)
  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: make ARCH=arm64 makedir

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: DOCKER_HOST= docker run --rm -v /home/gaurav-c/tiscamera:/home/torizon/app cross-toolchain-arm64-tiscam make ARCH=arm64 CC=aarch64-linux-gnu-g++ debug

Package gstreamer-app-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing gstreamer-app-1.0.pc' to the PKG_CONFIG_PATH environment variable Package 'gstreamer-app-1.0', required by 'virtual:world', not found Package gstreamer-app-1.0 was not found in the pkg-config search path. Perhaps you should add the directory containing gstreamer-app-1.0.pc’
to the PKG_CONFIG_PATH environment variable
Package ‘gstreamer-app-1.0’, required by ‘virtual:world’, not found
Package gstreamer-video-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gstreamer-video-1.0.pc’
to the PKG_CONFIG_PATH environment variable
Package ‘gstreamer-video-1.0’, required by ‘virtual:world’, not found
Package ‘gstreamer-app-1.0’, required by ‘virtual:world’, not found
aarch64-linux-gnu-g++ -Iincludes/ -Icrow/include -Iboost_1_81_0 -I/usr/include -c -g -o build-arm64/debug/main.o src/main.cpp
In file included from src/cameraServer.h:5,
from src/main.cpp:7:
src/tcamcamera.h:11:10: fatal error: gst/gst.h: No such file or directory
11 | #include <gst/gst.h>
| ^~~~~~~~~~~
compilation terminated.
make: *** [Makefile:45: build-arm64/debug/main.o] Error 1

  • The terminal process “/usr/bin/bash ‘-c’, ‘DOCKER_HOST= docker run --rm -v /home/gaurav-c/tiscamera:/home/torizon/app cross-toolchain-arm64-tiscam make ARCH=arm64 CC=aarch64-linux-gnu-g++ debug’” terminated with exit code: 2.
  • Terminal will be reused by tasks, press any key to close it.

Please also find makefile and dockerfile in attachments.
Please suggest what changes are needed in dockerfile and makefile for successful build

Thanks,
Gaurav
Dockerfile (3.1 KB)
Dockerfile.debug (2.9 KB)
Dockerfile.sdk (1.1 KB)
Makefile (1.7 KB)
torizonPackages.json (907 Bytes)

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello Gaurav,

Thank you for reaching out with your issue. It sounds like you’re encountering some build errors due to missing GStreamer libraries in your Docker environment. Let’s address this step-by-step to help you resolve the issue.

  1. Modify the Dockerfile:

    • Ensure that your Dockerfile includes the installation of GStreamer and its plugins. You can add the following lines to your Dockerfile to install the necessary GStreamer packages:
      RUN apt-get update && \
          apt-get install -y \
          gstreamer1.0-tools \
          gstreamer1.0-plugins-base \
          gstreamer1.0-plugins-good \
          gstreamer1.0-plugins-bad \
          gstreamer1.0-plugins-ugly \
          gstreamer1.0-libav \
          libgstreamer-plugins-base1.0-dev \
          libgstreamer1.0-dev
      
    • This ensures that the GStreamer development files and plugins are available during the build process.
  2. Set the PKG_CONFIG_PATH:

    • Make sure the PKG_CONFIG_PATH environment variable is set correctly in your Dockerfile to include the path where GStreamer .pc files are located. You can add this line to your Dockerfile:
      ENV PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig
      
  3. Verify the Makefile:

    • Ensure that your Makefile is configured to use pkg-config to find GStreamer libraries. You might need to add pkg-config flags in your Makefile:
      CXXFLAGS += $(shell pkg-config --cflags gstreamer-1.0 gstreamer-app-1.0 gstreamer-video-1.0)
      LDFLAGS += $(shell pkg-config --libs gstreamer-1.0 gstreamer-app-1.0 gstreamer-video-1.0)
      

By ensuring these packages are installed and correctly referenced in your Dockerfile and Makefile, you should be able to resolve the build errors related to missing GStreamer libraries. If you continue to experience issues, double-check the package names and paths specific to your setup.

I hope this helps! If you have any more questions, feel free to ask.

Best regards,
Toradex AI Assistant

Please, also check if these links can help you solve your problem:

OpenCV (Linux) | Toradex Developer Center.

Greetings @gaurav,

I think I know what might have happened here. The error you got in compilation was:

src/tcamcamera.h:11:10: fatal error: gst/gst.h: No such file or directory

However, I see in your Dockerfile.sdk, you are installing libgstreamer1.0-dev:arm64 which should provide this header file. Looking at your logs you provided, notice the build logs for your SDK container:

...
=> CACHED [3/4] RUN apt-get -q -y update && apt-get -q -y install pkg-config:arm64 libgstreamer1.0-0:arm 0.0s
...

Your SDK container installs both pkg-config:arm64 and libgstreamer1.0-0:arm, but it doesn’t install the needed libgstreamer1.0-dev:arm64. I assume something strange happened while building your SDK container. Maybe it was some cached information or it did not see the latest version of your Dockerfile.sdk file. Try to re-build the SDK container from scratch and monitor the logs to make sure it actually installs libgstreamer1.0-dev:arm64.

Best Regards,
Jeremias

hello @jeremias.tx thanks for the reply I created new project passing all the required libraries and they are installed too inside container. But I’m getting new error of gstappsink.h file not found.
I tried to pass gstreamer flags in the Makefile but still it cannot be found.

Please suggest what needs to be changed to make it work. Because I have built the same application using Makefile using yocto sdk.
please find the attachment for makefile and dockerfiles.

Please have a look at below errors-

:warning: VALIDATING ENVIRONMENT

:white_check_mark: Environment is valid!

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: bash -c [[ ! -z “10.20.24.106” ]] && true || false

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: bash -c [[ “aarch64” == “aarch64” ]] && true || false

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: sleep 1

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: sshpass -p neogen scp -P 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /home/gaurav-c/tiscamera4/docker-compose.yml torizon@10.20.24.106:~/

Warning: Permanently added ‘10.20.24.106’ (ED25519) to the list of known hosts.

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: DOCKER_HOST=10.20.24.106:2375 docker image prune -f --filter=dangling=true

Total reclaimed space: 0B

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: docker compose -p torizon stop tiscam4 tiscam4-debug && docker compose -p torizon rm -f tiscam4 tiscam4-debug

[+] Stopping 1/1
:heavy_check_mark: Container torizon-tiscam4-debug-1 Stopped 0.5s
Going to remove torizon-tiscam4-debug-1
[+] Removing 1/0
:heavy_check_mark: Container torizon-tiscam4-debug-1 Removed 0.0s

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: pwsh -nop /home/gaurav-c/tiscamera4/.conf/torizonPackages.ps1 arm64

Applying torizonPackages.json …
Applying to Dockerfile.debug …
:white_check_mark: Dockerfile.debug
Applying to Dockerfile.sdk …
:white_check_mark: Dockerfile.sdk
Applying to Dockerfile …
:white_check_mark: Dockerfile
torizonPackages.json applied

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: DOCKER_HOST= docker build --pull -f /home/gaurav-c/tiscamera4/Dockerfile.sdk /home/gaurav-c/tiscamera4 -t cross-toolchain-arm64-tiscam4 --build-arg IMAGE_ARCH=arm64 --build-arg GPU=-imx8 --build-arg APP_ROOT=/home/torizon/app

[+] Building 0.9s (8/8) FINISHED docker:default
=> [internal] load build definition from Dockerfile.sdk 0.0s
=> => transferring dockerfile: 1.17kB 0.0s
=> WARN: InvalidDefaultArgInFrom: Default value for ARG torizon/debian-cross-toolchain-${IMAGE_ARCH}:${CROSS_SDK_BASE_TAG} res 0.0s
=> [internal] load metadata for docker.io/torizon/debian-cross-toolchain-arm64:3.2.0 0.8s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 56B 0.0s
=> [1/4] FROM docker.io/torizon/debian-cross-toolchain-arm64:3.2.0@sha256:0c1389af168fab4942b68525591c8ff0722f40d3f10a6b92b4c2 0.0s
=> CACHED [2/4] RUN apt-get -q -y update && apt-get -q -y install && apt-get clean && apt-get autoremove && rm 0.0s
=> CACHED [3/4] RUN apt-get -q -y update && apt-get -q -y install usbutils:arm64 libgstreamer1.0-dev:arm64 0.0s
=> CACHED [4/4] WORKDIR /home/torizon/app 0.0s
=> exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:b173701aa7a8392ca4f85aa05c5855cb1003fc610241e9bf3276f426ec5fb0ff 0.0s
=> => naming to Docker Hub Container Image Library | App Containerization 0.0s

1 warning found (use docker --debug to expand):

  • InvalidDefaultArgInFrom: Default value for ARG torizon/debian-cross-toolchain-${IMAGE_ARCH}:${CROSS_SDK_BASE_TAG} results in empty or invalid base image name (line 16)
  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: make ARCH=arm64 makedir

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: DOCKER_HOST= docker run --rm -v /home/gaurav-c/tiscamera4:/home/torizon/app cross-toolchain-arm64-tiscam4 make ARCH=arm64 CC=aarch64-linux-gnu-g++ debug

Package gstreamer-app-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gstreamer-app-1.0.pc’
to the PKG_CONFIG_PATH environment variable
Package ‘gstreamer-app-1.0’, required by ‘virtual:world’, not found
aarch64-linux-gnu-g++ -Iincludes/ -Icrow/include -Iboost_1_81_0 -I/usr/include -I/usr/include/gstreamer-1.0/gst/app -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include -pthread -I/usr/include/aarch64-linux-gnu -c -g -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include -pthread -I/usr/include/aarch64-linux-gnu -o build-arm64/debug/main.o src/main.cpp
src/main.cpp:3:10: fatal error: gst/app/gstappsink.h: No such file or directory
3 | #include <gst/app/gstappsink.h>
| ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:44: build-arm64/debug/main.o] Error 1

  • The terminal process “/usr/bin/bash ‘-c’, ‘DOCKER_HOST= docker run --rm -v /home/gaurav-c/tiscamera4:/home/torizon/app cross-toolchain-arm64-tiscam4 make ARCH=arm64 CC=aarch64-linux-gnu-g++ debug’” terminated with exit code: 2.
  • Terminal will be reused by tasks, press any key to close it.

Thanks,
Gaurav
Dockerfile (3.1 KB)
Dockerfile.debug (2.9 KB)
Dockerfile.sdk (1.1 KB)
Makefile (1.7 KB)
torizonPackages.json (907 Bytes)

But I’m getting new error of gstappsink.h file not found.
I tried to pass gstreamer flags in the Makefile but still it cannot be found.

The gstappsink.h header file comes from this package in Debian: https://packages.debian.org/bookworm/arm64/libgstreamer-plugins-base1.0-dev/filelist

Which I don’t see being installed in your SDK container image. Next time you get a similar error where a file can’t be found, try searching for the package that provides this file first. Then, make sure the corresponding package is being properly installed in your SDK.

Best Regards,
Jeremias

Yes, i forgot to mention that the first thing I tried was adding the package inside .sdk file using torizonpackages.json but was getting unmet dependencies error.

There were two ways I tried to add package libgstreamer1.0-dev:arm64 manually and through json please find the error below in both cases-

METHOD - 1

# automate for torizonPackages.json
RUN apt-get -q -y update && *
** apt-get -q -y install *

** libgstreamer-plugins-base1.0-dev **

# DO NOT REMOVE THIS LABEL: this is used for VS Code automation
** # torizon_packages_build_start**
** libgstreamer1.0-dev:arm64 **
** # torizon_packages_build_end**
# DO NOT REMOVE THIS LABEL: this is used for VS Code automation
** && **
** apt-get clean && apt-get autoremove && **
** rm -rf /var/lib/apt/lists/* **

*** Executing task: pwsh -nop .conf/validateDepsRunning.ps1 **

:warning: VALIDATING ENVIRONMENT

:white_check_mark: Environment is valid!

** * Terminal will be reused by tasks, press any key to close it. **

** * Executing task: bash -c [[ ! -z “10.20.24.106” ]] && true || false **

** * Terminal will be reused by tasks, press any key to close it. **

** * Executing task: bash -c [[ “aarch64” == “aarch64” ]] && true || false **

** * Terminal will be reused by tasks, press any key to close it. **

** * Executing task: sleep 1 **

** * Terminal will be reused by tasks, press any key to close it. **

** * Executing task: sshpass -p neogen scp -P 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /home/gaurav-c/tiscamera5/docker-compose.yml torizon@10.20.24.106:~/ **

Warning: Permanently added ‘10.20.24.106’ (ED25519) to the list of known hosts.
** * Terminal will be reused by tasks, press any key to close it. **

** * Executing task: DOCKER_HOST=10.20.24.106:2375 docker image prune -f --filter=dangling=true **

Total reclaimed space: 0B
** * Terminal will be reused by tasks, press any key to close it. **

** * Executing task: docker compose -p torizon stop tiscam5 tiscam5-debug && docker compose -p torizon rm -f tiscam5 tiscam5-debug **

No stopped containers
** * Terminal will be reused by tasks, press any key to close it. **

** * Executing task: pwsh -nop /home/gaurav-c/tiscamera5/.conf/torizonPackages.ps1 arm64 **

Applying torizonPackages.json …
Applying to Dockerfile.debug …
:white_check_mark: Dockerfile.debug
Applying to Dockerfile.sdk …
:white_check_mark: Dockerfile.sdk
Applying to Dockerfile …
:white_check_mark: Dockerfile
torizonPackages.json applied
** * Terminal will be reused by tasks, press any key to close it. **

** * Executing task: DOCKER_HOST= docker build --pull -f /home/gaurav-c/tiscamera5/Dockerfile.sdk /home/gaurav-c/tiscamera5 -t cross-toolchain-arm64-tiscam5 --build-arg IMAGE_ARCH=arm64 --build-arg GPU=-imx8 --build-arg APP_ROOT=/home/torizon/app **

[+] Building 238.7s (8/8) FINISHED docker:default
** => [internal] load build definition from Dockerfile.sdk 0.0s**
** => => transferring dockerfile: 1.14kB 0.0s**
** => WARN: NoEmptyContinuation: Empty continuation line (line 42) 0.0s**
** => WARN: InvalidDefaultArgInFrom: Default value for ARG torizon/debian-cross-toolchain-${IMAGE_ARCH}:${CROSS_SDK_BASE_TAG} results in empty or 0.0s**
** => [internal] load metadata for docker.io/torizon/debian-cross-toolchain-arm64:3.2.0 1.0s**
** => [internal] load .dockerignore 0.0s**
** => => transferring context: 56B 0.0s**
** => [1/4] FROM docker.io/torizon/debian-cross-toolchain-arm64:3.2.0@sha256:0c1389af168fab4942b68525591c8ff0722f40d3f10a6b92b4c2ad9660cf12b6 0.0s**
** => CACHED [2/4] RUN apt-get -q -y update && apt-get -q -y install && apt-get clean && apt-get autoremove && rm -rf /var/lib/apt 0.0s**
** => [3/4] RUN apt-get -q -y update && apt-get -q -y install libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev:arm64 && 235.0s**
** => [4/4] WORKDIR /home/torizon/app 0.1s **
** => exporting to image 2.4s **
** => => exporting layers 2.3s **
** => => writing image sha256:a85adb70ef8720b1b3a7b59c1fc6843be4aaed3f38b87c8bf70b6658f91cf19e 0.0s **
** => => naming to Docker Hub Container Image Library | App Containerization 0.0s **


** 2 warnings found (use docker --debug to expand):**
** - NoEmptyContinuation: Empty continuation line (line 42)**
** - InvalidDefaultArgInFrom: Default value for ARG torizon/debian-cross-toolchain-${IMAGE_ARCH}:${CROSS_SDK_BASE_TAG} results in empty or invalid base image name (line 16)**
** * Terminal will be reused by tasks, press any key to close it. **

** * Executing task: make ARCH=arm64 makedir **

** * Terminal will be reused by tasks, press any key to close it. **

** * Executing task: DOCKER_HOST= docker run --rm -v /home/gaurav-c/tiscamera5:/home/torizon/app cross-toolchain-arm64-tiscam5 make ARCH=arm64 CC=aarch64-linux-gnu-g++ debug **

aarch64-linux-gnu-g++ -Iincludes/ -Icrow/include -Iboost_1_81_0 -I/usr/include -I/usr/include/gstreamer-1.0/gst/app -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include -pthread -I/usr/include/aarch64-linux-gnu -c -g -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include -pthread -I/usr/include/aarch64-linux-gnu -o build-arm64/debug/main.o src/main.cpp
**aarch64-linux-gnu-g++ -Iincludes/ -Icrow/include -Iboost_1_81_0 -I/usr/include -I/usr/include/gstreamer-1.0/gst/app -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include -pthread -I/usr/include/aarch64-linux-gnu -g -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/aarch64-linux-gnu/glib-2.0/include -pthread -I/usr/include/aarch64-linux-gnu build-arm64/debug/main.o -o build-arm64/debug/tiscamera5 -L/usr/lib/aarch64-linux-gnu -lgstapp-1.0 -lgstbase-1.0 -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 **
/usr/lib/gcc-cross/aarch64-linux-gnu/12/…/…/…/…/aarch64-linux-gnu/bin/ld: cannot find -lgstapp-1.0: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [Makefile:47: build-arm64/debug/tiscamera5] Error 1

** * The terminal process “/usr/bin/bash ‘-c’, ‘DOCKER_HOST= docker run --rm -v /home/gaurav-c/tiscamera5:/home/torizon/app cross-toolchain-arm64-tiscam5 make ARCH=arm64 CC=aarch64-linux-gnu-g++ debug’” terminated with exit code: 2. **
** * Terminal will be reused by tasks, press any key to close it. **

METHOD - 2

# automate for torizonPackages.json
RUN apt-get -q -y update && *
** apt-get -q -y install *

# DO NOT REMOVE THIS LABEL: this is used for VS Code automation
** # torizon_packages_build_start**
** libgstreamer1.0-dev:arm64 **
** libgstreamer-plugins-base1.0-dev:arm64 **
** # torizon_packages_build_end**
# DO NOT REMOVE THIS LABEL: this is used for VS Code automation
** && **
** apt-get clean && apt-get autoremove && **
** rm -rf /var/lib/apt/lists/***

** * Executing task: pwsh -nop .conf/validateDepsRunning.ps1 **

:warning: VALIDATING ENVIRONMENT

:white_check_mark: Environment is valid!

** * Terminal will be reused by tasks, press any key to close it. **

** * Executing task: bash -c [[ ! -z “10.20.24.106” ]] && true || false **

** * Terminal will be reused by tasks, press any key to close it. **

** * Executing task: bash -c [[ “aarch64” == “aarch64” ]] && true || false **

** * Terminal will be reused by tasks, press any key to close it. **

** * Executing task: sleep 1 **

** * Terminal will be reused by tasks, press any key to close it. **

** * Executing task: sshpass -p neogen scp -P 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no /home/gaurav-c/tiscamera5/docker-compose.yml torizon@10.20.24.106:~/ **

Warning: Permanently added ‘10.20.24.106’ (ED25519) to the list of known hosts.
** * Terminal will be reused by tasks, press any key to close it. **

** * Executing task: DOCKER_HOST=10.20.24.106:2375 docker image prune -f --filter=dangling=true **

Total reclaimed space: 0B
** * Terminal will be reused by tasks, press any key to close it. **

** * Executing task: docker compose -p torizon stop tiscam5 tiscam5-debug && docker compose -p torizon rm -f tiscam5 tiscam5-debug **

No stopped containers
** * Terminal will be reused by tasks, press any key to close it. **

** * Executing task: pwsh -nop /home/gaurav-c/tiscamera5/.conf/torizonPackages.ps1 arm64 **

Applying torizonPackages.json …
Applying to Dockerfile.debug …
:white_check_mark: Dockerfile.debug
Applying to Dockerfile.sdk …
:white_check_mark: Dockerfile.sdk
Applying to Dockerfile …
:white_check_mark: Dockerfile
torizonPackages.json applied
** * Terminal will be reused by tasks, press any key to close it. **

** * Executing task: DOCKER_HOST= docker build --pull -f /home/gaurav-c/tiscamera5/Dockerfile.sdk /home/gaurav-c/tiscamera5 -t cross-toolchain-arm64-tiscam5 --build-arg IMAGE_ARCH=arm64 --build-arg GPU=-imx8 --build-arg APP_ROOT=/home/torizon/app **

[+] Building 7.0s (6/7) docker:default
** => [internal] load build definition from Dockerfile.sdk 0.0s**
** => => transferring dockerfile: 1.15kB 0.0s**
** => WARN: InvalidDefaultArgInFrom: Default value for ARG torizon/debian-cross-toolchain-${IMAGE_ARCH}:${CROSS_SDK_BASE_TAG} results in empty or 0.0s**
** => [internal] load metadata for docker.io/torizon/debian-cross-toolchain-arm64:3.2.0 1.8s**
** => [internal] load .dockerignore 0.0s**
** => => transferring context: 56B 0.0s**
** => [1/4] FROM docker.io/torizon/debian-cross-toolchain-arm64:3.2.0@sha256:0c1389af168fab4942b68525591c8ff0722f40d3f10a6b92b4c2ad9660cf12b6 0.0s**
** => CACHED [2/4] RUN apt-get -q -y update && apt-get -q -y install && apt-get clean && apt-get autoremove && rm -rf /var/lib/apt 0.0s**
** => ERROR [3/4] RUN apt-get -q -y update && apt-get -q -y install libgstreamer1.0-dev:arm64 libgstreamer-plugins-base1.0-dev:arm64 5.1s**
**------ **
** > [3/4] RUN apt-get -q -y update && apt-get -q -y install libgstreamer1.0-dev:arm64 libgstreamer-plugins-base1.0-dev:arm64 && apt-get clean && apt-get autoremove && rm -rf /var/lib/apt/lists/*: **
**0.695 Get:1 Index of /debian bookworm InRelease [151 kB] **
**0.849 Get:2 Index of /debian bookworm-updates InRelease [55.4 kB] **
**0.888 Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB] **
0.902 Get:4 Index of /debian bookworm/main amd64 Packages [8792 kB]
1.097 Get:5 Index of /debian bookworm/main arm64 Packages [8693 kB]
1.130 Get:6 Index of /debian/snapshots/20240227T131454Z testing InRelease [15.1 kB]
1.255 Get:7 Index of /debian bookworm-updates/main amd64 Packages [13.5 kB]
1.311 Get:8 Index of /debian bookworm-updates/main arm64 Packages [13.3 kB]
1.419 Get:9 Index of /debian/snapshots/20240227T131454Z testing/non-free arm64 Packages [5573 B]
1.516 Get:10 http://deb.debian.org/debian-security bookworm-security/main arm64 Packages [242 kB]
1.554 Get:11 Index of /debian/snapshots/20240227T131454Z testing/main arm64 Packages [59.9 kB]
2.097 Get:12 http://deb.debian.org/debian-security bookworm-security/main amd64 Packages [246 kB]
2.883 Fetched 18.3 MB in 3s (6800 kB/s)
2.883 Reading package lists…
3.725 Reading package lists…
4.562 Building dependency tree…
4.775 Reading state information…
4.930 Some packages could not be installed. This may mean that you have
4.930 requested an impossible situation or if you are using the unstable
4.930 distribution that some required packages have not yet been created
4.930 or been moved out of Incoming.
4.930 The following information may help to resolve the situation:
**4.930 **
4.930 The following packages have unmet dependencies:
5.016 libdrm-amdgpu1:arm64 : Depends: libdrm2:arm64 (>= 2.4.108) but it is not going to be installed
5.016 libdrm-dev:arm64 : Depends: libdrm2:arm64 (= 2.4.109-2+toradex2) but it is not going to be installed
5.016 libdrm-etnaviv1:arm64 : Depends: libdrm2:arm64 (>= 2.4.108) but it is not going to be installed
5.016 libdrm-freedreno1:arm64 : Depends: libdrm2:arm64 (>= 2.4.108) but it is not going to be installed
5.016 libdrm-nouveau2:arm64 : Depends: libdrm2:arm64 (>= 2.4.108) but it is not going to be installed
5.016 libdrm-radeon1:arm64 : Depends: libdrm2:arm64 (>= 2.4.108) but it is not going to be installed
5.016 libdrm-tegra0:arm64 : Depends: libdrm2:arm64 (>= 2.4.108) but it is not going to be installed
5.016 libdrm-vivante1:arm64 : Depends: libdrm2:arm64 (>= 2.4.38) but it is not going to be installed
5.016 libegl-dev:arm64 : Depends: libegl1:arm64 (= 1.6.0-1)
5.016 Depends: libgl-dev:arm64
5.016 libgbm1:arm64 : Depends: libdrm2:arm64 (>= 2.4.75) but it is not going to be installed
5.016 libgles-dev:arm64 : Depends: libgl-dev:arm64
5.016 libgstreamer-gl1.0-0:arm64 : Depends: libdrm2:arm64 (>= 2.4.17) but it is not going to be installed
5.016 Depends: libegl1:arm64
5.016 libgstreamer-plugins-base1.0-dev:arm64 : Depends: libgl-dev:arm64
5.023 E: Unable to correct problems, you have held broken packages.
------

** 1 warning found (use docker --debug to expand):**
** - InvalidDefaultArgInFrom: Default value for ARG torizon/debian-cross-toolchain-${IMAGE_ARCH}:${CROSS_SDK_BASE_TAG} results in empty or invalid base image name (line 16)**
Dockerfile.sdk:31
--------------------
** 30 | # automate for torizonPackages.json**
** 31 | >>> RUN apt-get -q -y update && **
** 32 | >>> apt-get -q -y install **
** 33 | >>> # DO NOT REMOVE THIS LABEL: this is used for VS Code automation**
** 34 | >>> # torizon_packages_build_start**
** 35 | >>> libgstreamer1.0-dev:arm64 **
** 36 | >>> libgstreamer-plugins-base1.0-dev:arm64 **
** 37 | >>> # torizon_packages_build_end**
** 38 | >>> # DO NOT REMOVE THIS LABEL: this is used for VS Code automation**
** 39 | >>> && **
** 40 | >>> apt-get clean && apt-get autoremove && **
** 41 | >>> rm -rf /var/lib/apt/lists/***
** 42 | **
--------------------
ERROR: failed to solve: process “/bin/sh -c apt-get -q -y update && apt-get -q -y install \t libgstreamer1.0-dev:arm64 \t libgstreamer-plugins-base1.0-dev:arm64 && apt-get clean && apt-get autoremove && rm -rf /var/lib/apt/lists/*” did not complete successfully: exit code: 100

** * The terminal process “/usr/bin/bash ‘-c’, ‘DOCKER_HOST= docker build --pull -f /home/gaurav-c/tiscamera5/Dockerfile.sdk /home/gaurav-c/tiscamera5 -t cross-toolchain-arm64-tiscam5 --build-arg IMAGE_ARCH=arm64 --build-arg GPU=-imx8 --build-arg APP_ROOT=/home/torizon/app’” terminated with exit code: 1. **
** * Terminal will be reused by tasks, press any key to close it.**

I have also tried adding libdrm2 but unfortunately it did not fix the issue and I’ve created a new project having nothing just sample makefile project.

Thanks,
Gaurav

but was getting unmet dependencies error.

These dependency errors are probably due to the mismatch between packages coming from Debian and the packages that are specifically meant for i.MX. This is because NXP provides alternative versions of packages for things like gstreamer so that it can make use of the hardware features of their SoCs. But, these alternative packages aren’t always compatible with the packages that come from the standard Debian feeds.

What might help is this example here: torizon-samples/vpu/generic/vpuGeneric at bookworm-new · toradex/torizon-samples · GitHub

See the Dockerfile. In the “BUILD” stage of the Dockerfile we pin a certain version of the Debian package feed that is more compatible with the versions of packages that come from NXP.

As a warning, this example was made for Torizon OS 6.X. I see you’re using Torizon 7.X, which means there might be some issues when trying to apply this example. We do have it on our to-do list to update this for Torizon 7.X, but we haven’t gotten to it yet. That said, it might still be worth a try.

Best Regards,
Jeremias