Changes between Version 18 and Version 19 of venice/npu
- Timestamp:
- 08/19/2024 11:10:36 PM (9 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
venice/npu
v18 v19 236 236 Therefore to support the NPU you need to build a custom fork of mesa that is being worked on by [https://blog.tomeuvizoso.net/ Tomeu Vizoso] with the work being sponsored by [https://ideasonboard.com/ Ideas On board]. 237 237 238 On a Gateworks Venice board with an IMX8MP and Ubuntu 22.04 (jammy)root filesystem:238 On a Gateworks Venice board with an IMX8MP and an Ubuntu root filesystem: 239 239 - update kernel to v6.10 with NPU support 240 240 {{{#!bash … … 255 255 su -l $USER 256 256 }}} 257 - install python virtualenv which allows us to prevent conflicts between package libraries 258 {{{#!bash 259 sudo apt update && sudo apt upgrade -y && sudo apt install -y python3-pip python3-venv 260 # create tflite1-env" virtualenv 261 python3 -m venv tflite1-env 257 - to avoid a lot of python dependency issues with tensorflow-lite install an older version of python (python3.9) using the [https://launchpad.net/%7Edeadsnakes/+archive/ubuntu/ppa deadsnakes ppa] and create a virtualenv 258 {{{#!bash 259 sudo add-apt-repository ppa:deadsnakes/ppa 260 sudo apt update 261 sudo apt install -y python3.9 python3.9-venv 262 # create tflite-env virtualenv 263 python3.9 -m venv tflite-env 262 264 # activate the venv (repeat or every new shell) 263 source tflite 1-env/bin/activate265 source tflite-env/bin/activate 264 266 }}} 265 267 - build mesa (fork with updated teflon support for imx8mp) … … 273 275 # mesa requires meson >= 1.1.0 (newer than jammy's), pycparser >= 2.20, and mako 274 276 pip3 install meson pycparser mako 275 ~/tflite1-env/bin/meson setup build -Dgallium-drivers=etnaviv -Dvulkan-drivers= -Dteflon=true276 ~/tflite1-env/bin/meson compile -C build # 20 mins or so on imx8mp277 meson setup build -Dgallium-drivers=etnaviv -Dvulkan-drivers= -Dteflon=true 278 meson compile -C build # 20 mins or so on imx8mp 277 279 ldd build/src/gallium/targets/teflon/libteflon.so 278 280 }}} … … 288 290 {{{#!bash 289 291 # note this test requires python pillow, python numpy<2.0 and write access to /dev/dri/renderD128 290 pip3 install "numpy<2.0" pillow tflite_runtime # tflite_runtime requires pillow as well as numpy<2292 pip3 install "numpy<2.0" pillow 291 293 groups # make sure your in the render group (or have write access to /dev/dri/renderD128) 292 294 # without teflon (175.335ms on imx8mp) … … 333 335 patch -p1 334 336 # without acceleration (175.993ms on imx8mp) 335 python3 ~/tensorflow/ lite/examples/python/label_image.py \337 python3 ~/tensorflow/tensorflow/lite/examples/python/label_image.py \ 336 338 -m ~/mesa/src/gallium/targets/teflon/tests/mobilenet_v1_1.0_224_quant.tflite \ 337 339 -l ~/mesa/src/gallium/frontends/teflon/tests/labels_mobilenet_quant_v1_224.txt \ 338 340 -i ~/tensorflow/tensorflow/lite/examples/label_image/testdata/grace_hopper.bmp 339 341 # with acceleration (14.138ms on imx8mp) 340 python3 ~/tensorflow/ lite/examples/python/label_image.py \342 python3 ~/tensorflow/tensorflow/lite/examples/python/label_image.py \ 341 343 -m ~/mesa/src/gallium/targets/teflon/tests/mobilenet_v1_1.0_224_quant.tflite \ 342 344 -l ~/mesa/src/gallium/frontends/teflon/tests/labels_mobilenet_quant_v1_224.txt \