Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Dockerfiles to be able to build for Jetpack 6 #11321

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

AndBobsYourUncle
Copy link
Contributor

@AndBobsYourUncle AndBobsYourUncle commented May 10, 2024

Spent a good day or so trying to get the base images for Jetpack 6 to be able to be used to build Frigate. Since it now is based on Ubuntu 22, that means that it also does not have Python 3.9.

So, you have to use deadsnakes, and there are a few other packages that need to have different versions installed.

Tried to make a minimal footprint, and this definitely can get cleaned up a bit and more conditionals thrown in. Wanted to get this PR up just in case others also were curious if it was possible before we actually clean it up to merge.

Successfully built using:

ARCH=arm64 BASE_IMAGE=nvcr.io/nvidia/l4t-tensorrt:r8.6.2-runtime  \
SLIM_BASE=nvcr.io/nvidia/l4t-tensorrt:r8.6.2-runtime \
TRT_BASE=nvcr.io/nvidia/tensorrt:24.04-py3 \
docker buildx bake --load --file=docker/tensorrt/trt.hcl \
  --set tensorrt.tags=frigate:latest-tensorrt-jp6 tensorrt

Container running for the first time, generating the TensorRT file:
Screenshot 2024-05-09 at 11 09 35 PM

It appears to also be using GPU:
Screenshot 2024-05-09 at 11 10 30 PM

Copy link

netlify bot commented May 10, 2024

Deploy Preview for frigate-docs canceled.

Name Link
🔨 Latest commit 3be1959
🔍 Latest deploy log https://app.netlify.com/sites/frigate-docs/deploys/663db79e47caee000843dc5c

Copy link
Sponsor Collaborator

@NickM-27 NickM-27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it should be necessary to install these packages on the main dockerfile and other scripts that are unrelated to the jetson image.

@AndBobsYourUncle
Copy link
Contributor Author

@NickM-27

I don't think it should be necessary to install these packages on the main dockerfile and other scripts that are unrelated to the jetson image.

You're right, I thought that was strange as well. However, since Jetson devices use an image that is based on Ubuntu 22.04, that means they include Python 3.10 by default. Also, Python 3.9 is simply not available to install in Ubuntu 22.04.

So, to recap:

  1. Python 3.9 is not available to install on the base layer in Jetpack 6.0 base images. Therefore, none of the other places in Docker have it available.
  2. libdc1394-22-dev is not available in Ubuntu 22.04, and instead is replaced by libdc1394-dev
  3. python3-tflite-runtime python3-pycoral cannot be installed as they were in Ubuntu 22.04, because of the Python version
  4. libprotobuf17 has been replaced by libprotobuf23 in Ubuntu 22.04
  5. The list goes on...

Do you think we should pull out Jetpack 6.0 as a fresh Docker image built from scratch? I started out building with just a change to the buld_jetson_ffmpeg.sh script, but ran into all these other problems along the way (hence why it took a whole day to get it built and working).

@AndBobsYourUncle
Copy link
Contributor Author

So, if we cannot do these changes, then perhaps I must wait for the migration to Python 3.10 for Frigate before I can use it with Jetpack 6.0?

@NickM-27
Copy link
Sponsor Collaborator

So, if we cannot do these changes, then perhaps I must wait for the migration to Python 3.10 for Frigate before I can use it with Jetpack 6.0?

seems likely, we would not want to be doing changes to the other docker images at this point in the release cycle

@AndBobsYourUncle
Copy link
Contributor Author

AndBobsYourUncle commented May 10, 2024

seems likely, we would not want to be doing changes to the other docker images at this point in the release cycle

Well, then that is a bummer. A lot of wasted work then 😅

@NickM-27
Copy link
Sponsor Collaborator

in general it is a good idea to propose an idea before spending a lot of time on it, especially for a community supported detector like Jetson which is not code-owned by the maintainers of frigate itself

@AndBobsYourUncle
Copy link
Contributor Author

in general it is a good idea to propose an idea before spending a lot of time on it, especially for a community supported detector like Jetson which is not code-owned by the maintainers of frigate itself

Not blaming you for my wasted time at all. I have my Jetson device sitting here, upgraded, and wanted to get Frigate working on it.

I'll patiently wait until Frigate gets the rest of its Docker upgraded to Python 3.10. In the meantime I'll likely just keep building this on the side so that I can at least keep running it on my machine (and for other people who also might be stuck waiting for Jetpack 6.0 support).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants