Skip to content

[Detector Support]: Enabling OpenVino doesn't result in visible usage in intel_gpu_top. I don't think it's using my GPU? #9295

Description

@devedse

Describe the problem you are having

I currently have proxmox running on a small mini pc with an Intel N100 cpu. (For completeness sake I've set up SR-IOV stuff to basically split the GPU into 7 to be used by VM's and LXC containers).

When I enable hwacceleration I can see usage on my GPU by calling intel_gpu_top -d sriov:

ffmpeg:
   hwaccel_args: preset-vaapi

When I comment this section out and add the stuff for openvino I don't see any GPU usage at all:

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

I'm having the feeling that my GPU is not being used for inference, but then again, I have no idea how to check this and be 100% certain.

Version

0.12.1-367d724

Frigate config file

# ffmpeg:
#   hwaccel_args: preset-vaapi

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

cameras:
  G3Instant2:
    ffmpeg:
      inputs:
        - path: rtsps://***************
          roles:
            - detect
    detect:
      width: 1920
      height: 1080
    objects:
      track:
        - person
        - dog
        - cat
        - car
        - motorcycle
        - bird
        - bicycle
    snapshots:
      enabled: True
    record:
      enabled: True
      events:
        retain:
          default: 5


### docker-compose file or Docker CLI command

```yaml
version: '3'

services:
  frigate:
    container_name: frigate
    privileged: true # this may not be necessary for all setups
    restart: unless-stopped
    image: ghcr.io/blakeblackshear/frigate:stable
    shm_size: "640mb" # update for your cameras based on calculation above
    devices:
      #- /dev/bus/usb:/dev/bus/usb # passes the USB Coral, needs to be modified for other versions
      #- /dev/apex_0:/dev/apex_0 # passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
      - /dev/dri/renderD131:/dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /root/dockercomposers/frigate/config/config.yml:/config/config.yml
      - /root/dockercomposers/frigate/storage:/media/frigate
      - type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
        target: /tmp/cache
        tmpfs:
          size: 1000000000
    ports:
      - "5000:5000"
      - "8554:8554" # RTSP feeds
      - "8555:8555/tcp" # WebRTC over tcp
      - "8555:8555/udp" # WebRTC over udp
    environment:
      FRIGATE_RTSP_PASSWORD: ************
      #LIBVA_DRIVER_NAME: "i965"
    cap_add:
      - PERFMON

Relevant log output

frigate  | s6-rc: info: service s6rc-fdholder: starting
frigate  | s6-rc: info: service s6rc-oneshot-runner: starting
frigate  | s6-rc: info: service s6rc-fdholder successfully started
frigate  | s6-rc: info: service s6rc-oneshot-runner successfully started
frigate  | s6-rc: info: service fix-attrs: starting
frigate  | s6-rc: info: service fix-attrs successfully started
frigate  | s6-rc: info: service legacy-cont-init: starting
frigate  | s6-rc: info: service legacy-cont-init successfully started
frigate  | s6-rc: info: service log-prepare: starting
frigate  | s6-rc: info: service log-prepare successfully started
frigate  | s6-rc: info: service nginx-log: starting
frigate  | s6-rc: info: service go2rtc-log: starting
frigate  | s6-rc: info: service frigate-log: starting
frigate  | s6-rc: info: service nginx-log successfully started
frigate  | s6-rc: info: service go2rtc-log successfully started
frigate  | s6-rc: info: service go2rtc: starting
frigate  | 2024-01-10 22:36:45.479210387  [INFO] Preparing go2rtc config...
frigate  | s6-rc: info: service frigate-log successfully started
frigate  | s6-rc: info: service go2rtc successfully started
frigate  | s6-rc: info: service go2rtc-healthcheck: starting
frigate  | s6-rc: info: service frigate: starting
frigate  | 2024-01-10 22:36:45.496095407  [INFO] Starting Frigate...
frigate  | s6-rc: info: service go2rtc-healthcheck successfully started
frigate  | s6-rc: info: service frigate successfully started
frigate  | s6-rc: info: service nginx: starting
frigate  | 2024-01-10 22:36:45.533761952  [INFO] Starting NGINX...
frigate  | s6-rc: info: service nginx successfully started
frigate  | s6-rc: info: service legacy-services: starting
frigate  | s6-rc: info: service legacy-services successfully started
frigate  | 2024-01-10 22:36:45.716520261  [INFO] Starting go2rtc...
frigate  | 2024-01-10 22:36:45.831381497  22:36:45.831 INF go2rtc version 1.2.0 linux/amd64
frigate  | 2024-01-10 22:36:45.833704514  22:36:45.833 INF [api] listen addr=:1984
frigate  | 2024-01-10 22:36:45.834463153  22:36:45.834 INF [rtsp] listen addr=:8554
frigate  | 2024-01-10 22:36:45.835231722  22:36:45.835 INF [srtp] listen addr=:8443
frigate  | 2024-01-10 22:36:45.835669794  22:36:45.835 INF [webrtc] listen addr=:8555
frigate  | 2024-01-10 22:36:46.594316099  [2024-01-10 22:36:46] frigate.app                    INFO    : Starting Frigate (0.12.1-367d724)
frigate  | 2024-01-10 22:36:46.617808250  [2024-01-10 22:36:46] frigate.config                 WARNING : Customizing more than a detector model path is unsupported.
frigate  | 2024-01-10 22:36:46.623013477  [2024-01-10 22:36:46] peewee_migrate                 INFO    : Starting migrations
frigate  | 2024-01-10 22:36:46.627016147  [2024-01-10 22:36:46] peewee_migrate                 INFO    : There is nothing to migrate
frigate  | 2024-01-10 22:36:46.642091207  [2024-01-10 22:36:46] detector.ov                    INFO    : Starting detection process: 301
frigate  | 2024-01-10 22:36:46.646803262  [2024-01-10 22:36:46] frigate.app                    INFO    : Output process started: 303
frigate  | 2024-01-10 22:36:46.651684731  [2024-01-10 22:36:46] frigate.app                    INFO    : Camera processor started for G3Instant2: 306
frigate  | 2024-01-10 22:36:46.656312105  [2024-01-10 22:36:46] frigate.app                    INFO    : Camera processor started for G3Instant3: 308
frigate  | 2024-01-10 22:36:46.660150303  [2024-01-10 22:36:46] frigate.app                    INFO    : Camera processor started for G3Instant4: 309
frigate  | 2024-01-10 22:36:46.664496321  [2024-01-10 22:36:46] frigate.app                    INFO    : Capture process started for G3Instant2: 311
frigate  | 2024-01-10 22:36:46.669141734  [2024-01-10 22:36:46] frigate.app                    INFO    : Capture process started for G3Instant3: 313
frigate  | 2024-01-10 22:36:46.673562457  [2024-01-10 22:36:46] frigate.app                    INFO    : Capture process started for G3Instant4: 314
frigate  | 2024-01-10 22:36:54.730492647  [2024-01-10 22:36:54] frigate.detectors.plugins.openvino INFO    : Model Input Shape: {1, 300, 300, 3}
frigate  | 2024-01-10 22:36:54.730496890  [2024-01-10 22:36:54] frigate.detectors.plugins.openvino INFO    : Model Output-0 Shape: {1, 1, 100, 7}
frigate  | 2024-01-10 22:36:54.730501064  [2024-01-10 22:36:54] frigate.detectors.plugins.openvino INFO    : Model has 1 Output Tensors

Operating system

Proxmox

Install method

Docker Compose

Coral version

CPU (no coral)

Any other information that may be helpful

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions