Closed fwmone closed 2 months ago
It seems that the hwaccel.ml.yml file version Out of date, try downloading the newest one from the release page and check accordingly.
Thanks! Yes, you were right, my config files were outdated - sorry for that. I updated all of them, but the problem still stays.
docker-compose.yml:
`version: "3.8"
#
#
#
#
name: immich
services: immich-server: container_name: immich_server image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} command: ['start.sh', 'immich'] volumes:
database restart: always
immich-microservices: container_name: immich_microservices image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/hardware-transcoding file: hwaccel.transcoding.yml service: quicksync # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding command: ['start.sh', 'microservices'] volumes:
database restart: always
immich-machine-learning: container_name: immich_machine_learning
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}-openvino
extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
file: hwaccel.ml.yml
service: openvino # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the -wsl
version for WSL2 where applicable
volumes:
.env restart: always
redis: container_name: immich_redis image: registry.hub.docker.com/library/redis:6.2-alpine@sha256:51d6c56749a4243096327e3fb964a48ed92254357108449cb6e23999c37773c5 restart: always
database: container_name: immich_postgres image: registry.hub.docker.com/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0 env_file:
volumes: pgdata: model-cache: `
hwaccel.ml.yml:
`version: "3.8"
services: armnn: devices:
/usr/lib/libmali.so:/usr/lib/libmali.so:ro # Mali driver for your chipset (always required)
cpu: {}
cuda: deploy: resources: reservations: devices:
openvino: device_cgroup_rules:
/dev/bus/usb:/dev/bus/usb
openvino-wsl: devices:
Log:
`[03/29/24 16:57:34] INFO Starting gunicorn 21.2.0
[03/29/24 16:57:34] INFO Using worker: app.config.CustomUvicornWorker
[03/29/24 16:57:34] INFO Booting worker with pid: 13
[03/29/24 16:57:41] INFO Started server process [13]
[03/29/24 16:57:41] INFO Waiting for application startup.
[03/29/24 16:57:41] INFO Created in-memory cache with unloading after 300s
of inactivity.
[03/29/24 16:57:41] INFO Initialized request thread pool with 4 threads.
[03/29/24 16:57:41] INFO Application startup complete.
[03/29/24 16:59:38] INFO Setting 'ViT-B-32openai' execution providers to
['OpenVINOExecutionProvider',
'CPUExecutionProvider'], in descending order of
preference
[03/29/24 16:59:38] INFO Loading clip model 'ViT-B-32openai' to memory
2024-03-29 16:59:42.034430019 [E:onnxruntime:, inference_session.cc:1985 Initialize] Encountered unknown exception in Initialize()
[03/29/24 16:59:42] ERROR Exception in ASGI application
╭─────── Traceback (most recent call last) ───────╮
│ /usr/src/app/main.py:116 in predict │
│ │
│ 113 │ except orjson.JSONDecodeError: │
│ 114 │ │ raise HTTPException(400, f"Invali │
│ 115 │ │
│ ❱ 116 │ model = await load(await model_cache. │
│ ttl=settings.model_ttl, **kwargs)) │
│ 117 │ model.configure(**kwargs) │
│ 118 │ outputs = await run(model.predict, in │
│ 119 │ return ORJSONResponse(outputs) │
│ │
│ /usr/src/app/main.py:137 in load │
│ │
│ 134 │ │ │ model.load() │
│ 135 │ │
│ 136 │ try: │
│ ❱ 137 │ │ await run(_load, model) │
│ 138 │ │ return model │
│ 139 │ except (OSError, InvalidProtobuf, Bad │
│ 140 │ │ log.warning( │
│ │
│ /usr/src/app/main.py:125 in run │
│ │
│ 122 async def run(func: Callable[..., Any], i │
│ 123 │ if thread_pool is None: │
│ 124 │ │ return func(inputs) │
│ ❱ 125 │ return await asyncio.get_running_loop │
│ 126 │
│ 127 │
│ 128 async def load(model: InferenceModel) -> │
│ │
│ /usr/lib/python3.10/concurrent/futures/thread.p │
│ y:58 in run │
│ │
│ /usr/src/app/main.py:134 in _load │
│ │
│ 131 │ │
│ 132 │ def _load(model: InferenceModel) -> N │
│ 133 │ │ with lock: │
│ ❱ 134 │ │ │ model.load() │
│ 135 │ │
│ 136 │ try: │
│ 137 │ │ await run(_load, model) │
│ │
│ /usr/src/app/models/base.py:52 in load │
│ │
│ 49 │ │ │ return │
│ 50 │ │ self.download() │
│ 51 │ │ log.info(f"Loading {self.model_ty │
│ to memory") │
│ ❱ 52 │ │ self._load() │
│ 53 │ │ self.loaded = True │
│ 54 │ │
│ 55 │ def predict(self, inputs: Any, **mode │
│ │
│ /usr/src/app/models/clip.py:146 in _load │
│ │
│ 143 │ │ super().__init__(clean_name(model │
│ 144 │ │
│ 145 │ def _load(self) -> None: │
│ ❱ 146 │ │ super()._load() │
│ 147 │ │ self._load_tokenizer() │
│ 148 │ │ │
│ 149 │ │ size: list[int] | int = self.prep │
│ │
│ /usr/src/app/models/clip.py:36 in _load │
│ │
│ 33 │ def _load(self) -> None: │
│ 34 │ │ if self.mode == "text" or self.mo │
│ 35 │ │ │ log.debug(f"Loading clip text │
│ ❱ 36 │ │ │ self.text_model = self._make_ │
│ 37 │ │ │ log.debug(f"Loaded clip text │
│ 38 │ │ │
│ 39 │ │ if self.mode == "vision" or self. │
│ │
│ /usr/src/app/models/base.py:117 in │
│ _make_session │
│ │
│ 114 │ │ │ case ".armnn": │
│ 115 │ │ │ │ session = AnnSession(mode │
│ 116 │ │ │ case ".onnx": │
│ ❱ 117 │ │ │ │ session = ort.InferenceSe │
│ 118 │ │ │ │ │ model_path.as_posix() │
│ 119 │ │ │ │ │ sess_options=self.ses │
│ 120 │ │ │ │ │ providers=self.provid │
│ │
│ /opt/venv/lib/python3.10/site-packages/onnxrunt │
│ ime/capi/onnxruntime_inference_collection.py:41 │
│ 9 in __init__ │
│ │
│ 416 │ │ disabled_optimizers = kwargs["di │
│ kwargs else None │
│ 417 │ │ │
│ 418 │ │ try: │
│ ❱ 419 │ │ │ self._create_inference_sessi │
│ disabled_optimizers) │
│ 420 │ │ except (ValueError, RuntimeError │
│ 421 │ │ │ if self._enable_fallback: │
│ 422 │ │ │ │ try: │
│ │
│ /opt/venv/lib/python3.10/site-packages/onnxrunt │
│ ime/capi/onnxruntime_inference_collection.py:48 │
│ 3 in _create_inference_session │
│ │
│ 480 │ │ │ disabled_optimizers = set(di │
│ 481 │ │ │
│ 482 │ │ # initialize the C++ InferenceSe │
│ ❱ 483 │ │ sess.initialize_session(provider │
│ 484 │ │ │
│ 485 │ │ self._sess = sess │
│ 486 │ │ self._sess_options = self._sess. │
╰─────────────────────────────────────────────────╯
RuntimeException: [ONNXRuntimeError] : 6 :
RUNTIME_EXCEPTION : Encountered unknown exception
in Initialize()
[03/29/24 17:00:25] INFO Loading clip model 'ViT-B-32__openai' to memory
2024-03-29 17:00:28.560632989 [E:onnxruntime:, inference_session.cc:1985 Initialize] Encountered unknown exception in Initialize()
[03/29/24 17:00:28] ERROR Exception in ASGI application
╭─────── Traceback (most recent call last) ───────╮
│ /usr/src/app/main.py:116 in predict │
│ │
│ 113 │ except orjson.JSONDecodeError: │
│ 114 │ │ raise HTTPException(400, f"Invali │
│ 115 │ │
│ ❱ 116 │ model = await load(await model_cache. │
│ ttl=settings.model_ttl, **kwargs)) │
│ 117 │ model.configure(**kwargs) │
│ 118 │ outputs = await run(model.predict, in │
│ 119 │ return ORJSONResponse(outputs) │
│ │
│ /usr/src/app/main.py:137 in load │
│ │
│ 134 │ │ │ model.load() │
│ 135 │ │
│ 136 │ try: │
│ ❱ 137 │ │ await run(_load, model) │
│ 138 │ │ return model │
│ 139 │ except (OSError, InvalidProtobuf, Bad │
│ 140 │ │ log.warning( │
│ │
│ /usr/src/app/main.py:125 in run │
│ │
│ 122 async def run(func: Callable[..., Any], i │
│ 123 │ if thread_pool is None: │
│ 124 │ │ return func(inputs) │
│ ❱ 125 │ return await asyncio.get_running_loop │
│ 126 │
│ 127 │
│ 128 async def load(model: InferenceModel) -> │
│ │
│ /usr/lib/python3.10/concurrent/futures/thread.p │
│ y:58 in run │
│ │
│ /usr/src/app/main.py:134 in _load │
│ │
│ 131 │ │
│ 132 │ def _load(model: InferenceModel) -> N │
│ 133 │ │ with lock: │
│ ❱ 134 │ │ │ model.load() │
│ 135 │ │
│ 136 │ try: │
│ 137 │ │ await run(_load, model) │
│ │
│ /usr/src/app/models/base.py:52 in load │
│ │
│ 49 │ │ │ return │
│ 50 │ │ self.download() │
│ 51 │ │ log.info(f"Loading {self.model_ty │
│ to memory") │
│ ❱ 52 │ │ self._load() │
│ 53 │ │ self.loaded = True │
│ 54 │ │
│ 55 │ def predict(self, inputs: Any, **mode │
│ │
│ /usr/src/app/models/clip.py:146 in _load │
│ │
│ 143 │ │ super().__init__(clean_name(model │
│ 144 │ │
│ 145 │ def _load(self) -> None: │
│ ❱ 146 │ │ super()._load() │
│ 147 │ │ self._load_tokenizer() │
│ 148 │ │ │
│ 149 │ │ size: list[int] | int = self.prep │
│ │
│ /usr/src/app/models/clip.py:36 in _load │
│ │
│ 33 │ def _load(self) -> None: │
│ 34 │ │ if self.mode == "text" or self.mo │
│ 35 │ │ │ log.debug(f"Loading clip text │
│ ❱ 36 │ │ │ self.text_model = self._make_ │
│ 37 │ │ │ log.debug(f"Loaded clip text │
│ 38 │ │ │
│ 39 │ │ if self.mode == "vision" or self. │
│ │
│ /usr/src/app/models/base.py:117 in │
│ _make_session │
│ │
│ 114 │ │ │ case ".armnn": │
│ 115 │ │ │ │ session = AnnSession(mode │
│ 116 │ │ │ case ".onnx": │
│ ❱ 117 │ │ │ │ session = ort.InferenceSe │
│ 118 │ │ │ │ │ model_path.as_posix() │
│ 119 │ │ │ │ │ sess_options=self.ses │
│ 120 │ │ │ │ │ providers=self.provid │
│ │
│ /opt/venv/lib/python3.10/site-packages/onnxrunt │
│ ime/capi/onnxruntime_inference_collection.py:41 │
│ 9 in __init__ │
│ │
│ 416 │ │ disabled_optimizers = kwargs["di │
│ kwargs else None │
│ 417 │ │ │
│ 418 │ │ try: │
│ ❱ 419 │ │ │ self._create_inference_sessi │
│ disabled_optimizers) │
│ 420 │ │ except (ValueError, RuntimeError │
│ 421 │ │ │ if self._enable_fallback: │
│ 422 │ │ │ │ try: │
│ │
│ /opt/venv/lib/python3.10/site-packages/onnxrunt │
│ ime/capi/onnxruntime_inference_collection.py:48 │
│ 3 in _create_inference_session │
│ │
│ 480 │ │ │ disabled_optimizers = set(di │
│ 481 │ │ │
│ 482 │ │ # initialize the C++ InferenceSe │
│ ❱ 483 │ │ sess.initialize_session(provider │
│ 484 │ │ │
│ 485 │ │ self._sess = sess │
│ 486 │ │ self._sess_options = self._sess. │
╰─────────────────────────────────────────────────╯
RuntimeException: [ONNXRuntimeError] : 6 :
RUNTIME_EXCEPTION : Encountered unknown exception
in Initialize() `
1.99 updated to a newer version of OpenVINO. This actually fixed smart search for most users from what I've seen, so interesting that it broke it for you. Unfortunately, there isn't much I can do here. It's surprisingly difficult to make OpenVINO work for everyone.
I am seeing this issue on my humble Intel J5005 (Gemini Lake). This is a fresh install as of yesterday evening
I have over 10GB unallocated gunicorn appears in intel_gpu_top but no usage
OpenVino inference is working nicely for Frigate NVR, but perhaps this model is too heavy for the iGPU? I'm happy to wipe/experiment with my installation if I can help in any way.
The log below is for a single face detection attempt (concurrency = 1)
I am on N5105 as well, with 16GB RAM. Can confirm having the exact same error when running 1.99.0 above. If switching to immich-machine-learning:v1.98.2-openvino
everything works.
With MACHINE_LEARNING_PRELOAD__CLIP=ViT-B-32__openai
, the error shows immediately after start:
I'm getting the same error on a i5 6200u (gpu hd520), with Immich version 1.104.6, and since V1.100 (the first time I tried using the gpu for hw acceleration) Transcoding works fine.
It's running in a privileged LXC on the latest version of proxmox, 8gb of ram dedicated.
I'm not able, though, to try the 1.98.2 version of the machine learning container because it gives me an error on the server container:
This should be fixed as of the current release. Be sure to delete the model cache volume so it downloads the updated models.
Looks good to me - thanks a bunch!
The bug
When enabling the immich-machine-learning openvino image, search is not working anymore but throws an HTTP 500 error. The immich-machine-learning log throws:
`[03/29/24 09:48:06] INFO Loading clip model 'ViT-B-32__openai' to memory
2024-03-29 09:48:09.988640928 [E:onnxruntime:, inference_session.cc:1985 Initialize] Encountered unknown exception in Initialize()
[03/29/24 09:48:09] ERROR Exception in ASGI application
Search works well without openvino enabled.
My hwaccel.ml.yml:
`version: "3.8"
Configurations for hardware-accelerated machine learning
If using Unraid or another platform that doesn't allow multiple Compose files,
you can inline the config for a backend by copying its contents
into the immich-machine-learning service in the docker-compose.yml file.
See https://immich.app/docs/features/ml-hardware-acceleration for info on usage.
services: armnn: devices:
/usr/lib/libmali.so:/usr/lib/libmali.so:ro # Mali driver for your chipset (always required)
cpu:
cuda: deploy: resources: reservations: devices:
openvino: device_cgroup_rules:
/dev/bus/usb:/dev/bus/usb
openvino-wsl: devices:
I run an Asustor AS6702T NAS with an Intel Celeron N5105 CPU. This problem started with v1.99.0.
The OS that Immich Server is running on
ADM 4.2.6RPI1 (Asustor NAS)
Version of Immich Server
v1.100.0
Version of Immich Mobile App
(not used)
Platform with the issue
Your docker-compose.yml content
Your .env content
Reproduction steps
Additional information
No response