[ { "kind": "text", "group": "text", "role": "query", "answer": "t0", "text": "LLM-8850 카드의 팬 소음을 줄이는 방법", "prompt": "query", "tokens": 24 }, { "kind": "text", "group": "text", "role": "doc", "id": "t0", "text": "axcl-smi로 팬 동작 상태를 낮추면 카드 쿨링팬 소음이 줄어듭니다. 온도가 오르면 다시 높일 수 있습니다.", "prompt": "document", "tokens": 44 }, { "kind": "text", "group": "text", "role": "query", "answer": "t1", "text": "윈도우에서 AXCL 드라이버 설치 후 펌웨어 로드 실패", "prompt": "query", "tokens": 27 }, { "kind": "text", "group": "text", "role": "doc", "id": "t1", "text": "Windows에서 axcl_pcie.sys를 설치한 뒤 errno 87로 펌웨어 로드가 실패하면 관리자 권한으로 pnputil /restart-device를 실행해 장치를 다시 시작하세요.", "prompt": "document", "tokens": 54 }, { "kind": "text", "group": "text", "role": "query", "answer": "t2", "text": "How do I quantize a YOLO model for the Axera NPU?", "prompt": "query", "tokens": 24 }, { "kind": "text", "group": "text", "role": "doc", "id": "t2", "text": "Pulsar2 converts an ONNX YOLO model to an axmodel; use a calibration set of a few dozen images and U8 or U16 quantization.", "prompt": "document", "tokens": 40 }, { "kind": "text", "group": "text", "role": "query", "answer": "t3", "text": "오늘 저녁 메뉴로 김치찌개 끓이는 법", "prompt": "query", "tokens": 22 }, { "kind": "text", "group": "text", "role": "doc", "id": "t3", "text": "돼지고기와 잘 익은 김치를 볶다가 물을 붓고 두부와 대파를 넣어 끓이면 김치찌개가 완성됩니다.", "prompt": "document", "tokens": 41 }, { "kind": "text", "group": "text", "role": "query", "answer": "t4", "text": "What causes the northern lights?", "prompt": "query", "tokens": 15 }, { "kind": "text", "group": "text", "role": "doc", "id": "t4", "text": "The northern lights are caused by charged particles from the sun hitting gases in Earth's upper atmosphere.", "prompt": "document", "tokens": 28 }, { "kind": "text", "group": "text", "role": "query", "answer": "t5", "text": "python function to compute cosine similarity", "prompt": "query", "tokens": 15 }, { "kind": "text", "group": "text", "role": "doc", "id": "t5", "text": "def cosine(a, b):\n return float(a @ b / (np.linalg.norm(a) * np.linalg.norm(b)))", "prompt": "document", "tokens": 42 }, { "kind": "text", "group": "text", "role": "query", "answer": "t6", "text": "서울에서 부산까지 KTX 소요 시간", "prompt": "query", "tokens": 18 }, { "kind": "text", "group": "text", "role": "doc", "id": "t6", "text": "KTX를 이용하면 서울역에서 부산역까지 보통 2시간 30분 안팎이 걸립니다.", "prompt": "document", "tokens": 33 }, { "kind": "text", "group": "text", "role": "query", "answer": "t7", "text": "PCIe 대역폭이 추론 속도에 미치는 영향", "prompt": "query", "tokens": 22 }, { "kind": "text", "group": "text", "role": "doc", "id": "t7", "text": "카드가 PCIe Gen2 x2로 연결되면 입력과 출력 텐서 전송 시간이 늘어나 작은 모델에서는 NPU 연산보다 전송이 병목이 됩니다.", "prompt": "document", "tokens": 45 }, { "kind": "text", "group": "text", "role": "query", "answer": "t8", "text": "如何在 AX650 上部署大语言模型", "prompt": "query", "tokens": 20 }, { "kind": "text", "group": "text", "role": "doc", "id": "t8", "text": "使用 pulsar2 llm_build 将模型编译为 axmodel,然后用 axllm 在 AX650 或 AXCL 加速卡上运行。", "prompt": "document", "tokens": 41 }, { "kind": "text", "group": "text", "role": "query", "answer": "t9", "text": "C++ RAII guard that restores a value on scope exit", "prompt": "query", "tokens": 21 }, { "kind": "text", "group": "text", "role": "doc", "id": "t9", "text": "struct Guard { int &ref; int saved; ~Guard() { ref = saved; } }; // restores the original value when the scope ends", "prompt": "document", "tokens": 38 }, { "kind": "text", "group": "text", "role": "query", "answer": "t10", "text": "고양이가 밤에 우는 이유", "prompt": "query", "tokens": 17 }, { "kind": "text", "group": "text", "role": "doc", "id": "t10", "text": "고양이는 발정기, 배고픔, 영역 표시, 관심을 끌고 싶을 때 밤에 큰 소리로 울 수 있습니다.", "prompt": "document", "tokens": 37 }, { "kind": "text", "group": "text", "role": "query", "answer": "t11", "text": "battery life of electric cars in winter", "prompt": "query", "tokens": 16 }, { "kind": "text", "group": "text", "role": "doc", "id": "t11", "text": "Cold weather reduces an electric car's range because the battery chemistry slows down and cabin heating draws extra power.", "prompt": "document", "tokens": 30 }, { "kind": "text", "group": "image", "role": "query", "answer": "cat", "text": "고양이 사진", "prompt": "query", "tokens": 12 }, { "kind": "image", "group": "image", "role": "doc", "id": "cat", "images": [ "cat_0.jpeg" ], "tokens": 264 }, { "kind": "image", "group": "image", "role": "doc", "id": "cat", "images": [ "cat_1.jpeg" ], "tokens": 256 }, { "kind": "image", "group": "image", "role": "doc", "id": "cat", "images": [ "cat_2.jpg" ], "tokens": 264 }, { "kind": "text", "group": "image", "role": "query", "answer": "dog", "text": "a photo of a dog", "prompt": "query", "tokens": 14 }, { "kind": "image", "group": "image", "role": "doc", "id": "dog", "images": [ "dog_0.jpeg" ], "tokens": 264 }, { "kind": "image", "group": "image", "role": "doc", "id": "dog", "images": [ "dog_1.jpg" ], "tokens": 270 }, { "kind": "image", "group": "image", "role": "doc", "id": "dog", "images": [ "dog_2.jpeg" ], "tokens": 270 }, { "kind": "text", "group": "image", "role": "query", "answer": "fox", "text": "여우 사진", "prompt": "query", "tokens": 12 }, { "kind": "image", "group": "image", "role": "doc", "id": "fox", "images": [ "fox_0.jpeg" ], "tokens": 270 }, { "kind": "image", "group": "image", "role": "doc", "id": "fox", "images": [ "fox_1.jpeg" ], "tokens": 264 }, { "kind": "image", "group": "image", "role": "doc", "id": "fox", "images": [ "fox_2.jpeg" ], "tokens": 264 }, { "kind": "text", "group": "image", "role": "query", "answer": "rabbit", "text": "a photo of a rabbit", "prompt": "query", "tokens": 14 }, { "kind": "image", "group": "image", "role": "doc", "id": "rabbit", "images": [ "rabbit_0.jpeg" ], "tokens": 264 }, { "kind": "image", "group": "image", "role": "doc", "id": "rabbit", "images": [ "rabbit_1.jpeg" ], "tokens": 260 }, { "kind": "image", "group": "image", "role": "doc", "id": "rabbit", "images": [ "rabbit_2.jpeg" ], "tokens": 260 }, { "kind": "text", "group": "audio", "role": "query", "answer": "ko_weather", "text": "오늘 서울은 오후부터 비가 내리겠고, 저녁에는 기온이 크게 떨어지겠습니다.", "prompt": "query", "tokens": 32 }, { "kind": "audio", "group": "audio", "role": "doc", "id": "ko_weather", "audios": [ "ko_weather.wav" ], "tokens": 148 }, { "kind": "text", "group": "audio", "role": "query", "answer": "ko_cooking", "text": "김치찌개는 돼지고기와 잘 익은 김치를 볶은 뒤 물을 붓고 두부를 넣어 끓입니다.", "prompt": "query", "tokens": 38 }, { "kind": "audio", "group": "audio", "role": "doc", "id": "ko_cooking", "audios": [ "ko_cooking.wav" ], "tokens": 144 }, { "kind": "text", "group": "audio", "role": "query", "answer": "ko_train", "text": "서울역에서 부산역까지 케이티엑스로 약 두 시간 반이 걸립니다.", "prompt": "query", "tokens": 28 }, { "kind": "audio", "group": "audio", "role": "doc", "id": "ko_train", "audios": [ "ko_train.wav" ], "tokens": 128 }, { "kind": "text", "group": "audio", "role": "query", "answer": "ko_cat", "text": "우리 집 고양이는 밤마다 창가에 앉아 밖을 구경합니다.", "prompt": "query", "tokens": 28 }, { "kind": "audio", "group": "audio", "role": "doc", "id": "ko_cat", "audios": [ "ko_cat.wav" ], "tokens": 107 }, { "kind": "text", "group": "audio", "role": "query", "answer": "ko_npu", "text": "이 카드는 피씨아이 익스프레스 슬롯에 꽂아서 인공지능 모델을 빠르게 실행합니다.", "prompt": "query", "tokens": 35 }, { "kind": "audio", "group": "audio", "role": "doc", "id": "ko_npu", "audios": [ "ko_npu.wav" ], "tokens": 152 }, { "kind": "text", "group": "audio", "role": "query", "answer": "en_aurora", "text": "The northern lights appear when charged particles from the sun hit the upper atmosphere.", "prompt": "query", "tokens": 24 }, { "kind": "audio", "group": "audio", "role": "doc", "id": "en_aurora", "audios": [ "en_aurora.wav" ], "tokens": 115 }, { "kind": "text", "group": "audio", "role": "query", "answer": "en_ev", "text": "Electric cars lose some of their driving range in cold winter weather.", "prompt": "query", "tokens": 22 }, { "kind": "audio", "group": "audio", "role": "doc", "id": "en_ev", "audios": [ "en_ev.wav" ], "tokens": 99 }, { "kind": "text", "group": "audio", "role": "query", "answer": "en_dog", "text": "My dog loves running on the beach and chasing the waves.", "prompt": "query", "tokens": 21 }, { "kind": "audio", "group": "audio", "role": "doc", "id": "en_dog", "audios": [ "en_dog.wav" ], "tokens": 84 }, { "kind": "text", "group": "audio", "role": "query", "answer": "en_code", "text": "To sort a list in Python, call the sorted function or the sort method.", "prompt": "query", "tokens": 25 }, { "kind": "audio", "group": "audio", "role": "doc", "id": "en_code", "audios": [ "en_code.wav" ], "tokens": 111 }, { "kind": "text", "group": "audio", "role": "query", "answer": "en_bus", "text": "The city bus stops at the station every ten minutes during rush hour.", "prompt": "query", "tokens": 23 }, { "kind": "audio", "group": "audio", "role": "doc", "id": "en_bus", "audios": [ "en_bus.wav" ], "tokens": 100 }, { "kind": "mixed", "text": "축구 훈련 중인 선수들 <|image|>", "images": [ "football.jpg" ], "prompt": "document", "tokens": 279 }, { "kind": "mixed", "text": "A red city bus <|image|> and its announcement <|audio|>", "images": [ "bus.jpg" ], "audios": [ "en_bus.wav" ], "prompt": "document", "tokens": 383 }, { "kind": "mixed", "text": "", "images": [ "ssd_horse.jpg", "dog_1.jpg" ], "tokens": 538 }, { "kind": "long", "text": "# AXCL 새 툴체인 연동 가이드\n\n[English](README_en.md) | [中文](README.md) | **한국어**\n\n> 중국어 원문 [README.md](README.md)를 번역한 문서입니다. 내용이 다르면 원문을 기준으로 합니다.\n\n이 문서는 AXCL의 기존 빌드 시스템에 새 호스트 툴체인을 연동하는 방법을 설명합니다. 예시 시나리오는 OpenWrt arm64 gcc입니다.\n\n> **팁**\n> 새 툴체인을 추가하기 전에 먼저 기존 `host=x86` 빌드를 한 번 끝까지 실행하여 정상 동작하는 기준 결과를 남겨 두는 것을 권장합니다. 그러면 이후 비교가 더 쉬워집니다.\n\n## 기존 빌드 시스템과 x86_64 예시\n\n### 참고 빌드 옵션\n\n| host 매개변수 | 설명 | 출력 디렉터리 |\n| --- | --- | --- |\n| `x86` | x86_64 | `out/axcl_linux_x86` |\n| `arm64` | aarch64 | `out/axcl_linux_arm64` |\n\n### 기존 빌드 명령\n\n| host | 빌드 명령 | 용도 |\n| --- | --- | --- |\n| `x86` | `cd build && make host=x86 clean all install -j128` | x86_64 기준 빌드 |\n| `arm64` | `cd build && make host=arm64 clean all install -j128` | 기존 arm64 빌드 |\n\n### x86_64 빌드 명령\n\n```bash\ncd build && make host=x86 clean all install -j128\n```\n\n이 단계의 목적은 간단합니다. 먼저 현재 빌드 과정이 처음부터 끝까지 정상적으로 동작하는지 확인한 다음 새 툴체인 추가를 시작합니다.\n\n### x86_64 출력 디렉터리\n\n```text\nout/axcl_linux_x86/\n├── bin/ # 실행 파일\n├── lib/ # 라이브러리 파일\n├── include/ # 헤더 파일\n├── ko/ # 커널 모듈\n└── json/ # 설정 파일\n```\n\n보충 설명:\n- x86_64의 주 출력 디렉터리는 `out/axcl_linux_x86`입니다.\n- 현재 x86_64 빌드에서 함께 생성되는 Python wheel의 출력 디렉터리는 `out/python`입니다.\n\n## 빌드 시스템 주요 흐름\n\n| 단계 | 파일 | 역할 |\n| --- | --- | --- |\n| 최상위 진입점 | `build/Makefile` | `host` 매개변수를 받아 `clean`, `all`, `install` 실행 |\n| 호스트 분기 | `build/config.mak` | `host`를 해석하여 `HOST`를 설정하고 해당하는 `*_config.mak` 파일을 로드 |\n| 사용자 공간 규칙 | `build/rules.mak` | `HOST`에 따라 해당하는 `*_rules.mak` 파일로 전달 |\n| 커널 공간 규칙 | `build/krules.mak` | `HOST`에 따라 해당하는 `*_krules.mak` 파일로 전달 |\n| 호스트 설정 디렉터리 | `build/projects/` | 각 호스트의 `config`, `rules`, `krules` 파일 보관 |\n| 3rdparty 경로 선택 | `logger/Makefile`, `protocol/proto/static.mak`, `protocol/package/Makefile`, `test/*/Makefile` 등 | 이 파일들에는 `$(ARCH)`에 따라 `3rdparty` 디렉터리를 직접 선택하는 경로가 많음 |\n\n여기서는 다음 두 변수를 구분해서 이해해야 합니다.\n- `HOST`는 전체 빌드 대상을 구분하는 데 사용되며, 출력 디렉터리 이름도 결정합니다.\n- `ARCH`는 기반 아키텍처를 나타내며, 많은 3rdparty 헤더 파일 및 라이브러리 경로 선택이 여전히 이 변수에 의존합니다.\n\nOpenWrt arm64 시나리오의 경우 첫 버전에서는 다음 구성을 사용하는 것을 권장합니다.\n\n| 변수 | 권장 값 | 설명 |\n| --- | --- | --- |\n| `HOST` | `openwrt_arm64` | 새 툴체인의 진입점과 출력 디렉터리를 구분하는 데 사용 |\n| `ARCH` | `arm64` | |\n\n## 3rdparty 처리 방식\n\n서드파티 컴포넌트는 먼저 독립적으로 빌드한 다음, 설치 결과를 아키텍처별로 `3rdparty/` 디렉터리에 넣습니다. AXCL 메인 빌드 단계에서는 주로 이렇게 미리 만들어진 산출물을 사용합니다.\n\n특수한 경우는 `ffmpeg`뿐입니다. 저장소에 이미 소스 디렉터리가 포함되어 있으며, 실제 빌드는 `3rdparty/ffmpeg/build.sh` 스크립트로 별도로 수행합니다.\n\n### 주의해야 할 3rdparty 컴포넌트\n\n| 컴포넌트 | 현재 방식 | 현재 버전 | 다운로드 주소 | 연동 참고 사항 |\n| --- | --- | --- | --- | --- |\n| `ffmpeg` | 저장소 내 소스 + 독립 빌드 스크립트 | `n7.1` | `3rdparty/ffmpeg/FFmpeg-n7.1/` | OpenWrt 연동 시 `3rdparty/ffmpeg/build.sh`의 configure 인자를 중점적으로 확인해야 함 |\n| `googletest` | 사전 빌드된 설치 결과 | `1.15.0` | `https://github.com/google/googletest/releases/tag/v1.15.0` | 기존 `arm64` 산출물을 재사용할 수 없으면 다시 사전 빌드하고 새로운 디렉터리 선택 로직을 추가해야 함 |\n| `protobuf` | 사전 빌드된 설치 결과 | `3.20.3` | `https://github.com/protocolbuffers/protobuf/releases/tag/v3.20.3` | 기존 `arm64` 산출물을 재사용할 수 없으면 다시 사전 빌드하고 새로운 디렉터리 선택 로직을 추가해야 함 |\n| `spdlog` | 사전 빌드된 설치 결과 | `1.14.1` | `https://github.com/gabime/spdlog/releases/tag/v1.14.1` | 기존 `arm64` 산출물을 재사용할 수 없으면 다시 사전 빌드하고 새로운 디렉터리 선택 로직을 추가해야 함 |\n\n## OpenWrt arm64 툴체인을 예로 든 새 툴체인 추가\n\n### 수정 및 추가해야 할 파일\n\n| 유형 | 파일 또는 디렉터리 | 필수 여부 | 설명 |\n| --- | --- | --- | --- |\n| 수정 | `build/config.mak` | 예 | `openwrt_arm64` 분기를 추가하여 최상위 make가 새 호스트를 인식하도록 함 |\n| 신규 | `build/projects/axcl_linux_openwrt_arm64_config.mak` | 예 | OpenWrt 툴체인 변수 정의 |\n| 신규 | `build/projects/axcl_linux_openwrt_arm64_rules.mak` | 예 | 사용자 공간 규칙 파일. 첫 버전에서는 arm64 템플릿을 그대로 재사용 가능 |\n| 신규 | `build/projects/axcl_linux_openwrt_arm64_krules.mak` | 예 | 커널 공간 규칙 파일. 첫 버전에서는 arm64 템플릿을 그대로 재사용 가능 |\n| 수정 | `3rdparty` | 예 | 사전 빌드 및 경로 수정 |\n\n### 템플릿 출처\n\n| 새 파일 | 권장 템플릿 |\n| --- | --- |\n| `axcl_linux_openwrt_arm64_config.mak` | `build/projects/axcl_linux_arm64_config.mak` |\n| `axcl_linux_openwrt_arm64_rules.mak` | `build/projects/axcl_linux_arm64_rules.mak` |\n| `axcl_linux_openwrt_arm64_krules.mak` | `build/projects/axcl_linux_arm64_krules.mak` |\n\n### 연동 절차\n\n| 단계 | 작업 | 설명 |\n| --- | --- | --- |\n| 1 | `cd build && make host=x86 clean all install -j128` 실행 | 먼저 정상 동작하는 x86_64 기준 결과를 확보 |\n| 2 | `build/config.mak`에 `openwrt_arm64` 분기 추가 | `make host=openwrt_arm64`에서 새 호스트를 인식할 수 있도록 함 |\n| 3 | arm64 템플릿을 복사하여 `axcl_linux_openwrt_arm64_config.mak`, `rules.mak`, `krules.mak` 추가 | 새 호스트를 위한 전체 진입점 구성 |\n| 4 | 새 `*_config.mak`에서 OpenWrt 툴체인 접두사를 설정하고 `ARCH=arm64` 유지 | 우선 툴체인 차이를 설정 파일 안에서만 처리 |\n| 5 | 3rdparty | 사전 빌드 및 경로 수정 |\n| 9 | `cd build && make host=openwrt_arm64 clean all install -j128` 실행 | 새 호스트 연동이 완료되었는지 검증 |\n| 10 | `out/axcl_linux_openwrt_arm64` 아래의 `bin`, `lib`, `include`, `ko`, `json` 확인 | 빌드 결과가 예상과 일치하는지 확인 |\n\n### OpenWrt config 파일 주요 변수\n\n| 변수 | 역할 | OpenWrt arm64 예시에서의 처리 방식 |\n| --- | --- | --- |\n| `CROSS` | 툴체인 접두사 | OpenWrt arm64 musl gcc 12.3.0에 해당하는 접두사로 변경 |\n| `CC` | C 컴파일러 | 일반적으로 `$(CROSS)gcc`에서 파생 |\n| `CPP` | C++ 컴파일러 | 일반적으로 `$(CROSS)g++`에서 파생 |\n| `LD` | 링커 | 일반적으로 `$(CROSS)ld`에서 파생 |\n| `AR` | 아카이브 도구 | 일반적으로 `$(CROSS)ar`에서 파생 |\n| `STRIP`", "prompt": "document", "tokens": 1024 }, { "kind": "long", "text": "| strip 도구 | 일반적으로 `$(CROSS)strip`에서 파생 |\n| `OBJCOPY` | objcopy 도구 | 일반적으로 `$(CROSS)objcopy`에서 파생 |\n| `ARCH` | 아키텍처 식별자 | `arm64`로 유지 |\n\n### 빌드 검증\n\n```bash\ncd build && make host=openwrt_arm64 clean all install -j128\n```\n\n### 결과 확인\n\n| 확인 항목 | 예상 결과 |\n| --- | --- |\n| 출력 루트 디렉터리 | `out/axcl_linux_openwrt_arm64` 생성 |\n| `bin` 디렉터리 | 실행 파일 출력 존재 |\n| `lib` 디렉터리 | 라이브러리 파일 출력 존재 |\n| `include` 디렉터리 | 헤더 파일 출력 존재 |\n| `ko` 디렉터리 | 현재 흐름에 드라이버 빌드가 포함된 경우 모듈 출력이 있어야 함 |\n| `json` 디렉터리 | 현재 흐름에 설정 설치가 포함된 경우 JSON 설정 출력이 있어야 함 |", "prompt": "document", "tokens": 253 }, { "kind": "long", "text": "# AXCL New Toolchain Integration Guide\n\n**English** | [中文](README.md) | [한국어](README_ko.md)\n\n> Translated from the Chinese [README.md](README.md). If the two differ, the Chinese original is authoritative.\n\nThis document explains how to integrate a new host toolchain into the existing AXCL build system. The example scenario is OpenWrt arm64 gcc.\n\n> **Tip**\n> Before adding a new toolchain, it is recommended to first run a complete build with the existing `host=x86` and keep a working baseline result. This makes later comparisons more straightforward.\n\n## Existing Build System and x86_64 Example\n\n### Reference Build Options\n\n| host parameter | Description | Output directory |\n| --- | --- | --- |\n| `x86` | x86_64 | `out/axcl_linux_x86` |\n| `arm64` | aarch64 | `out/axcl_linux_arm64` |\n\n### Existing Build Commands\n\n| host | Build command | Purpose |\n| --- | --- | --- |\n| `x86` | `cd build && make host=x86 clean all install -j128` | x86_64 baseline build |\n| `arm64` | `cd build && make host=arm64 clean all install -j128` | Existing arm64 build |\n\n### x86_64 Build Command\n\n```bash\ncd build && make host=x86 clean all install -j128\n```\n\nThe purpose of this step is simple: first confirm that the current build pipeline works end to end, then start adding the new toolchain.\n\n### x86_64 Output Directory\n\n```text\nout/axcl_linux_x86/\n├── bin/ # Executables\n├── lib/ # Libraries\n├── include/ # Header files\n├── ko/ # Kernel modules\n└── json/ # Configuration files\n```\n\nAdditional notes:\n- `out/axcl_linux_x86` is the main x86_64 output directory.\n- `out/python` is the output directory for the Python wheel that the current x86_64 build also generates.\n\n## Main Build System Flow\n\n| Stage | File | Purpose |\n| --- | --- | --- |\n| Top-level entry | `build/Makefile` | Receives the `host` parameter and runs `clean`, `all` and `install` |\n| host dispatch | `build/config.mak` | Parses `host`, sets `HOST` and loads the corresponding `*_config.mak` |\n| User-space rules | `build/rules.mak` | Forwards to the corresponding `*_rules.mak` based on `HOST` |\n| Kernel-space rules | `build/krules.mak` | Forwards to the corresponding `*_krules.mak` based on `HOST` |\n| host configuration directory | `build/projects/` | Holds the `config`, `rules` and `krules` files for each host |\n| 3rdparty path selection | `logger/Makefile`, `protocol/proto/static.mak`, `protocol/package/Makefile`, `test/*/Makefile`, etc. | Many paths in these files select the `3rdparty` directory directly by `$(ARCH)` |\n\nTwo variables here need to be considered separately:\n- `HOST` distinguishes the complete build target and also determines the output directory name.\n- `ARCH` describes the underlying architecture; many 3rdparty header and library path selections still depend on it.\n\nFor the OpenWrt arm64 scenario, the following configuration is recommended for the first version:\n\n| Variable | Recommended value | Description |\n| --- | --- | --- |\n| `HOST` | `openwrt_arm64` | Distinguishes the new toolchain's entry point and output directory |\n| `ARCH` | `arm64` | |\n\n## 3rdparty Handling\n\nThird-party components are first built independently, and their install output is then placed in the `3rdparty/` directory by architecture. The main AXCL build stage mainly consumes these prebuilt artifacts.\n\nOnly `ffmpeg` is a special case: the repository already contains its source directory, and the actual build is done separately by `3rdparty/ffmpeg/build.sh`.\n\n### 3rdparty Components to Watch\n\n| Component | Current method | Current version | Download URL | Integration notes |\n| --- | --- | --- | --- | --- |\n| `ffmpeg` | In-tree source + standalone build script | `n7.1` | `3rdparty/ffmpeg/FFmpeg-n7.1/` | When integrating OpenWrt, check the configure arguments in `3rdparty/ffmpeg/build.sh` carefully |\n| `googletest` | Prebuilt install output | `1.15.0` | `https://github.com/google/googletest/releases/tag/v1.15.0` | If the existing `arm64` artifacts cannot be reused, prebuild it again and add new directory selection logic |\n| `protobuf` | Prebuilt install output | `3.20.3` | `https://github.com/protocolbuffers/protobuf/releases/tag/v3.20.3` | If the existing `arm64` artifacts cannot be reused, prebuild it again and add new directory selection logic |\n| `spdlog` | Prebuilt install output | `1.14.1` | `https://github.com/gabime/spdlog/releases/tag/v1.14.1` | If the existing `arm64` artifacts cannot be reused, prebuild it again and add new directory selection logic |\n\n## Adding a New Toolchain, Using the OpenWrt arm64 Toolchain as an Example\n\n### Files to Modify and Add\n\n| Type | File or directory | Required | Description |\n| --- | --- | --- | --- |\n| Modify | `build/config.mak` | Yes | Add an `openwrt_arm64` branch so that the top-level make recognizes the new host |\n| Add | `build/projects/axcl_linux_openwrt_arm64_config.mak` | Yes | Defines the OpenWrt toolchain variables |\n| Add | `build/projects/axcl_linux_openwrt_arm64_rules.mak` | Yes | User-space rules file; the first", "prompt": "document", "tokens": 1024 }, { "kind": "long", "text": "version can reuse the arm64 template as is |\n| Add | `build/projects/axcl_linux_openwrt_arm64_krules.mak` | Yes | Kernel-space rules file; the first version can reuse the arm64 template as is |\n| Modify | `3rdparty` | Yes | Prebuild and modify paths |\n\n### Template Sources\n\n| New file | Recommended template |\n| --- | --- |\n| `axcl_linux_openwrt_arm64_config.mak` | `build/projects/axcl_linux_arm64_config.mak` |\n| `axcl_linux_openwrt_arm64_rules.mak` | `build/projects/axcl_linux_arm64_rules.mak` |\n| `axcl_linux_openwrt_arm64_krules.mak` | `build/projects/axcl_linux_arm64_krules.mak` |\n\n### Integration Steps\n\n| Step | Action | Description |\n| --- | --- | --- |\n| 1 | Run `cd build && make host=x86 clean all install -j128` | First obtain a working x86_64 baseline result |\n| 2 | Add an `openwrt_arm64` branch to `build/config.mak` | Lets `make host=openwrt_arm64` recognize the new host |\n| 3 | Copy the arm64 templates and add `axcl_linux_openwrt_arm64_config.mak`, `rules.mak` and `krules.mak` | Sets up a complete entry point for the new host |\n| 4 | In the new `*_config.mak`, set the OpenWrt toolchain prefix and keep `ARCH=arm64` | Confine the toolchain differences to the configuration file first |\n| 5 | 3rdparty | Prebuilding and path changes |\n| 9 | Run `cd build && make host=openwrt_arm64 clean all install -j128` | Verify that the new host is fully integrated |\n| 10 | Check `bin`, `lib`, `include`, `ko` and `json` under `out/axcl_linux_openwrt_arm64` | Confirm that the build results are as expected |\n\n### Key Variables in the OpenWrt config File\n\n| Variable | Purpose | Handling in the OpenWrt arm64 example |\n| --- | --- | --- |\n| `CROSS` | Toolchain prefix | Change to the prefix for OpenWrt arm64 musl gcc 12.3.0 |\n| `CC` | C compiler | Usually derived from `$(CROSS)gcc` |\n| `CPP` | C++ compiler | Usually derived from `$(CROSS)g++` |\n| `LD` | Linker | Usually derived from `$(CROSS)ld` |\n| `AR` | Archiver | Usually derived from `$(CROSS)ar` |\n| `STRIP` | strip tool | Usually derived from `$(CROSS)strip` |\n| `OBJCOPY` | objcopy tool | Usually derived from `$(CROSS)objcopy` |\n| `ARCH` | Architecture identifier | Keep as `arm64` |\n\n### Build Verification\n\n```bash\ncd build && make host=openwrt_arm64 clean all install -j128\n```\n\n### Result Check\n\n| Check item | Expected result |\n| --- | --- |\n| Output root directory | `out/axcl_linux_openwrt_arm64` is generated |\n| `bin` directory | Executable output is present |\n| `lib` directory | Library output is present |\n| `include` directory | Header file output is present |\n| `ko` directory | If the current flow includes the driver build, module output should be present |\n| `json` directory | If the current flow includes configuration installation, JSON configuration output should be present |", "prompt": "document", "tokens": 894 }, { "kind": "long", "text": "[English](README.md) | [中文](README_zh.md) | **한국어**\n\n> 영어 [원문](README.md)을 번역한 문서입니다. 내용이 다르면 원문을 기준으로 합니다.\n\n### 설명\n\n이 샘플 코드는 Aixin SDK 패키지에서 제공하는 IVE(Intelligent Video Analysis Engine) 모듈용으로, 고객이 IVE 관련 인터페이스를 빠르게 이해하고 올바르게 사용할 수 있도록 돕습니다.\n`axcl_sample_ive`는 이 샘플 코드로 생성되어 opt/bin 디렉터리에 있으며, 해당 인터페이스의 사용 방법을 보여 줍니다.\n\n### 사용법\n```bash\nUsage : ./axcl_sample_ive -c case_index [options]\n -d | --device_id: Device index from 0 to connected device num - 1, optional\n -c | --case_index:Calc case index, default:0\n 0-DMA.\n 1-DualPicCalc.\n 2-HysEdge and CannyEdge.\n 3-CCL.\n 4-Erode and Dilate.\n 5-Filter.\n 6-Hist and EqualizeHist.\n 7-Integ.\n 8-MagAng.\n 9-Sobel.\n 10-GMM and GMM2.\n 11-Thresh.\n 12-16bit to 8bit.\n 13-Multi Calc.\n 14-Crop and Resize.\n 15-CSC.\n 16-CropResize2.\n 17-MatMul.\n -e | --engine_choice:Choose engine id, default:0\n 0-IVE; 1-TDP; 2-VGP; 3-VPP; 4-GDC; 5-DSP; 6-NPU; 7-CPU; 8-MAU.\n For Crop and Resize case, cropimage support IVE/VGP/VPP engine, cropresize and cropresize_split_yuv support VGP/VPP engine.\n For CSC case, support TDP/VGP/VPP engine.\n For CropResize2 case, support VGP/VPP engine.\n For MatMul case, support NPU/MAU engine.\n -m | --mode_choice:Choose test mode, default:0\n For DualPicCalc case, indicate dual pictures calculation task:\n 0-add; 1-sub; 2-and; 3-or; 4-xor; 5-mse.\n For HysEdge and CannyEdge case, indicate hys edge or canny edge calculation task:\n 0-hys edge; 1-canny edge.\n For Erode and Dilate case, indicate erode or dilate calculation task:\n 0-erode; 1-dilate.\n For Hist and EqualizeHist case, indicate hist or equalize hist calculation task:\n 0-hist; 1-equalize hist.\n For GMM and GMM2 case, indicate gmm or gmm2 calculation task:\n 0-gmm; 1-gmm2.\n For Crop and Resize case, indicate cropimage, cropresize, cropresize_split_yuv calculation task:\n 0-crop image; 1-crop_resize; 2-cropresize_split_yuv.\n For CropResize2 case, indicate crop_resize2 or cropresize2_split_yuv calculation task:\n 0-crop_resize2; 1-cropresize2_split_yuv.\n -t | --type_image:Image type index refer to IVE_IMAGE_TYPE_E(IVE engine) or AX_IMG_FORMAT_E(other engine)\n Note:\n 1. For all case, both input and output image types need to be specified in the same order as the specified input and output file order.\n 2. If no type is specified, i.e. a type value of -1 is passed in, then a legal type is specified, as qualified by the API documentation.\n 3. Multiple input and output image types, separated by spaces.\n 4. For One-dimensional data (such as AX_IVE_MEM_INFO_T type data), do not require a type to be specified.\n -i | --input_files:Input image files, if there are multiple inputs, separated by spaces.\n -o | --output_files:Output image files or dir, if there are multiple outputs, separated by spaces\n Note:for DMA, Crop Resize, blob of CCL case and CropResize2 case must be specified as directory.\n -w | --width:Image width of inputs, default:1280.\n -h | --height:Image height of inputs, default:720.\n -p | --param_list:Control parameters list or file(in json data format)\n Note:\n 5. Please refer to the json file in the '/opt/data/ive/' corresponding directory of each test case.\n 6. For MagAng, Multi Calc and CSC case, no need control parameters.\n -a | --align_need:Does the width/height/stride need to be aligned automatically, default:0.\n 0-no; 1-yes.\n -? | --help:Show usage help.\n```\n\n### 예제\n\n> [!NOTE]\n>\n> - 샘플 코드는 API 데모용일 뿐이며, 실제로는 사용자 환경에 맞는 구체적인 설정 파라미터가 필요합니다.\n> - 파라미터 제한 사항은 \"42 - AX IVE API\" 문서를 참고하세요.\n> - 입력 및 출력 데이터를 담을 메모리는 사용자가 할당해야 합니다.\n> - 입력 및 출력 이미지 데이터는 사용자가 지정해야 합니다.\n> - CV마다 입력 이미지(또는 데이터)의 개수가 다를 수 있습니다.\n> - 2차원 이미지의 데이터 타입은 명확하게 정의하거나 기본값으로 두어야 합니다.\n> - 주요 파라미터는 Json 문자열 또는 Json 파일 형식입니다. /opt/data/ive/의 여러 디렉터리에 있는 .json 파일과 코드를 참고하세요.\n\n1. 도움말 표시\n ```bash\n ./axcl_sample_ive -?\n ```\n\n2. DMA 사용 예(소스 해상도: 1280 x 720, 입력/출력 타입: U8C1, Json 파일로 제어 파라미터 설정)\n ```bash\n ./axcl_sample_ive -c 0 -w 1280 -h 720 -i /opt/data/ive/common/1280x720_u8c1_gray.yuv -o /opt/data/ive/dma/ -t 0 0 -p /opt/data/ive/dma/dma.json\n ```\n\n3. MagAndAng 사용 예(소스 해상도: 1280 x 720, 입력 파라미터(grad_h, grad_v)의 데이터 타입: U16C1, 출력 파라미터(ang_output)의 데이터 타입: U8C1)\n ```bash\n ./axcl_sample_ive -c 8 -w 1280 -h 720 -i /opt/data/ive/common/1280x720_u1", "prompt": "document", "tokens": 1024 }, { "kind": "long", "text": "6c1_gray.yuv /opt/data/ive/common/1280x720_u16c1_gray_2.yuv -o /opt/data/ive/common/mag_output.bin /opt/data/ive/common/ang_output.bin -t 9 9 9 0\n ```\n\n### Json 파일의 주요 파라미터\n1. **dma.json**\n - `mode`, `x0`, `y0`, `h_seg`, `v_seg`, `elem_size`, `set_val`은 구조체 `AX_IVE_DMA_CTRL_T`에서 각각 대응하는 멤버인 `enMode`, `u16CrpX0`, `u16CrpY0`, `u8HorSegSize`, `u8VerSegRows`, `u8ElemSize`, `u64Val`의 값입니다.\n - `w_out`과 `h_out`은 각각 출력 이미지의 너비와 높이이며, DMA의 `AX_IVE_DMA_MODE_DIRECT_COPY` 모드에서만 사용합니다.\n2. **dualpics.json**\n - `x`와 `y`는 ADD CV용 구조체 `AX_IVE_ADD_CTRL_T`의 `u1q7X`와 `u1q7Y` 값입니다.\n - `mode`는 Sub CV용 구조체 `AX_IVE_SUB_CTRL_T`의 `enMode` 값입니다.\n - `mse_coef`는 MSE CV용 구조체 `AX_IVE_MSE_CTRL_T`의 `u1q15MseCoef` 값입니다.\n3. **ccl.json**\n - `mode`는 CCL CV용 구조체 `AX_IVE_CCL_CTRL_T`의 `enMode` 값입니다.\n4. **ed.json**\n - `mask`는 Erode CV용 구조체 `AX_IVE_ERODE_CTRL_T` 또는 Dilate CV용 `AX_IVE_DILATE_CTRL_T`에 있는 `au8Mask[25]`의 모든 값입니다.\n5. **filter.json**\n - `mask`는 Filter CV용 구조체 `AX_IVE_FILTER_CTRL_T`에 있는 `as6q10Mask[25]`의 모든 값입니다.\n6. **hist.json**\n - `histeq_coef`는 EqualizeHist CV용 구조체 `AX_IVE_EQUALIZE_HIST_CTRL_T`의 `u0q20HistEqualCoef` 값입니다.\n7. **integ.json**\n - `out_ctl`은 Integ CV용 구조체 `AX_IVE_INTEG_CTRL_T`의 `enOutCtrl` 값입니다.\n8. **sobel.json**\n - `mask`는 Sobel CV용 구조체 `AX_IVE_SOBEL_CTRL_T`의 `as6q10Mask[25]` 값입니다.\n9. **gmm.json**\n - `init_var`, `min_var`, `init_w`, `lr`, `bg_r`, `var_thr`, `thr`는 각각 GMM CV용 구조체 `AX_IVE_GMM_CTRL_T`의 `u14q4InitVar`, `u14q4MinVar`, `u1q10InitWeight`, `u1q7LearnRate`, `u1q7BgRatio`, `u4q4VarThr`, `u8Thr` 값입니다.\n10. **gmm2.json:**\n - `init_var`, `min_var`, `max_var`, `lr`, `bg_r`, `var_thr`, `var_thr_chk`, `ct`, `thr`는 각각 GMM2 CV용 구조체 `AX_IVE_GMM2_CTRL_T`의 `u14q4InitVar`, `u14q4MinVar`, `u14q4MaxVar`, `u1q7LearnRate`, `u1q7BgRatio`, `u4q4VarThr`, `u4q4VarThrCheck`, `s1q7CT`, `u8Thr` 값입니다.\n11. **thresh.json**\n - `mode`, `thr_l`, `thr_h`, `min_val`, `mid_val`, `max_val`은 각각 Thresh CV용 구조체 `AX_IVE_THRESH_CTRL_T`의 `enMode`, `u8LowThr`, `u8HighThr`, `u8MinVal`, `u8MidVal`, `u8MaxVal` 값입니다.\n12. **16bit_8bit.json**\n - `mode`, `gain`, `bias`는 각각 16BitTo8Bit CV용 구조체 `AX_IVE_16BIT_TO_8BIT_CTRL_T`의 `enMode`, `s1q14Gain`, `s16Bias` 값입니다.\n13. **crop_resize.json**\n - CropImage가 활성화되면 num은 구조체 `AX_IVE_CROP_IMAGE_CTRL_T`의 `u16Num` 값이고, boxs는 크롭 이미지의 배열 타입이며, 그 안의 `x`, `y`, `w`, `h`는 각각 구조체 `AX_IVE_RECT_U16_T`의 `u16X`, `u16Y`, `u16Width`, `u16Height` 값입니다.\n - CropResize 또는 CropResizeForSplitYUV 모드가 활성화되면 `num`은 구조체 `AX_IVE_CROP_RESIZE_CTRL_T`의 `u16Num` 값이고, `align0`, `align1`, `enAlign[1]`, `bcolor`, `w_out`, `h_out`은 각각 `enAlign[0]`, `enAlign[1]`, `u32BorderColor`, 출력 이미지의 `width`와 `height` 값입니다.\n14. **crop_resize2.json**\n - `num`은 구조체 `AX_IVE_CROP_IMAGE_CTRL_T`의 `u16Num` 값입니다.\n - `res_out`은 출력 이미지의 너비와 높이 배열입니다.\n - **`src_boxs`는 소스 이미지의 크롭 영역 배열이고, `dst_boxs`는 리사이즈된 이미지의 영역 배열입니다.**\n15. **matmul.json**\n - `mau_i`, `ddr_rdw`, `en_mul_res`, `en_topn_res`, `order`, `topn`은 각각 구조체 `AX_IVE_MAU_MATMUL_CTRL_T`의 `enMauId`, `s32DdrReadBandwidthLimit`, `bEnableMulRes`, `bEnableTopNRes`, `enOrder`, `s32TopN` 값입니다.\n - `type_in`은 구조체 `AX_IVE_MAU_MATMUL_INPUT_T`의 `stMatQ`와 `stMatB` 값입니다.\n - `type_mul_res`와 `type_topn_res`는 구조체 `AX_IVE_MAU_MATMUL_OUTPUT_T`의 `stMulRes`와 `sfTopNRes` 값입니다.\n - `q_shape`와 `b_shape`는 구조체 `AX_IVE_MAU_MATMUL_INPUT_T`의 `stMatQ`와 `stMatB`에 있는 `pShape` 값입니다.", "prompt": "document", "tokens": 1024 } ]