roflcoopter / viseron

Self-hosted, local only NVR and AI Computer Vision software. With features such as object detection, motion detection, face recognition and more, it gives you the power to keep an eye on your home, office or any other place you want to monitor.
MIT License
1.5k stars 154 forks source link

Failed to retrieve result for object_detector (Failed to initialize Inference Engine backend (device = GPU)) #730

Closed ghooghe closed 2 months ago

ghooghe commented 2 months ago

Hello, since I upgraded to docker version 26.0.0 / docker compose v2.25.0 I'm facing an issue with the object_detector I'm running the roflcoopter/amd64-viseron:latest image on a host 11th Gen Intel(R) Core(TM) i7-11800H with Intel Corporation TigerLake-H GT1 [UHD Graphics]

The container starts-up then I get this stack trace endlessly

2024-04-11T12:25:06.391685793Z [2024-04-11 14:25:06] [INFO    ] [viseron.core] - Viseron initialized in 4.1 seconds
viseron-1  | 2024-04-11T12:25:09.909953273Z [2024-04-11 14:25:09] [ERROR   ] [root] - Uncaught thread exception
viseron-1  | 2024-04-11T12:25:09.909973841Z Traceback (most recent call last):
viseron-1  | 2024-04-11T12:25:09.909975423Z   File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
viseron-1  | 2024-04-11T12:25:09.909976587Z     self.run()
viseron-1  | 2024-04-11T12:25:09.909977608Z   File "/usr/lib/python3.8/threading.py", line 870, in run
viseron-1  | 2024-04-11T12:25:09.909978679Z     self._target(*self._args, **self._kwargs)
viseron-1  | 2024-04-11T12:25:09.909979698Z   File "/src/viseron/domains/object_detector/__init__.py", line 402, in _object_detection
viseron-1  | 2024-04-11T12:25:09.909980786Z     objects = self.return_objects(preprocessed_frame)
viseron-1  | 2024-04-11T12:25:09.909981846Z   File "/src/viseron/components/darknet/object_detector.py", line 45, in return_objects
viseron-1  | 2024-04-11T12:25:09.909983025Z     detections = self._darknet.detect(
viseron-1  | 2024-04-11T12:25:09.909984008Z   File "/src/viseron/components/darknet/__init__.py", line 273, in detect
viseron-1  | 2024-04-11T12:25:09.909985079Z     return self._model.detect(
viseron-1  | 2024-04-11T12:25:09.909986085Z cv2.error: OpenCV(4.6.0) /tmp/opencv/modules/dnn/src/ie_ngraph.cpp:747: error: (-2:Unspecified error) in function 'initPlugin'
viseron-1  | 2024-04-11T12:25:09.909987254Z > Failed to initialize Inference Engine backend (device = GPU): Failed to create plugin /usr/local/runtime/lib/intel64/libopenvino_intel_gpu_plugin.so for device GPU
viseron-1  | 2024-04-11T12:25:09.909997251Z > Please, check your environment
viseron-1  | 2024-04-11T12:25:09.909998515Z > [CLDNN ERROR]. clGetPlatformIDs error -1001
viseron-1  | 2024-04-11T12:25:09.909999531Z > 
viseron-1  | 2024-04-11T12:25:12.729417387Z [2024-04-11 14:25:12] [ERROR   ] [viseron.components.nvr.nvr.bureau] - Failed to retrieve result for object_detector

Is there any part of the docker-compose.yml that should be updated:

services:
  viseron:
    image: roflcoopter/amd64-viseron:latest
    volumes:
      - ./viseron/recordings:/recordings
      - ./viseron/config:/config
      - /etc/localtime:/etc/localtime:ro
    restart: unless-stopped
    ports:
      - 8888:8888
    devices:
      - /dev/dri
    deploy:
      resources:
        limits:
          cpus: "8"
          memory: 4G

Any help would be much appreciated.

roflcoopter commented 2 months ago

That is odd, upgrading Docker should not affect that i believe. Maybe your drivers for the Intel GPU got updated simultaneously which is causing issues?

I am a bit behind with versions of third party dependencies, will try to upgrade stuff soon before releasing v3.0.0

ghooghe commented 2 months ago

I've just upgraded the kernel and everything is fine now, back to normal. Sorry for that, fixed by itself :sweat_smile: