OK. I will. Thank you.
One more comment, please. I am sorry for too early alarm.
I think that the latest dev works without issues now.
I realized I switched off and changed restart polisy (to None) for portainer container not for Doods :-). So, yesterday at first time I was testing Viseron together with Doods unfortunately and the issue I noticed was related to GPU’s memory (2G) utilization in my opinion.
I started new tests yesterday late afternoon and no issues nor errors as I am writing this comment.
Good day, First thank you for producing and sharing this component.
I’ve set it up adding cudda and coral and can see the stream.
However I’m getting this error:
[2021-06-17 16:35:04] [viseron.detector.edgetpu] [ERROR ] - EdgeTPU not found. Detection will run on CPU
[2021-06-17 16:35:04] [viseron.detector.edgetpu] [DEBUG ] - Error when trying to load EdgeTPU: Failed to load delegate from libedgetpu.so.1
This is a half-pcie board connected via an adaptor on a pcie1 line.
I can see the coral in the container.
root@UNRAID:/src# ls /dev/apex_0
/dev/apex_0
and the referred lib in the error log.
root@UNRAID:/src# ls /usr/lib/x86_64-linux-gnu/libedgetpu.so.1.0
/usr/lib/x86_64-linux-gnu/libedgetpu.so.1.0
This is running on Unraid.
I am using the same coral device with Frigate and it loads without error.
Has anyone come across a similar issue?
Is there a difference in specifying how to load a coral via usb and pcie?
In Frigage, for instance, you need to specify it’s a pice device:
detectors:
coral:
type: edgetpu
device: pci
frigate.edgetpu INFO : Attempting to load TPU as pci
Any guidance is much appreciate.
Thank you.
Thanks for checking out Viseron!
I am not too familiar with Unraid, but can you show me the docker run command?
Viseron first tries to load a USB device, and if that fails it tries to load a PCI device.
This might not be the best approach really, sounds a lot better to manually specify the device.
Great to hear!
I was afraid that you wouldnt be able to run Viseron at all due to low memory on the card.
If you need to free up some memory you can use the yolov4-tiny.weights
model which is a bit smaller than the default yolov4.weights
, but at the expense of accuracy
Thank you. This is my compose
viseron: # https://github.com/roflcoopter/viseron#edgetpu
container_name: viseron
image: roflcoopter/amd64-cuda-viseron:latest
restart: unless-stopped
privileged: true
hostname: UNRAID
volumes:
- /mnt/cache/appdata/cctv/viseron/config:/config
- /mnt/cache/appdata/cctv/viseron/recordings:/recordings
- /etc/localtime:/etc/localtime:ro
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
target: /tmp/cache
tmpfs:
size: '1g'
env_file: secrets/.viseron
ports:
- 8188:8888
labels:
- "com.centurylinklabs.watchtower.enable=true"
runtime: nvidia
Could you try pulling the roflcoopter/amd64-cuda-viseron:dev
tag instead?
I have done extensive work there to fix some problems with the USB EdgeTPU which i hope might solve your issues
I see.
Could you run these two commands for me while the container is running and show me the output?
docker exec -it viseron ls -lh /dev/apex_0
docker exec -it viseron id abc
thank you. see below
root@Tower:~# docker exec -it viseron ls -lh /dev/apex_0
crw------- 1 root root 120, 0 Jun 17 17:41 /dev/apex_0
root@Tower:~# docker exec -it viseron id abc
uid=99(abc) gid=100(users) groups=100(users),18(videoHD7LnsJx)
Looks like it could be a permission issue.
I dont have access to a PCI device so this is highly experimental but i pushed an attempt of a fix to roflcoopter/amd64-cuda-viseron:pci_fix
that i would need you to try out.
Please paste the full log and also the output of those two commands you just ran.
docker exec -it viseron ls -lh /dev/apex_0
docker exec -it viseron id abc
Ok run the :pci_fix and still same error. this is the output from the commands:
root@Tower:~# docker exec -it viseron ls -lh /dev/apex_0
crw------- 1 root root 120, 0 Jun 17 20:39 /dev/apex_0
root@Tower:~# docker exec -it viseron id abc
uid=99(abc) gid=100(users) groups=100(users),0(root),18(videoqWXMBwXr)
It looks odd that you have uid=99 and gid=100
What happens if you add this to your docker-compose?
environment:
- PUID=0
- PGID=0
Good day,
uid=99 and gid=100 is the normal setting in unraid.
It’s nobody:users
I tried with 0 & 0 ie root:root.
Same result. Coral doesn’t load.
Okay i might have an idea but i need you to conduct some tests for me.
Does this command also throw the same error?
docker exec -it viseron python3 -c 'import tflite_runtime.interpreter as tflite; tflite.load_delegate("libedgetpu.so.1", {"device": "pci"});'
Good day. please dont…
Im so sorry. PLEASE APOLOGISE MY INEPTITUDE.
It works fine as is
I was running Frigate concurrently. I made a change in frigate and when I restarted Frigate started throwing the same error.
I stoped Frigate.
Restarted Viseron, and the edgeTPU started.
[2021-06-18 10:59:27] [viseron.detector ] [DEBUG ] - OpenCL activated
[2021-06-18 10:59:27] [viseron.detector.edgetpu] [DEBUG ] - Using PCIe EdgeTPU
I presume only one container can use the coral.
It happens!
Great that it works, are you running as root now?
I would like to get it to work when running as non-root aswell.
You are correct that only one container can use the coral at once
I really apologise for wasting your time.
Let me test non-root and get back. couple of minutes
Ok.
No. Needs to be running as root to load.
- PGID=0
- PUID=0
I tried
- PGID=100
- PUID=99
and it wont load. i think it just needs to have those privileges.
and Im runing this image:
roflcoopter/amd64-cuda-viseron:latest
Shall I try the :dev with non-root?
Ah yes please try :dev
tag as non-root