Image processing with USB acceleration - all pi! ARCHIVED

Hello,

On VM:
I’ve tried multiple options. And these are my findings:

  • Google Coral USB Accelerator changes VID/PID after inicialization (weird behaviour and design by Google)
    • When plugged into usb device is recognized as Global Unichip Corp (PID:0x089a , VID:0x1a6e)
    • After initialization (calling method from libedgetpu.so.1.0) usb stick changes to Google Inc (PID:0x9302, VID:0x18d1)
  • Changes mentioned above doesn’t propagate to VM
    • Configuration XML for VM has still the PID and VID of Global Unichip Corp
    • I tried to change this via UI VMM and these two thigs happens:
      • An error shows up after clicking on OK to save changes -
        "error msg Failedd to read the USB device. Please make sure it is properly mounted on DiskStation"
      • When I try to make changes again no error is showed and everything is saved. Sometimes changes are persistent sometimes they are not (I couldn’t find more details causing this)
    • I tried do this via calling virsh attach-device this yield some changes in configuration however I still cannot see it in VM even when address of device is configured properly.
    • I tried also to change XML configuration however same result :frowning:

My hypothesis is that VMM cannot make proper passthrough for this device due to the fact that PID/VID changes.

In Docker:
I run container with these parameters (I’m using Frigate NVR in this case) on my DS918+:

docker run -d \
  --name frigate \
  --privileged \
  --restart=unless-stopped \
  --shm-size 2gb \
  --mount type=tmpfs,target=/tmp/cache,tmpfs-size=1000000000 \
  --device /dev/dri/renderD128 \
  -v /dev/bus/usb:/dev/bus/usb \
  -v /volume1/docker/frigate/config:/config:ro \
  -v /volume2/docker_data/frigate:/media/frigate:rw \
  -v /etc/localtime:/etc/localtime:ro \
  -e FRIGATE_RTSP_PASSWORD='<password>' \
  -p 5000:5000 \
  blakeblackshear/frigate:stable-amd64

I hope it helps if you would need any help with it let me know. (If I won’t be busy I will respond :smiley: )

thank you very much for sharing your findings. it will definitely run in docker.

one of my ongoing projects is a self hosted voice assistant (rhasspy). unfortunately several service options (rasa nlu, mycroft precise, mozilla deepspeach etc.) require a certain cpu feature (AVX) to run.
i was hoping to get around that requirement by adding such a TPU unit, but I am not sure if this will work, or if like the rasaNLU container still say it wont start on my cpu.

1 Like

Hi @borodom, thanks i was able to make coral usb work with synology 920+, can i know the frigate yaml file for used for hwaccel_args, thanks

1 Like