Changes between Version 23 and Version 24 of venice/npu
- Timestamp:
- 02/26/2026 10:39:47 PM (7 weeks ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
venice/npu
v23 v24 232 232 233 233 == Upstream / Mainline NPU support (via Mesa) 234 234 235 The IMX8MP has a Verisilicon NPU which is from Vivante. Vivante supports this via their vivante driver (/dev/galcore) but that is not an opensource driver so it would make sense to want to support the NPU with it's opensource equivalent (etnaviv driver). Support for this has been added to the Linux 6.10 kernel. 235 236 … … 241 242 242 243 243 On a Gateworks Venice board with an IMX8MP and an Ubuntu noble root filesystem: 244 - update kernel to v6.10 with NPU support (if using an older kernel) 245 {{{#!bash 246 # update kernel 247 cd /tmp && wget https://dev.gateworks.com/venice/kernel/linux-venice-6.10.6.tar.xz && tar -C / -xvf linux*.tar.xz --keep-directory-symlink && reboot 248 }}} 249 - create a non-root user (always a good idea but not required for mesa) 244 Requirements: 245 * Gateworks Venice board with an IMX8MP and an Ubuntu noble root filesystem with a 6.10 or newer kernel 246 247 - Create a non-root user (always a good idea but not required for mesa) 250 248 {{{#!bash 251 249 # create user … … 260 258 su -l $USER 261 259 }}} 262 - 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 virtualenv260 - 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 263 261 {{{#!bash 264 262 sudo add-apt-repository ppa:deadsnakes/ppa … … 271 269 }}} 272 270 - Note Python 3.9, 3.10, 3.11 work, 3.12 does not 273 - build mesa (22.2.0-devel fork with updated teflon support for imx8mp)271 - Build mesa (22.2.0-devel fork with updated teflon support for imx8mp) 274 272 {{{#!bash 275 273 # install build deps … … 287 285 cd .. 288 286 }}} 289 - install tensorflow lite runtime (requires python <= 2.11)287 - Install tensorflow lite runtime (requires python <= 2.11) 290 288 {{{#!bash 291 289 pip3 install tflite_runtime 292 290 }}} 293 - clone tensorflow for some examples and assets used below291 - Clone tensorflow for some examples and assets used below 294 292 {{{#!bash 295 293 git clone https://github.com/tensorflow/tensorflow.git 296 294 }}} 297 - run teflon image classification test298 {{{#!bash 299 # note this test requires python pillow, python numpy<2.0 and write access to /dev/dri/renderD128295 - Run teflon image classification test 296 {{{#!bash 297 # Note this test requires python pillow, python numpy<2.0 and write access to /dev/dri/renderD128 300 298 pip3 install "numpy<2.0" pillow 301 299 groups # make sure your in the render group (or have write access to /dev/dri/renderD128) … … 312 310 -e ~/mesa/build/src/gallium/targets/teflon/libteflon.so 313 311 }}} 314 - run tensorflow label_image example: 315 * first we need to patch the label_image example to use tflite_runtime 316 {{{#!bash 317 cd ~/tensorflow 318 cat <<EOF | 312 - Run tensorflow label_image example: 313 * First we need to patch the label_image example to use tflite_runtime. Use a text editor like vi to edit the file ~/tensorflow/tensorflow/lite/examples/python/label_image.py per the patch changes below: 314 {{{#!bash 319 315 diff --git a/tensorflow/lite/examples/python/label_image.py b/tensorflow/lite/examples/python/label_image.py 320 316 index d26454f921f..08c65962bf1 100644 … … 340 336 num_threads=args.num_threads) 341 337 342 EOF 343 patch -p1 344 }}} 345 * now we can run the label_image example: 338 339 }}} 340 * Now we can run the label_image example: 346 341 {{{#!bash 347 342 # without acceleration (175.993ms on imx8mp) … … 350 345 -l ~/mesa/src/gallium/frontends/teflon/tests/labels_mobilenet_quant_v1_224.txt \ 351 346 -i ~/tensorflow/tensorflow/lite/examples/label_image/testdata/grace_hopper.bmp 347 0.874510: military uniform 348 0.031373: Windsor tie 349 0.015686: mortarboard 350 0.011765: bulletproof vest 351 0.007843: bow tie 352 time: 176.267ms 353 352 354 # with acceleration (14.138ms on imx8mp) 353 355 python3 ~/tensorflow/tensorflow/lite/examples/python/label_image.py \ … … 356 358 -i ~/tensorflow/tensorflow/lite/examples/label_image/testdata/grace_hopper.bmp \ 357 359 -e ~/mesa/build/src/gallium/targets/teflon/libteflon.so 360 Loading external delegate from /root/mesa/build/src/gallium/targets/teflon/libteflon.so with args: {} 361 0.870588: military uniform 362 0.031373: Windsor tie 363 0.011765: mortarboard 364 0.007843: bow tie 365 0.007843: bulletproof vest 366 time: 14.234ms 367 358 368 }}} 359 369
