frigate: [Bug]: [OpenVino:] Intel compute runtime required for Frigate

Discussed in https://github.com/blakeblackshear/frigate/discussions/12260

<div type='discussions-op-text'>

Originally posted by Redsandro July 2, 2024

Describe the problem you are having

When starting from scratch:

  • new hardware
  • latest Proxmox 8.2
  • latest Ubuntu 24.04 LXC
  • latest Frigate 0.14.0-beta3

… the OpenVino detector does not work with the Intel iGPU until the latest Intel Compute Runtime is installed inside the Frigate container:

docker exec -ti frigate bash
cd $(mktemp -d)

wget https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.16900.23/intel-igc-core_1.0.16900.23_amd64.deb
wget https://github.com/intel/intel-graphics-compiler/releases/download/igc-1.0.16900.23/intel-igc-opencl_1.0.16900.23_amd64.deb
wget https://github.com/intel/compute-runtime/releases/download/24.22.29735.20/intel-level-zero-gpu_1.3.29735.20_amd64.deb
wget https://github.com/intel/compute-runtime/releases/download/24.22.29735.20/intel-opencl-icd_24.22.29735.20_amd64.deb
wget https://github.com/intel/compute-runtime/releases/download/24.22.29735.20/libigdgmm12_22.3.19_amd64.deb

dpkg -i *.deb

I am aware that none of the maintainers use OpenVino. The problem and the solution have been observed by myself and at least one other person.

If I understand correctly, Intel Compute is a dependency for OpenVino in Frigate, and it needs to be updated to the latest version in order to use the latest kernel.

I did a search and believe this is not being tracked as a bug yet. My apologies if I missed something.

Steps to reproduce

  1. Freshen your image (i.e. docker compose down && docker compose up -d)
  2. Observe crash (e.g. docker compose logs -f --tail=100) [GPU] Context was not initialized for 0 device
  3. Change detector device to CPU in config
  4. Bring up new config (e.g. docker compose restart)
  5. Observe no crash
  6. Install latest Intel Compute Runtime (see above)
  7. Change detector device back to GPU in config
  8. Bring up new config (e.g. docker compose restart)
  9. Observe no crash

Version

0.14.0-beta3

Frigate config file

# https://docs.frigate.video/configuration/detectors
detectors:
  ov:
    type: openvino
    device: GPU
    model:
      path: /openvino-model/ssdlite_mobilenet_v2.xml

model:
  width: 300
  height: 300
  input_tensor: nhwc
  input_pixel_format: bgr
  labelmap_path: /openvino-model/coco_91cl_bkgr.txt

Relevant log output

Process detector:ov:
Traceback (most recent call last):
  File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/lib/python3.9/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/frigate/frigate/object_detection.py", line 102, in run_detector
    object_detector = LocalObjectDetector(detector_config=detector_config)
  File "/opt/frigate/frigate/object_detection.py", line 53, in __init__
    self.detect_api = create_detector(detector_config)
  File "/opt/frigate/frigate/detectors/__init__.py", line 18, in create_detector
    return api(detector_config)
  File "/opt/frigate/frigate/detectors/plugins/openvino.py", line 38, in __init__
    self.interpreter = self.ov_core.compile_model(
  File "/usr/local/lib/python3.9/dist-packages/openvino/runtime/ie_api.py", line 521, in compile_model
    super().compile_model(model, device_name, {} if config is None else config),
RuntimeError: Exception from src/inference/src/cpp/core.cpp:123:
Exception from src/inference/src/dev/plugin.cpp:59:
Check 'contexts.count(device_id)' failed at src/plugins/intel_gpu/src/plugin/plugin.cpp:204:
[GPU] Context was not initialized for 0 device

Operating system

Proxmox

Install method

Docker Compose

Network connection

Wired

Camera make and model

irrelevant

Any other information that may be helpful

This is relevant for both Ubuntu 22.04 and 24.04.

Running dpkg -i *.deb above throws an error or two due to certain packages already being installed, but these can safely be ignored. Here is a fix for one package, but I didn’t use it.

Added: I thought I was creating an issue but the issue wizard redirected this back to discussions. At least it has the bug label now. 🙂 </div>

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 11
  • Comments: 27 (1 by maintainers)

Most upvoted comments

I can confirm that openvino works - thank you!

Just wanted to note that I’m not experiencing this issue anymore after a kernel update in proxmox to 6.8.12-2. I upgraded from 6.8.4-2.

No, it’s a big change that requires beta testing

Any chance of getting a patch release on 0.14 for this?

Otherwise would there be a recommended most-stable dev image to use in the meantime?

this doesn’t affect all or even a majority of users though, from what has been shared this is a bug in the proxmox kernel and we have only gotten reports of issues from users running proxmox. Also, it appears that an ENV var can be set to fix the issue and they are already working on a fix for a future kernel.

Doing changes here risk the chance that it causes problems for other users so I would not expect such a change to take place now that we are deep into the release candidate process