-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Initial commit for AXERA AI accelerators #20685
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
Open
ivanshi1108
wants to merge
12
commits into
blakeblackshear:dev
Choose a base branch
from
ivanshi1108:AXERA-axcl
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
7b4eaf2
Initial commit for AXERA AI accelerators
bb45483
Modify AXERA section from hardware.md
ivanshi1108 91e17e1
Change the default detection model to YOLOv9
1dee548
Modifications to the YOLOv9 object detection model:
e27a94a
Fix logical errors caused by code formatting
438df7d
The model inference time has been changed to the time displayed on th…
b4abbd7
Modify the document based on review suggestions
f134796
format code with ruff
6659b7c
Merge branch 'dev' into AXERA-axcl
ivanshi1108 2eef58a
Modify the description of AXERA in the documentation.
7933a83
Update docs/docs/configuration/object_detectors.md
ivanshi1108 acb17a7
Format code based on the results of Python Checks
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # syntax=docker/dockerfile:1.6 | ||
|
|
||
| # https://askubuntu.com/questions/972516/debian-frontend-environment-variable | ||
| ARG DEBIAN_FRONTEND=noninteractive | ||
|
|
||
| # Globally set pip break-system-packages option to avoid having to specify it every time | ||
| ARG PIP_BREAK_SYSTEM_PACKAGES=1 | ||
|
|
||
|
|
||
| FROM frigate AS frigate-axcl | ||
| ARG TARGETARCH | ||
| ARG PIP_BREAK_SYSTEM_PACKAGES | ||
|
|
||
| # Install axpyengine | ||
| RUN wget https://github.com/AXERA-TECH/pyaxengine/releases/download/0.1.3.rc1/axengine-0.1.3-py3-none-any.whl -O /axengine-0.1.3-py3-none-any.whl | ||
| RUN pip3 install -i https://mirrors.aliyun.com/pypi/simple/ /axengine-0.1.3-py3-none-any.whl \ | ||
| && rm /axengine-0.1.3-py3-none-any.whl | ||
|
|
||
| # Install axcl | ||
| RUN if [ "$TARGETARCH" = "amd64" ]; then \ | ||
| echo "Installing x86_64 version of axcl"; \ | ||
| wget https://github.com/ivanshi1108/assets/releases/download/v0.16.2/axcl_host_x86_64_V3.6.5_20250908154509_NO4973.deb -O /axcl.deb; \ | ||
| else \ | ||
| echo "Installing aarch64 version of axcl"; \ | ||
| wget https://github.com/ivanshi1108/assets/releases/download/v0.16.2/axcl_host_aarch64_V3.6.5_20250908154509_NO4973.deb -O /axcl.deb; \ | ||
| fi | ||
|
|
||
| RUN mkdir /unpack_axcl && \ | ||
| dpkg-deb -x /axcl.deb /unpack_axcl && \ | ||
| cp -R /unpack_axcl/usr/bin/axcl /usr/bin/ && \ | ||
| cp -R /unpack_axcl/usr/lib/axcl /usr/lib/ && \ | ||
| rm -rf /unpack_axcl /axcl.deb | ||
|
|
||
|
|
||
| # Install axcl ffmpeg | ||
| RUN mkdir -p /usr/lib/ffmpeg/axcl | ||
|
|
||
| RUN if [ "$TARGETARCH" = "amd64" ]; then \ | ||
| wget https://github.com/ivanshi1108/assets/releases/download/v0.16.2/ffmpeg-x64 -O /usr/lib/ffmpeg/axcl/ffmpeg && \ | ||
| wget https://github.com/ivanshi1108/assets/releases/download/v0.16.2/ffprobe-x64 -O /usr/lib/ffmpeg/axcl/ffprobe; \ | ||
| else \ | ||
| wget https://github.com/ivanshi1108/assets/releases/download/v0.16.2/ffmpeg-aarch64 -O /usr/lib/ffmpeg/axcl/ffmpeg && \ | ||
| wget https://github.com/ivanshi1108/assets/releases/download/v0.16.2/ffprobe-aarch64 -O /usr/lib/ffmpeg/axcl/ffprobe; \ | ||
| fi | ||
|
|
||
| RUN chmod +x /usr/lib/ffmpeg/axcl/ffmpeg /usr/lib/ffmpeg/axcl/ffprobe | ||
|
|
||
| # Set ldconfig path | ||
| RUN echo "/usr/lib/axcl" > /etc/ld.so.conf.d/ax.conf | ||
|
|
||
| # Set env | ||
| ENV PATH="$PATH:/usr/bin/axcl" | ||
| ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib/axcl" | ||
|
|
||
| ENTRYPOINT ["sh", "-c", "ldconfig && exec /init"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| target frigate { | ||
| dockerfile = "docker/main/Dockerfile" | ||
| platforms = ["linux/amd64", "linux/arm64"] | ||
| target = "frigate" | ||
| } | ||
|
|
||
| target axcl { | ||
| dockerfile = "docker/axcl/Dockerfile" | ||
| contexts = { | ||
| frigate = "target:frigate", | ||
| } | ||
| platforms = ["linux/amd64", "linux/arm64"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| BOARDS += axcl | ||
|
|
||
| local-axcl: version | ||
| docker buildx bake --file=docker/axcl/axcl.hcl axcl \ | ||
| --set axcl.tags=frigate:latest-axcl \ | ||
| --load | ||
|
|
||
| build-axcl: version | ||
| docker buildx bake --file=docker/axcl/axcl.hcl axcl \ | ||
| --set axcl.tags=$(IMAGE_REPO):${GITHUB_REF_NAME}-$(COMMIT_HASH)-axcl | ||
|
|
||
| push-axcl: build-axcl | ||
| docker buildx bake --file=docker/axcl/axcl.hcl axcl \ | ||
| --set axcl.tags=$(IMAGE_REPO):${GITHUB_REF_NAME}-$(COMMIT_HASH)-axcl \ | ||
| --push |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Update package list and install dependencies | ||
| sudo apt-get update | ||
| sudo apt-get install -y build-essential cmake git wget pciutils kmod udev | ||
|
|
||
| # Check if gcc-12 is needed | ||
| current_gcc_version=$(gcc --version | head -n1 | awk '{print $NF}') | ||
| gcc_major_version=$(echo $current_gcc_version | cut -d'.' -f1) | ||
|
|
||
| if [[ $gcc_major_version -lt 12 ]]; then | ||
| echo "Current GCC version ($current_gcc_version) is lower than 12, installing gcc-12..." | ||
| sudo apt-get install -y gcc-12 | ||
| sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12 | ||
| echo "GCC-12 installed and set as default" | ||
| else | ||
| echo "Current GCC version ($current_gcc_version) is sufficient, skipping GCC installation" | ||
| fi | ||
|
|
||
| # Determine architecture | ||
| arch=$(uname -m) | ||
| download_url="" | ||
|
|
||
| if [[ $arch == "x86_64" ]]; then | ||
| download_url="https://github.com/ivanshi1108/assets/releases/download/v0.16.2/axcl_host_x86_64_V3.6.5_20250908154509_NO4973.deb" | ||
| deb_file="axcl_host_x86_64_V3.6.5_20250908154509_NO4973.deb" | ||
| elif [[ $arch == "aarch64" ]]; then | ||
| download_url="https://github.com/ivanshi1108/assets/releases/download/v0.16.2/axcl_host_aarch64_V3.6.5_20250908154509_NO4973.deb" | ||
| deb_file="axcl_host_aarch64_V3.6.5_20250908154509_NO4973.deb" | ||
| else | ||
| echo "Unsupported architecture: $arch" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Download AXCL driver | ||
| echo "Downloading AXCL driver for $arch..." | ||
| wget "$download_url" -O "$deb_file" | ||
|
|
||
| if [ $? -ne 0 ]; then | ||
| echo "Failed to download AXCL driver" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Install AXCL driver | ||
| echo "Installing AXCL driver..." | ||
| sudo dpkg -i "$deb_file" | ||
|
|
||
| if [ $? -ne 0 ]; then | ||
| echo "Failed to install AXCL driver, attempting to fix dependencies..." | ||
| sudo apt-get install -f -y | ||
| sudo dpkg -i "$deb_file" | ||
|
|
||
| if [ $? -ne 0 ]; then | ||
| echo "AXCL driver installation failed" | ||
| exit 1 | ||
| fi | ||
| fi | ||
|
|
||
| # Update environment | ||
| echo "Updating environment..." | ||
| source /etc/profile | ||
|
|
||
| # Verify installation | ||
| echo "Verifying AXCL installation..." | ||
| if command -v axcl-smi &> /dev/null; then | ||
| echo "AXCL driver detected, checking AI accelerator status..." | ||
|
|
||
| axcl_output=$(axcl-smi 2>&1) | ||
| axcl_exit_code=$? | ||
|
|
||
| echo "$axcl_output" | ||
|
|
||
| if [ $axcl_exit_code -eq 0 ]; then | ||
| echo "AXCL driver installation completed successfully!" | ||
| else | ||
| echo "AXCL driver installed but no AI accelerator detected or communication failed." | ||
| echo "Please check if the AI accelerator is properly connected and powered on." | ||
| exit 1 | ||
| fi | ||
| else | ||
| echo "axcl-smi command not found. AXCL driver installation may have failed." | ||
| exit 1 | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.