I
Immich•3d ago
ghostkilla

How do I enable hardware acceleration for ml and transcoding?

I have a ds224+ with Intel Celeron J4125. I read on reddit that they were able to enable hw accelaration on this nas but forgot how they did it. Please help me with setting up this part of compose.yml: services: immich-server: container_name: immich_server user: 1026:100 image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} # extends: # file: hwaccel.transcoding.yml # service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding volumes: # Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file - ${UPLOAD_LOCATION}:/data - /etc/localtime:/etc/localtime:ro - /volume1/homes/abhirham/Photos:/usr/src/app/external:ro
immich-machine-learning: container_name: immich_machine_learning # For hardware acceleration, add one of -[armnn, cuda, rocm, openvino, rknn] to the image tag. # Example tag: ${IMMICH_VERSION:-release}-cuda image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration # file: hwaccel.ml.yml # service: cpu # set to one of [armnn, cuda, rocm, openvino, openvino-wsl, rknn] for accelerated inference - use the -wsl version for WSL2 where applicable
53 Replies
Immich
Immich•3d ago
:wave: Hey @ghostkilla, Thanks for reaching out to us. Please carefully read this message and follow the recommended actions. This will help us be more effective in our support effort and leave more time for building Immich :immich:. References - Container Logs: docker compose logs docs - Container Status: docker ps -a docs - Reverse Proxy: https://immich.app/docs/administration/reverse-proxy - Code Formatting https://support.discord.com/hc/en-us/articles/210298617-Markdown-Text-101-Chat-Formatting-Bold-Italic-Underline#h_01GY0DAKGXDEHE263BCAYEGFJA Checklist I have... 1. :blue_square: verified I'm on the latest release(note that mobile app releases may take some time). 2. :blue_square: read applicable release notes. 3. :blue_square: reviewed the FAQs for known issues. 4. :blue_square: reviewed Github for known issues. 5. :blue_square: tried accessing Immich via local ip (without a custom reverse proxy). 6. :blue_square: uploaded the relevant information (see below). 7. :blue_square: tried an incognito window, disabled extensions, cleared mobile app cache, logged out and back in, different browsers, etc. as applicable (an item can be marked as "complete" by reacting with the appropriate number) Information In order to be able to effectively help you, we need you to provide clear information to show what the problem is. The exact details needed vary per case, but here is a list of things to consider: - Your docker-compose.yml and .env files. - Logs from all the containers and their status (see above). - All the troubleshooting steps you've tried so far. - Any recent changes you've made to Immich or your system. - Details about your system (both software/OS and hardware). - Details about your storage (filesystems, type of disks, output of commands like fdisk -l and df -h). - The version of the Immich server, mobile app, and other relevant pieces. - Any other information that you think might be relevant. Please paste files and logs with proper code formatting, and especially avoid blurry screenshots. Without the right information we can't work out what the problem is. Help us help you ;) If this ticket can be closed you can use the /close command, and re-open it later if needed.
ghostkilla
ghostkillaOP•3d ago
Thank for your response. I set up my immich using your link and everything is running except for this (image). How do I fix this?
No description
Mraedis
Mraedis•3d ago
How much ram does your synology have? By the looks of it, not enough
ghostkilla
ghostkillaOP•3d ago
I have 18gb ram @Mraedis
No description
No description
Mraedis
Mraedis•3d ago
Did you change anything to the concurrency for the jobs?
ghostkilla
ghostkillaOP•3d ago
not even sure where to do that. Here is my compose.yml if that helps.
No description
Mraedis
Mraedis•3d ago
If you don't know you probably didn't change anything 🙂 Possibly it's missing some permissions/device access What does the rest of the compose look like? I notice you put user: 1026:100 for the server container
ghostkilla
ghostkillaOP•3d ago
PrivateBin
Encrypted note on PrivateBin
Visit this link to see the note. Giving the URL to anyone allows them to access the note, too.
Mraedis
Mraedis•3d ago
Why not have that for the ML container as well?
ghostkilla
ghostkillaOP•3d ago
I added that and running those jobs again. How ever I noticed 1 thing in the ml container logs. Check image for context. "permission denied for ./config". Is that an issue?
No description
ghostkilla
ghostkillaOP•3d ago
and also this in the immich server container logs
No description
Mraedis
Mraedis•3d ago
Yes, mount the config dir to the ML container: https://immich.app/docs/FAQ/#how-can-i-run-immich-as-a-non-root-user For instance
...
immich-machine-learning:
user: 1026:100
container_name: immich_machine_learning
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}-openvino
extends:
file: hwaccel.ml.yml
service: openvino # set to one of [armnn, cuda, rocm, openvino, openvino-wsl, rknn] for accelerated inference - use the `-wsl` version for WSL2 where applicable
volumes:
- model-cache:/cache
- ml-config:/.config
env_file:
- .env
restart: always
healthcheck:
disable: false
...
volumes:
model-cache:
ml-config:
...
immich-machine-learning:
user: 1026:100
container_name: immich_machine_learning
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}-openvino
extends:
file: hwaccel.ml.yml
service: openvino # set to one of [armnn, cuda, rocm, openvino, openvino-wsl, rknn] for accelerated inference - use the `-wsl` version for WSL2 where applicable
volumes:
- model-cache:/cache
- ml-config:/.config
env_file:
- .env
restart: always
healthcheck:
disable: false
...
volumes:
model-cache:
ml-config:
Don't forget to add it to the bottom This seems like there is no QSV device to be mounted, or it's missing permissions If you know the render and video groups, you can add those
ghostkilla
ghostkillaOP•3d ago
do I need to add this? devices: - /dev/dri:/dev/dri
Mraedis
Mraedis•3d ago
It's covered under
extends:
file: hwaccel.ml.yml
service: openvino
extends:
file: hwaccel.ml.yml
service: openvino
https://mariushosting.com/synology-how-to-find-uid-userid-and-gid-groupid/ Find the group id for render and video it's usually 44 and something
ghostkilla
ghostkillaOP•3d ago
I dont see a render group here. Is this expected? @Mraedis
No description
Mraedis
Mraedis•3d ago
For ds224? Not sure no Could be 'videodriver'
ghostkilla
ghostkillaOP•3d ago
@Mraedis just checked /etc/group file. 'videodriver' or 'video' or 'render' dont exist at all in that list. FYI I am following this to get the id for hte video group: https://www.reddit.com/r/jellyfin/comments/wurzin/comment/ild76a6/
Reddit
Filigott's comment on "Updated guide on how to get quicksync to wor...
Explore this conversation and more from the jellyfin community
Mraedis
Mraedis•3d ago
that's curious because it literally lists 'videodriver' as group in your screenshot 👀 what happens if you just getent group video or videodriver or render probably just missing sudo try sudo synogroup --get videodriver
ghostkilla
ghostkillaOP•3d ago
now it works. 993 is the group for videodriver. render and video dont exist
Mraedis
Mraedis•3d ago
You'll want that in a group_add command
ghostkilla
ghostkillaOP•3d ago
can I do this in the compose.yml instead?
No description
Mraedis
Mraedis•3d ago
Under the image line, add group_add with the same indentation:
image: ghcr.io/immich-app/ (both server and machine learning)
group_add:
- "993"
image: ghcr.io/immich-app/ (both server and machine learning)
group_add:
- "993"
Yes 😛
ghostkilla
ghostkillaOP•3d ago
added group_add to both server and ml. Do I just build the container now?
Mraedis
Mraedis•3d ago
yes any changes to the compose require a rebuild to take effect It also means that as long as you don't rebuild you can recover from accidentally ruining your compose 😛
ghostkilla
ghostkillaOP•3d ago
when you say rebuid, do you mean "clean -> build". or just "build" @Mraedis
Mraedis
Mraedis•3d ago
I wouldn't know what the difference is for Synology, sorry. It's the equivalent of docker compose up -d
ghostkilla
ghostkillaOP•3d ago
@Mraedis getting this error now. the user 1026 has rw permissions to all folders
No description
ghostkilla
ghostkillaOP•3d ago
Also I want to mention that you are being extremely helpful and patient. Really appreciate it. thank you so so much not a lot of poeple like you around here
Mraedis
Mraedis•3d ago
wdym there's a bunch of us :3 Just repeat this step but for the matplotlib directory
ghostkilla
ghostkillaOP•3d ago
not sure about immich but hotio channel has a lot of impatient people. had my fair share of rude messages there
Mraedis
Mraedis•3d ago
...
immich-machine-learning:
group_add:
- "993"
user: 1026:100
container_name: immich_machine_learning
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}-openvino
extends:
file: hwaccel.ml.yml
service: openvino # set to one of [armnn, cuda, rocm, openvino, openvino-wsl, rknn] for accelerated inference - use the `-wsl` version for WSL2 where applicable
volumes:
- model-cache:/cache
- ml-config:/.config
- mplib:/.config/matplotlib
env_file:
- .env
restart: always
healthcheck:
disable: false
...
volumes:
model-cache:
ml-config:
mplib:
...
immich-machine-learning:
group_add:
- "993"
user: 1026:100
container_name: immich_machine_learning
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}-openvino
extends:
file: hwaccel.ml.yml
service: openvino # set to one of [armnn, cuda, rocm, openvino, openvino-wsl, rknn] for accelerated inference - use the `-wsl` version for WSL2 where applicable
volumes:
- model-cache:/cache
- ml-config:/.config
- mplib:/.config/matplotlib
env_file:
- .env
restart: always
healthcheck:
disable: false
...
volumes:
model-cache:
ml-config:
mplib:
ghostkilla
ghostkillaOP•3d ago
@Mraedis should I use this from https://mariushosting.com/how-to-install-immich-on-your-synology-nas/ instead? which one would be easier?
Marius Hosting
How to Install Immich on Your Synology NAS
Trustworthy expert guide to your Synology NAS.
No description
Mraedis
Mraedis•3d ago
Just the volumes section I wager 👀 I don't think this has HWA though?
ghostkilla
ghostkillaOP•3d ago
ok ok. will follow you
ghostkilla
ghostkillaOP•3d ago
@Mraedis
No description
Mraedis
Mraedis•3d ago
Add the :rw like in the screenshot
ghostkilla
ghostkillaOP•3d ago
@Mraedis that fixed the issue. But now running into this issue:
No description
No description
Mraedis
Mraedis•3d ago
hmhmmm And you're sure there's not sudo getent group render ? Let's put them manually in the machine learning container and get rid of the extends Like so:
...
immich-machine-learning:
group_add:
- "993"
user: 1026:100
container_name: immich_machine_learning
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}-openvino
device_cgroup_rules:
- 'c 189:* rmw'
devices:
- /dev/dri/renderD128:/dev/dri/renderD128
- /dev/dri/card0:/dev/dri/card0
- /dev/dri:/dev/dri
volumes:
- /dev/bus/usb:/dev/bus/usb
- model-cache:/cache
- ml-config:/.config
- mplib:/.config/matplotlib
env_file:
- .env
restart: always
healthcheck:
disable: false
...
volumes:
model-cache:
ml-config:
mplib:
...
immich-machine-learning:
group_add:
- "993"
user: 1026:100
container_name: immich_machine_learning
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}-openvino
device_cgroup_rules:
- 'c 189:* rmw'
devices:
- /dev/dri/renderD128:/dev/dri/renderD128
- /dev/dri/card0:/dev/dri/card0
- /dev/dri:/dev/dri
volumes:
- /dev/bus/usb:/dev/bus/usb
- model-cache:/cache
- ml-config:/.config
- mplib:/.config/matplotlib
env_file:
- .env
restart: always
healthcheck:
disable: false
...
volumes:
model-cache:
ml-config:
mplib:
ghostkilla
ghostkillaOP•3d ago
trying it now. just an FYI, i upated the config.yml to this: immich-machine-learning: container_name: immich_machine_learning user: 1026:100 # For hardware acceleration, add one of -[armnn, cuda, rocm, openvino, rknn] to the image tag. # Example tag: ${IMMICH_VERSION:-release}-cuda image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}-openvino group_add: - "993" # 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, rocm, openvino, openvino-wsl, rknn] for accelerated inference - use the -wsl version for WSL2 where applicable device_cgroup_rules: - 'c 189:* rmw' devices: - /dev/dri/renderD128:/dev/dri/renderD128 - /dev/dri/card0:/dev/dri/card0 - /dev/dri:/dev/dri volumes: - /volume1/docker/immich/cache:/cache:rw - /volume1/docker/immich/cache:/.cache:rw - /volume1/docker/immich/cache:/.config:rw - /volume1/docker/immich/matplotlib:/matplotlib:rw env_file: - .env restart: always healthcheck: disable: false
No description
ghostkilla
ghostkillaOP•3d ago
still the same issue
No description
Mraedis
Mraedis•3d ago
darn, well something is missing, but what rights, users, groups... I don't know for sure You may be interested in https://immich.app/docs/guides/remote-machine-learning/ instead
ghostkilla
ghostkillaOP•3d ago
I commented out # user: 1026:100 and now its not throwing any "no gpu found". But cpu is still at 98% @Mraedis
No description
ghostkilla
ghostkillaOP•3d ago
its not constantly at 90s though. Its going up and down. between 50-98
Mraedis
Mraedis•3d ago
Looks like it's trying the openvino acceleration for the CPU instead of CPU maybe? To be clear You don't NEED HWA for immich to work and after initial ingest the CPU will calm down
ghostkilla
ghostkillaOP•3d ago
ohk thanks for your help btw. but what ever im seeing here is expected right?
Mraedis
Mraedis•3d ago
Yes, machine learning and video transcoding is very intensive
mertalev
mertalev•3d ago
openvino has to compile all the models at first, which can take some minutes to finish. it'll use a lot of cpu during this time it should use less cpu once it's done compiling
ghostkilla
ghostkillaOP•3d ago
https://logs.notifiarr.com/?36a78da485c309fb#BvmuKngvCp3D7NXP7CieJU3UkQeeb4HKeTnLZ7RRFWS3 @Mraedis @mertalev getting this error in immich server container
PrivateBin
Encrypted note on PrivateBin
Visit this link to see the note. Giving the URL to anyone allows them to access the note, too.
ghostkilla
ghostkillaOP•3d ago
PrivateBin
Encrypted note on PrivateBin
Visit this link to see the note. Giving the URL to anyone allows them to access the note, too.
ghostkilla
ghostkillaOP•3d ago
redis and ml look good
Mraedis
Mraedis•2d ago
No need to tag people for that The postgres error is unrelated to the ML errro And it seems to me the video is simply not compatible for transcodes or is corruct, that happens
ghostkilla
ghostkillaOP•2d ago
ok thank you for all your help

Did you find this page helpful?