Google Coral passtrough to VM

Sjoerd

Dabbler
Joined
Feb 22, 2023
Messages
14
Hello community,

I'm using TrueNAS Scale with some virtual machines. One of my virtual machines is running Frigate.
I bought a Google Coral TPU Accelerator for object recognition, but when I try to add the USB device to the VM, it doesn't show up there.

When I run `dmesg | grep -i usb` before and after connecting, I can see that the device is connected:

```
[ 1224.895091] usb 1-7: new high-speed USB device number 9 using xhci_hcd
[ 1225.047832] usb 1-7: New USB device found, idVendor=1a6e, idProduct=089a, bcdDevice= 1.00
[ 1225.047849] usb 1-7: New USB device strings: Mfr=0, Product=0, SerialNumber=0
```

Why doesn't it show up and how can I add the Coral to the VM?
 

brahmy

Dabbler
Joined
Mar 24, 2022
Messages
13
Funny, I'm also looking at this exact issue this week.

The only way I've found to make this work is passing an entire USB controller with the PCI passthrough. Can't figure out how to make it work with just USB. The problem is that TN Scale doesn't have the drivers to recognize the device.

There is a thread about manually installing the drivers on TN Scale, but a) it's not recommended and b) for what it's worth, I couldn't get it to work with USB.

There's a poster in there using TrueCharts/Frigate who was able to make it work by passing a raw USB device i.e. /dev/bus/usb/002/005 but that doesn't work with TN Scale VMs, as far as I can figure out.

Anyway, subscribing to this post in case someone else has a solution...

Edit: More details. The only other PCI USB bus I have is integrated into my NVIDIA GPU, so I am passing the Coral TPU to the VM & Frigate docker container via that. However, I am running into a weird error on hardware acceleration and I wonder if it's because I'm trying to use the video card for its GPU and its USB bus. I don't know... I am just a guy that hacks things together!!
 
Last edited:

morganL

Captain Morgan
Administrator
Moderator
iXsystems
Joined
Mar 10, 2018
Messages
2,694
Funny, I'm also looking at this exact issue this week.

The only way I've found to make this work is passing an entire USB controller with the PCI passthrough. Can't figure out how to make it work with just USB. The problem is that TN Scale doesn't have the drivers to recognize the device.

There is a thread about manually installing the drivers on TN Scale, but a) it's not recommended and b) for what it's worth, I couldn't get it to work with USB.

There's a poster in there using TrueCharts/Frigate who was able to make it work by passing a raw USB device i.e. /dev/bus/usb/002/005 but that doesn't work with TN Scale VMs, as far as I can figure out.

Anyway, subscribing to this post in case someone else has a solution...

Edit: More details. The only other PCI USB bus I have is integrated into my NVIDIA GPU, so I am passing the Coral TPU to the VM & Frigate docker container via that. However, I am running into a weird error on hardware acceleration and I wonder if it's because I'm trying to use the video card for its GPU and its USB bus. I don't know... I am just a guy that hacks things together!!

Yes, I'd recommend passing through the whole USB controller as a pcie device.
 

Sjoerd

Dabbler
Joined
Feb 22, 2023
Messages
14
My USB controller does not show up in the PCI Passtrough menu
How can I pass the entire controller to the VM?

1690482644651.png
 

Sjoerd

Dabbler
Joined
Feb 22, 2023
Messages
14
1690652281385.png


lsusb does show the Coral (18d1:9302), but it's still not in the usb dropdown.
Specify custom with "0x18d1 / 0x9302" does not work
 

Sjoerd

Dabbler
Joined
Feb 22, 2023
Messages
14
I solved it. How?

`lspci | grep USB` > found my USB controller, pass it through to the VM (PCIe passthrough, in my case it was
00:14.0 USB controller: Intel Corporation Device 43ed (rev 11))

Now all my usb devices are listed in the VM.
 

gerjo

Cadet
Joined
Dec 13, 2023
Messages
1
My coral just arrived. I was prepared for days of debugging, alas it is much easier than that! Frigate (0.12.1_1.1.4) from the TrueNAS catalog has a checkbox under "Mount USB Bus", from thereon it worked automatically, no drivers loaded.

Screenshot shows in detail where this checkbox is located.

Screenshot 2023-12-13 at 17.38.12.png
 
Top