{"id":15662606,"url":"https://github.com/pinto0309/onnxruntime4raspberrypi","last_synced_at":"2025-08-30T16:33:58.387Z","repository":{"id":97173054,"uuid":"428606713","full_name":"PINTO0309/onnxruntime4raspberrypi","owner":"PINTO0309","description":"onnxruntime for RaspberryPi armv7l","archived":false,"fork":false,"pushed_at":"2021-11-25T04:38:04.000Z","size":13,"stargazers_count":23,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-06T01:46:22.349Z","etag":null,"topics":["onnx","onnxruntime","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PINTO0309.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-16T10:15:46.000Z","updated_at":"2025-04-18T05:36:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"7fbbeb10-c176-4203-b0b0-ee7c1bbe0501","html_url":"https://github.com/PINTO0309/onnxruntime4raspberrypi","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/PINTO0309/onnxruntime4raspberrypi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PINTO0309%2Fonnxruntime4raspberrypi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PINTO0309%2Fonnxruntime4raspberrypi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PINTO0309%2Fonnxruntime4raspberrypi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PINTO0309%2Fonnxruntime4raspberrypi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PINTO0309","download_url":"https://codeload.github.com/PINTO0309/onnxruntime4raspberrypi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PINTO0309%2Fonnxruntime4raspberrypi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272878214,"owners_count":25008342,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["onnx","onnxruntime","raspberry-pi"],"created_at":"2024-10-03T13:33:31.928Z","updated_at":"2025-08-30T16:33:58.322Z","avatar_url":"https://github.com/PINTO0309.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# onnxruntime4raspberrypi\n## 1. For Numpy1.19.5\n```bash\n$ wget -O onnxruntime-1.9.1-cp37-none-linux_armv7l.whl https://github.com/PINTO0309/onnxruntime4raspberrypi/releases/download/v1.9.1/onnxruntime-1.9.1-cp37-none-linux_armv7l.whl_np1195\n\n$ pip3 install onnxruntime-1.9.1-cp37-none-linux_armv7l.whl\n```\n## 2. For Numpy1.21.4\n```bash\n$ wget -O onnxruntime-1.9.1-cp37-none-linux_armv7l.whl https://github.com/PINTO0309/onnxruntime4raspberrypi/releases/download/v1.9.1/onnxruntime-1.9.1-cp37-none-linux_armv7l.whl_np1214\n\n$ pip3 install onnxruntime-1.9.1-cp37-none-linux_armv7l.whl\n```\n## 3. onnxruntime build - Cross-compile\nOn **`x86_64`** host machine.\n```bash\ngit clone -b v1.9.1 https://github.com/microsoft/onnxruntime\ncd onnxruntime\nnano cmake/CMakeLists.txt\n```\nFrom:\n```cmake\n# Enable space optimization for gcc/clang\n# Cannot use \"-ffunction-sections -fdata-sections\" if we enable bitcode (iOS)\nif (NOT MSVC AND NOT onnxruntime_ENABLE_BITCODE)\n  string(APPEND CMAKE_CXX_FLAGS \" -ffunction-sections -fdata-sections\")\n  string(APPEND CMAKE_C_FLAGS \" -ffunction-sections -fdata-sections\")\nendif()\n```\nTo:\n```cmake\n# Enable space optimization for gcc/clang\n# Cannot use \"-ffunction-sections -fdata-sections\" if we enable bitcode (iOS)\nif (NOT MSVC AND NOT onnxruntime_ENABLE_BITCODE)\n  string(APPEND CMAKE_CXX_FLAGS \" -w -ffunction-sections -fdata-sections -mfpu=neon-vfpv4 -ftree-vectorize -funsafe-math-optimizations -ftree-loop-vectorize -fomit-frame-pointer -latomic\")\n  string(APPEND CMAKE_C_FLAGS \" -w -ffunction-sections -fdata-sections -mfpu=neon-vfpv4 -ftree-vectorize -funsafe-math-optimizations -ftree-loop-vectorize -fomit-frame-pointer -latomic\")\nendif()\n```\n```bash\ndocker run --rm --privileged multiarch/qemu-user-static --reset -p yes\n\ndocker run --rm -it \\\n-v ${PWD}:/workdir \\\npinto0309/raspios_lite_armhf:2021-03-04_buster \\\n/bin/bash\n\ncd /workdir\n```\n```bash\napt update \u0026\u0026 apt upgrade -y\nmv /usr/bin/python /usr/bin/python_\nln -s /usr/bin/python3 /usr/bin/python\n\napt install -y protobuf-compiler libcurl4-openssl-dev \\\nlibatlas-base-dev git wget make python3-pip\n\npip3 install cmake numpy==1.19.5\nor\npip3 install cmake numpy==1.21.4\n\n./build.sh \\\n--config MinSizeRel \\\n--arm \\\n--enable_pybind \\\n--build_wheel \\\n--parallel $(nproc) \\\n--skip_tests\n```\n## 4. Test failed\n### v1.9.1\n- Performance improvement on ARM\n  - Added S8S8 (signed int8, signed int8) matmul kernel. This avoids extending uin8 to int16 for better performance on ARM64 without dot-product instruction\n  - Expanded GEMM udot kernel to 8x8 accumulator\n  - Added sgemm and qgemm optimized kernels for ARM64EC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinto0309%2Fonnxruntime4raspberrypi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpinto0309%2Fonnxruntime4raspberrypi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinto0309%2Fonnxruntime4raspberrypi/lists"}