Help with Coral TPU setup!

CancunManny

New Member
Dec 30, 2023
18
0
1
So like a dummy I created this issue for me unnecessarily, and I was actually sober during all the mistakes I made.

I have a small server running Proxmox. I run two VMs (OPNsense and Homeassistant) which currently are working correctly. I then have a LXC container to run Frigate, which uses the Coral TPU. Everything was running great! I was even able to upgrade to the new version of Frigate without an issue.

Last night I was messing with the Frigate config file to get an ESP32 Cam working. At some point frigate wouldn't start, so figured I would just do a restore from backup. That made things worse as at one point the other two VMs wouldn't start up. I did noticed something about 97% of the space being used up. Turns out when I installed the LXC container I didn't install it on the actual server. My goal was to have ONLY backups stored on my share drive (on my regular PC), but everything else running on the server.

I cleared some space from my main computer, mainly deleting some backups I had stored. Once I had more HD space everything booted up as expected on proxmox. At this point I still wasn't aware that the LXC container was actually installed on my regular computer. Since I saw everything was up and running fine on Proxmox I figured it would be wise for me to delete EVERYTHING on my netshare. I thought I was only deleting backup stuff, and since everything was running ok, I could just do new backups and that would be that.

I did delete a large file that said something about raw (my lxc basically). Once I deleted and emptied trash frigate wouldn't run. Looking into the issue is how I found out that I had actually installed the LXC container on my computer and not the server. That was my first HUGE misake.

I figured no big deal, I would just delete the LXC container and start a new one. This is where I made the other HUGE mistake. Since I already had frigate working with the Coral TPU I didn't have to mess with it again at the node level. I should have just created the new LXC, install frigate on it, and with my frigate config file I should have had access to the Coral TPU. Well without thinking about it, I started doing the steps to re configure the Coral TPU.

I followed these instructions https://coral.ai/docs/m2/get-started/#2a-on-linux

The first step was to run uname -r and if 4.19 or higher I had to run lsmod | grep apex and I should have gotten nothing, but I got something, so I had to follow extra steps of creating a blacklist file, etc. I did all that, and finally was able to run ls /dev/apex_0 and get the expected result of /dev/apex_0

So I continued with the instructions, which is to run "sudo apt-get install python3-pycoral"

but this is my output:
```
Linux proxmox 6.8.12-2-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-2 (2024-09-05T10:03Z) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Oct 7 18:31:35 EST 2024 on pts/0
root@proxmox:~# sudo apt-get install python3-pycoral
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
python3-pycoral : Depends: python3-tflite-runtime (= 2.5.0.post1) but it is not going to be installed
Depends: python3 (< 3.10) but 3.11.2-1+b1 is to be installed
E: Unable to correct problems, you have held broken packages.
root@proxmox:~#
```

I then try to force a lower python (I had 3.11.2)

I installed pyenv, and when i run pyenv versions I get this:

```
root@proxmox:~# pyenv versions
system
3.8.10
* 3.9.20 (set by /root/.python-version)
root@proxmox:~#

```

but when I run python versions I get this:

```
root@proxmox:~# python version
/root/.pyenv/versions/3.9.20/bin/python: can't open file '/root/version': [Errno 2] No such file or directory
root@proxmox:~#
```

At this point I figured it doesn't make sense to keep messing with things until someone that knows what they are doing can point me in the right direction.

As it stands. If I block the cpu coral from the frigate config file, frigate starts up, none of the cameras show, but the system doesn't crash, and I am able to see the system metrics where it shows the cpu is doing the detect. If I include the coral config part as I had it before, when i restart frigate I can't get into the system metrics page, and the system keeps crashing.

So here are my questions. Since I did have the coral tpu working, it should mean that I already have the python3-pycoral drivers installed right? Those go at the node level, not the LXC, so me deleting the LXC shouldn't have affected it. Or would me creating the the blacklist and running the other commands before python3-pycoral have messed with those settings? Basically how could I check if I have the correct drivers or not?

At this point not sure if the issue is with my Frigate configuration overall or with proxmox node
 
So now that I read a bit more carefully, I think I never should have run the commands to install the coral tpu on the actual node. What I call the node is the shell of Proxmox (the server)

1728346412102.png

I think I should have been running the commands in the LXC console instead, am I right?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!