Changes between Version 19 and Version 20 of venice/npu
- Timestamp:
- 09/10/2024 08:21:14 PM (2 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
venice/npu
v19 v20 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 an Ubuntu root filesystem:239 - update kernel to v6.10 with NPU support 238 On a Gateworks Venice board with an IMX8MP and an Ubuntu noble root filesystem: 239 - update kernel to v6.10 with NPU support (if using an older kernel) 240 240 {{{#!bash 241 241 # update kernel … … 255 255 su -l $USER 256 256 }}} 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 virtualenv257 - to avoid a lot of python dependency issues with tensorflow-lite install an older version of python using the [https://launchpad.net/%7Edeadsnakes/+archive/ubuntu/ppa deadsnakes ppa] and create a virtualenv 258 258 {{{#!bash 259 259 sudo add-apt-repository ppa:deadsnakes/ppa … … 265 265 source tflite-env/bin/activate 266 266 }}} 267 - build mesa (fork with updated teflon support for imx8mp) 267 - Note Python 3.9, 3.10, 3.11 work, 3.12 does not 268 - build mesa (22.2.0-devel fork with updated teflon support for imx8mp) 268 269 {{{#!bash 269 270 # install build deps … … 273 274 git clone https://gitlab.freedesktop.org/tomeu/mesa.git -b etnaviv-imx8mp mesa 274 275 cd mesa 275 # mesa requires meson >= 1.1.0 (newer than jammy's), pycparser >= 2.20, and mako276 # mesa requires meson (v1.1.0 or greater), pycparser (2.20 or greater), and mako 276 277 pip3 install meson pycparser mako 277 278 meson setup build -Dgallium-drivers=etnaviv -Dvulkan-drivers= -Dteflon=true 278 279 meson compile -C build # 20 mins or so on imx8mp 279 280 ldd build/src/gallium/targets/teflon/libteflon.so 280 }}} 281 - install tensorflow lite runtime 282 {{{#!bash 283 # install tensorflow lite runtime 281 cd .. 282 }}} 283 - install tensorflow lite runtime (requires python <= 2.11) 284 {{{#!bash 284 285 pip3 install tflite_runtime 285 # clone tensorflow for some examples and assets used below 286 cd 286 }}} 287 - clone tensorflow for some examples and assets used below 288 {{{#!bash 287 289 git clone https://github.com/tensorflow/tensorflow.git 288 290 }}} … … 305 307 }}} 306 308 - run tensorflow label_image example: 307 {{{#!bash 308 # we need to patch the label_image example to use tflite_runtime 309 * first we need to patch the label_image example to use tflite_runtime 310 {{{#!bash 309 311 cd ~/tensorflow 310 312 cat <<EOF | … … 334 336 EOF 335 337 patch -p1 338 }}} 339 * now we can run the label_image example: 340 {{{#!bash 336 341 # without acceleration (175.993ms on imx8mp) 337 342 python3 ~/tensorflow/tensorflow/lite/examples/python/label_image.py \