meta data for this page
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
vm:proxmox:lxc:google_coral [2024/12/07 21:37] – niziak | vm:proxmox:lxc:google_coral [2024/12/08 16:06] (current) – niziak | ||
---|---|---|---|
Line 11: | Line 11: | ||
</ | </ | ||
- | It needs software to run. So host or LXC must upload firmware. | + | It needs software to run. So Proxmox |
- | After successfull | + | After successful |
<code bash> | <code bash> | ||
Bus 002 Device 006: ID 18d1:9302 Google Inc. | Bus 002 Device 006: ID 18d1:9302 Google Inc. | ||
</ | </ | ||
- | Frigate contains Coral firmware and if access from LXC to USB dev is given it can init Google Coral upon startup. | + | Frigate contains Coral firmware and can init it. |
- | ===== docker-compose | + | ===== Issues to solve ===== |
+ | |||
+ | Coral: | ||
+ | * Frigate needs access to e.g.: ''/ | ||
+ | * Most solution on Internet provides workarounds: | ||
+ | * ugly and unsafe solution like:'' | ||
+ | * still unsafe using '' | ||
+ | * one time solution - like '' | ||
+ | * this solution cannot survive lots of scenarios (udev reload, usb reset, usb cable reconnect) | ||
+ | |||
+ | iGPU acceleration: | ||
+ | * Frigate needs access to ''/ | ||
+ | |||
+ | iGPU performance monitors: | ||
+ | |||
+ | |||
+ | ===== Setup ===== | ||
+ | |||
+ | ==== docker-compose ==== | ||
<file yaml docker-compose.yml> | <file yaml docker-compose.yml> | ||
+ | services: | ||
+ | frigate: | ||
+ | privileged: true # still in unpriv LXC so don't care | ||
devices: | devices: | ||
- | - / | + | - / |
- | - / | + | - / |
</ | </ | ||
- | ===== LXC config ===== | + | ==== LXC ==== |
<file ini / | <file ini / | ||
- | features: nesting=1 | + | features: |
unprivileged: | unprivileged: | ||
lxc.cgroup2.devices.allow: | lxc.cgroup2.devices.allow: | ||
Line 36: | Line 57: | ||
lxc.mount.entry: | lxc.mount.entry: | ||
lxc.mount.entry: | lxc.mount.entry: | ||
- | lxc.hook.pre-start: | ||
- | lxc.hook.pre-start: | ||
</ | </ | ||
- | In LXC shell: | + | In Frigate' |
<code bash> | <code bash> | ||
groupadd -g 11000 lxc_gpu_shares | groupadd -g 11000 lxc_gpu_shares | ||
Line 47: | Line 66: | ||
</ | </ | ||
- | Issue: | + | ==== Host ==== |
- | * '' | + | |
- | * Any further host USB reconnects / udevadm reload cause USB permisions change to default. | + | |
- | * any reinit of Coral device cause of the same device to appear on the same bus with new device ID, and new default permissions. | + | |
- | + | ||
- | Fix for issue: | + | |
- | * use udev to always set correct permissions: | + | |
On Proxmox host: | On Proxmox host: | ||
- | <file / | + | < |
- | SUBSYSTEMS==" | + | SUBSYSTEMS==" |
- | SUBSYSTEMS==" | + | SUBSYSTEMS==" |
</ | </ | ||
- | <file / | + | < |
- | KERNEL==" | + | KERNEL==" |
</ | </ | ||
Line 70: | Line 83: | ||
</ | </ | ||
+ | |||
+ | ===== ERROR: Unable to poll intel GPU stats: Failed to initialize PMU! (Permission denied) ===== | ||
+ | |||
+ | This error is " | ||
+ | Rendering on ''/ | ||
+ | Frigate wants this to show GPU usage statistics. | ||
+ | |||
+ | Reproduce in LXC: | ||
+ | <code bash> | ||
+ | # apt install intel-gpu-tools | ||
+ | # intel_gpu_top | ||
+ | Failed to initialize PMU! (Permission denied) | ||
+ | </ | ||
+ | |||
+ | Host Kernel prevents access to performance events subsystem for unprivileged users. Security level is controller by sysctl: | ||
+ | <code bash> | ||
+ | # sysctl kernel.perf_event_paranoid | ||
+ | kernel.perf_event_paranoid = 4 | ||
+ | </ | ||
+ | |||
+ | where values: | ||
+ | * '' | ||
+ | * ''> | ||
+ | * ''> | ||
+ | * ''> | ||
+ | |||
+ | <code bash> | ||
+ | sysctl --write kernel.perf_event_paranoid=NEWVALUE | ||
+ | </ | ||
+ | |||
+ | I suppose this is not possible to use unpriv LXC and enable '' | ||
+ | It works when <code bash> | ||
+ | |||
+ | When Frigate is running and performance events are accessible in LXC, command <code bash> | ||
+ | |||
+ | {{: | ||
===== references ===== | ===== references ===== |