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
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 applicable53 Replies
: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.Hi, check out the
QuickSync
section on https://immich.app/docs/features/hardware-transcoding and openvino
on https://immich.app/docs/features/ml-hardware-acceleration/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?

How much ram does your synology have? By the looks of it, not enough
I have 18gb ram @Mraedis


Did you change anything to the concurrency for the jobs?
not even sure where to do that. Here is my compose.yml if that helps.

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 containerPrivateBin
Encrypted note on PrivateBin
Visit this link to see the note. Giving the URL to anyone allows them to access the note, too.
Why not have that for the ML container as well?
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?

and also this in the immich server container logs

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
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
do I need to add this?
devices:
- /dev/dri:/dev/dri
It's covered under
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
I dont see a render group here. Is this expected? @Mraedis

For ds224? Not sure no
Could be 'videodriver'
@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
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
now it works. 993 is the group for videodriver. render and video dont exist
You'll want that in a group_add command
can I do this in the compose.yml instead?

Under the image line, add group_add with the same indentation:
Yes 😛
added group_add to both server and ml. Do I just build the container now?
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 😛
when you say rebuid, do you mean "clean -> build". or just "build" @Mraedis
I wouldn't know what the difference is for Synology, sorry.
It's the equivalent of
docker compose up -d
@Mraedis getting this error now. the user 1026 has rw permissions to all folders

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
wdym there's a bunch of us :3
Just repeat this step but for the matplotlib directory
not sure about immich but hotio channel has a lot of impatient people. had my fair share of rude messages there
@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.

Just the volumes section I wager 👀
I don't think this has HWA though?
ok ok. will follow you
@Mraedis

Add the :rw like in the screenshot
@Mraedis that fixed the issue. But now running into this issue:


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:
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

still the same issue

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
I commented out
# user: 1026:100
and now its not throwing any "no gpu found". But cpu is still at 98% @Mraedis
its not constantly at 90s though. Its going up and down.
between 50-98
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
ohk
thanks for your help btw.
but what ever im seeing here is expected right?
Yes, machine learning and video transcoding is very intensive
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
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.
postgres error
https://logs.notifiarr.com/?abdeac8d05edfbdd#BA46Zoop52xCEgm9ZG3mrDsHPeJrAnvy6d4uKaLphE8Y
PrivateBin
Encrypted note on PrivateBin
Visit this link to see the note. Giving the URL to anyone allows them to access the note, too.
redis and ml look good
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
ok thank you for all your help