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:08] – 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. |
| - | ===== LXC config | + | ===== 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> | ||
| + | services: | ||
| + | frigate: | ||
| + | privileged: true # still in unpriv LXC so don't care | ||
| + | devices: | ||
| + | - / | ||
| + | - / | ||
| + | </ | ||
| + | |||
| + | ==== LXC ==== | ||
| <file ini / | <file ini / | ||
| - | features: nesting=1 | + | features: |
| unprivileged: | unprivileged: | ||
| lxc.cgroup2.devices.allow: | lxc.cgroup2.devices.allow: | ||
| Line 28: | Line 57: | ||
| lxc.mount.entry: | lxc.mount.entry: | ||
| lxc.mount.entry: | lxc.mount.entry: | ||
| - | lxc.hook.pre-start: | ||
| - | lxc.hook.pre-start: | ||
| </ | </ | ||
| - | Issues: | + | In Frigate' |
| - | * '' | + | <code bash> |
| + | groupadd -g 11000 lxc_gpu_shares | ||
| + | groupadd -g 11002 lxc_usb2_shares | ||
| + | usermod -aG lxc_gpu_shares, | ||
| + | </ | ||
| + | |||
| + | ==== Host ==== | ||
| + | |||
| + | On Proxmox host: | ||
| + | |||
| + | <file ini / | ||
| + | SUBSYSTEMS==" | ||
| + | SUBSYSTEMS==" | ||
| + | </ | ||
| + | |||
| + | <file ini / | ||
| + | KERNEL==" | ||
| + | </ | ||
| + | |||
| + | <code bash> | ||
| + | udevadm control --reload-rules && udevadm trigger | ||
| + | </ | ||
| + | |||
| + | |||
| + | ===== 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 | ||
| + | It works when <code bash> | ||
| + | |||
| + | When Frigate is running and performance events are accessible in LXC, command <code bash> | ||
| + | |||
| + | {{: | ||
| + | |||
| + | ===== references ===== | ||
| + | |||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | * [[https:// | ||
| + | #536]] | ||