Taught this could help others as I found it difficult to setup !
I've been using the typical "Proxmox / LXC / Docker / Codeproject" with Coral TPU usb passthough setup but it's been unreliable (at least for me) and the boot process is pretty long. Not super usefull when used with blueiris for ai detection.
Now i've done a manual install of a fresh Debian 12 lxc and that works rock solid. Here is my deployments steps. Based on instructions I've found on a few forums.
The main issue I see with the docker setup is that it add some latency and for some reasons the connection with coral usb tpu drops from time to time. I didn't had that issue since I removed docker from the equation and it boot superfast.
# My install steps:
# Proxmox host config
groupadd -g 100000 Codeproject # Create container’s root group (100000)
# specific for Coral usb tpu
nano /etc/udev/rules.d/60-coraltpu.rules
# lxc container creation
-Create unpriviledge lxc container
-debian 12 / 4 cores / 8gb storage / 4gb ram (4 cores needed for installation, ram and cpu can be reduced after the installation is completed)
-Configure network
# On the host, run lsusb to find on what bus your coral device is (Google Inc.):
lsusb
# Modify lxc config file based on client Coral usb module selection (add the following lines)
usb0: host=1a6e:089a,usb4=1 # coral ID pre-load // replace USB4 with selection
usb1: host=18d1:9302,usb4=1 # coral ID post-load // replace USB4 with selection
lxc.mount.entry: /dev/bus/usb/004 dev/bus/usb/004 none bind,optional,create=dir # Replace USB4 with selection
## In the container
# enable ssh
sed -i /"^PermitRootLogin.*$"/d /etc/ssh/sshd_config
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
systemctl restart sshd
# Grab ip and continue the setup with ssh
ip -c -4 -brief address show
# install required packages
wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
apt update
apt upgrade
apt install unzip dotnet-sdk-7.0 sudo psmisc curl xz-utils jq
# install codeproject
wget https://www.codeproject.com/KB/Articles/5322557/codeproject.ai-server_2.6.5_Ubuntu_x64.zip
unzip codeproject.ai-server_2.6.5_Ubuntu_x64.zip
rm codeproject.ai-server_2.6.5_Ubuntu_x64.zip
dpkg -i codeproject.ai-server_2.6.5_Ubuntu_x64.deb
rm codeproject.ai-server_2.6.5_Ubuntu_x64.deb
pushd "/usr/bin/codeproject.ai-server-2.6.5/" && bash start.sh && popd
cd /usr/bin/codeproject.ai-server-2.6.5 && bash start.sh
# Go to your browser and check the logs untils the installation is done. when nothing moves anymore you can kill the process in your ssh session !
# uninstall unused modules and install Coral module (it will fail but will point you to the script to run *this will take a while - 10-15mins):
cd /usr/bin/codeproject.ai-server-2.6.5/modules/ObjectDetectionCoral && sudo bash ../../setup.sh
# I had to kill the script in the end since it was not doing anything anymore but still show up as succeed. I think these scripts definitely need some cleanup !
# Enable the cpai service (I have no idea why they didn't enable it by default during the install)
systemctl enable codeproject.ai-server
# Enable coral module autostart (set autostart value to true)
nano /usr/bin/codeproject.ai-server-2.6.5/modules/ObjectDetectionCoral/modulesettings.json
# reboot and test, no more disconnect issues like when using the docker version
20ms response time with tiny objects
I've been using the typical "Proxmox / LXC / Docker / Codeproject" with Coral TPU usb passthough setup but it's been unreliable (at least for me) and the boot process is pretty long. Not super usefull when used with blueiris for ai detection.
Now i've done a manual install of a fresh Debian 12 lxc and that works rock solid. Here is my deployments steps. Based on instructions I've found on a few forums.
The main issue I see with the docker setup is that it add some latency and for some reasons the connection with coral usb tpu drops from time to time. I didn't had that issue since I removed docker from the equation and it boot superfast.
# My install steps:
# Proxmox host config
groupadd -g 100000 Codeproject # Create container’s root group (100000)
# specific for Coral usb tpu
nano /etc/udev/rules.d/60-coraltpu.rules
Code:
SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="9302", GROUP="100000"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1a6e", ATTRS{idProduct}=="089a", GROUP="100000"
# lxc container creation
-Create unpriviledge lxc container
-debian 12 / 4 cores / 8gb storage / 4gb ram (4 cores needed for installation, ram and cpu can be reduced after the installation is completed)
-Configure network
# On the host, run lsusb to find on what bus your coral device is (Google Inc.):
lsusb
Code:
Bus 004 Device 002: ID 18d1:9302 Google Inc.
# Modify lxc config file based on client Coral usb module selection (add the following lines)
usb0: host=1a6e:089a,usb4=1 # coral ID pre-load // replace USB4 with selection
usb1: host=18d1:9302,usb4=1 # coral ID post-load // replace USB4 with selection
lxc.mount.entry: /dev/bus/usb/004 dev/bus/usb/004 none bind,optional,create=dir # Replace USB4 with selection
## In the container
# enable ssh
sed -i /"^PermitRootLogin.*$"/d /etc/ssh/sshd_config
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
systemctl restart sshd
# Grab ip and continue the setup with ssh
ip -c -4 -brief address show
# install required packages
wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
apt update
apt upgrade
apt install unzip dotnet-sdk-7.0 sudo psmisc curl xz-utils jq
# install codeproject
wget https://www.codeproject.com/KB/Articles/5322557/codeproject.ai-server_2.6.5_Ubuntu_x64.zip
unzip codeproject.ai-server_2.6.5_Ubuntu_x64.zip
rm codeproject.ai-server_2.6.5_Ubuntu_x64.zip
dpkg -i codeproject.ai-server_2.6.5_Ubuntu_x64.deb
rm codeproject.ai-server_2.6.5_Ubuntu_x64.deb
pushd "/usr/bin/codeproject.ai-server-2.6.5/" && bash start.sh && popd
cd /usr/bin/codeproject.ai-server-2.6.5 && bash start.sh
# Go to your browser and check the logs untils the installation is done. when nothing moves anymore you can kill the process in your ssh session !
# uninstall unused modules and install Coral module (it will fail but will point you to the script to run *this will take a while - 10-15mins):
cd /usr/bin/codeproject.ai-server-2.6.5/modules/ObjectDetectionCoral && sudo bash ../../setup.sh
# I had to kill the script in the end since it was not doing anything anymore but still show up as succeed. I think these scripts definitely need some cleanup !
# Enable the cpai service (I have no idea why they didn't enable it by default during the install)
systemctl enable codeproject.ai-server
# Enable coral module autostart (set autostart value to true)
nano /usr/bin/codeproject.ai-server-2.6.5/modules/ObjectDetectionCoral/modulesettings.json
# reboot and test, no more disconnect issues like when using the docker version
20ms response time with tiny objects