I
Immich5mo ago
Sam___D

Immich says no /dev/dri devices found while test node script can find them

Video conversion seems to fail with hardware acceleration. You can see the output I'm getting here: https://gist.github.com/sdebruyn/b7705a6bd13ac1dd19bd52dd934ca090 Note the line No /dev/dri devices found. If using Docker, make sure at least one /dev/dri device is mounted My Compose file has the following:
devices:
- /dev/dri
group_add:
- "44"
- "107"
devices:
- /dev/dri
group_add:
- "44"
- "107"
Outside the container I can find the DRI devices:
total 0
drwxr-xr-x 3 root root 100 Dec 12 02:26 .
drwxr-xr-x 19 root root 4100 Dec 12 02:30 ..
drwxr-xr-x 2 root root 80 Dec 12 02:26 by-path
crw-rw---- 1 root video 226, 0 Dec 12 02:26 card0
crw-rw---- 1 root render 226, 128 Dec 12 02:26 renderD128
total 0
drwxr-xr-x 3 root root 100 Dec 12 02:26 .
drwxr-xr-x 19 root root 4100 Dec 12 02:30 ..
drwxr-xr-x 2 root root 80 Dec 12 02:26 by-path
crw-rw---- 1 root video 226, 0 Dec 12 02:26 card0
crw-rw---- 1 root render 226, 128 Dec 12 02:26 renderD128
Video is GID 44, render is GID 107 Inside the container I can also find the DRI devices:
root@8072d5bc2bdc:/usr/src/app# ls -al /dev/dri
total 0
drwxr-xr-x 2 root root 80 Dec 12 12:25 .
drwxr-xr-x 6 root root 360 Dec 12 12:25 ..
crw-rw---- 1 root video 226, 0 Dec 12 12:25 card0
crw-rw---- 1 root 107 226, 128 Dec 12 12:25 renderD128
root@8072d5bc2bdc:/usr/src/app# ls -al /dev/dri
total 0
drwxr-xr-x 2 root root 80 Dec 12 12:25 .
drwxr-xr-x 6 root root 360 Dec 12 12:25 ..
crw-rw---- 1 root video 226, 0 Dec 12 12:25 card0
crw-rw---- 1 root 107 226, 128 Dec 12 12:25 renderD128
I created this test script to see if there is an issue with Node fetching them:
const fs = require('fs');

fs.readdir('/dev/dri', (err, files) => {
if (err) {
console.error('Error reading directory:', err.message);
} else {
console.log('Files in /dev/dri:', files);
}
});
const fs = require('fs');

fs.readdir('/dev/dri', (err, files) => {
if (err) {
console.error('Error reading directory:', err.message);
} else {
console.log('Files in /dev/dri:', files);
}
});
It tells me it can find them: Files in /dev/dri: [ 'card0', 'renderD128' ] From looking at the Immich source, that is also how Immich gets the devices. I'm clueless at this point. Anyone has an idea why it's telling me there are no DRI devices?
Gist
immich logs
immich logs. GitHub Gist: instantly share code, notes, and snippets.
43 Replies
Immich
Immich5mo ago
:wave: Hey @Sam_D, 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. :ballot_box_with_check: verified I'm on the latest release(note that mobile app releases may take some time). 2. :ballot_box_with_check: read applicable release notes. 3. :ballot_box_with_check: reviewed the FAQs for known issues. 4. :ballot_box_with_check: reviewed Github for known issues. 5. :ballot_box_with_check: tried accessing Immich via local ip (without a custom reverse proxy). 6. :ballot_box_with_check: uploaded the relevant information (see below). 7. :ballot_box_with_check: 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. Successfully submitted, a tag has been added to inform contributors. :white_check_mark:
Mraedis
Mraedis5mo ago
devices:
- /dev/dri:/dev/dri
devices:
- /dev/dri:/dev/dri
Is what you want You need to bind it to something
Sam___D
Sam___DOP5mo ago
Thanks. I think I was messing with the compose file to troubleshoot but initially I had the provided hwaccel file. I just changed it to your suggestion, retried, but I get the same error.
Mraedis
Mraedis5mo ago
I'm assuming 44 and 107 are render and video? Could you elaborate on your docker host @Sam___D ? Is it a VM, baremetal, which OS etc
Sam___D
Sam___DOP5mo ago
Correct, reverse order though. Running on TrueNAS Scale 24.10.0.2. CPU with iGPU is Intel 14700. No virtualization
Mraedis
Mraedis5mo ago
I've had to also use these rules but I'm really pulling this out of thin air...:
device_cgroup_rules:
- 'c 189:* rmw'
devices:
- /dev/dri:/dev/dri
- /dev/kfd:/dev/kfd
device_cgroup_rules:
- 'c 189:* rmw'
devices:
- /dev/dri:/dev/dri
- /dev/kfd:/dev/kfd
Sam___D
Sam___DOP5mo ago
There's no /dev/kfd on the host What does the other one do?
Mraedis
Mraedis5mo ago
gives access to the devices with that number
Mraedis
Mraedis5mo ago
Medium
Major and Minor numbers in Linux kernel
In the Linux kernel, “major” and “minor” are two distinct concepts that refer to the way the kernel organizes and manages devices.
Mraedis
Mraedis5mo ago
I just noticed it's supposed to be 226 🫠 (for me)
Sam___D
Sam___DOP5mo ago
Thx, since I also saw this in my ls output, giving it a try Do you know an easy way to test encoding/decoding of a single video with Immich?
Mraedis
Mraedis5mo ago
kfd is needed for specific AMD iGPUs just fyi
Sam___D
Sam___DOP5mo ago
Now I just queue all videos again but it's hard to capture the logs
Mraedis
Mraedis5mo ago
Go to any video in the web interface
Mraedis
Mraedis5mo ago
bottom option
No description
Mraedis
Mraedis5mo ago
in the three dots menu
Sam___D
Sam___DOP5mo ago
thx Unfortunately still
Error occurred during transcoding: No /dev/dri devices found. If using Docker, make sure at least one /dev/dri device is mounted
Error occurred during transcoding: No /dev/dri devices found. If using Docker, make sure at least one /dev/dri device is mounted
I'm not understanding why the simple Node JS script can list them without issues while Immich's code seems to use that same call and comes back with nothing
Mraedis
Mraedis5mo ago
You and me both buddy Juuuust to be clear you're doing compose up after every edit right?
Sam___D
Sam___DOP5mo ago
yes definitely I'm using Dockge and redeploy using that when I make a change
Mraedis
Mraedis5mo ago
Alright what if, instead of the directory, we pass the devices themselves so:
devices:
- /dev/dri:/dev/dri
- /dev/dri/card0:/dev/dri/card0
- /dev/dri/renderD128:/dev/dri/renderD128
devices:
- /dev/dri:/dev/dri
- /dev/dri/card0:/dev/dri/card0
- /dev/dri/renderD128:/dev/dri/renderD128
It shouldn't make a difference but at this point... Can even add the dri directory just to make it all silly
Sam___D
Sam___DOP5mo ago
FYI I verified that docker inspect shows the changes we've made with the cgroup rules (I added both, also tried with just the 226):
"Devices": [
{
"PathOnHost": "/dev/dri",
"PathInContainer": "/dev/dri",
"CgroupPermissions": "rwm"
}
],
"DeviceCgroupRules": [
"c 226:* rmw",
"c 186:* rmw"
],
"Devices": [
{
"PathOnHost": "/dev/dri",
"PathInContainer": "/dev/dri",
"CgroupPermissions": "rwm"
}
],
"DeviceCgroupRules": [
"c 226:* rmw",
"c 186:* rmw"
],
still the same issue after adding the devices one by one
Mraedis
Mraedis5mo ago
:Sadge: If you enter the container with docker exec -it immich_server /bin/bash can you produce meaningful output with /usr/lib/jellyfin-ffmpeg/vainfo --display drm --device /dev/dri/renderD128 ?
Sam___D
Sam___DOP5mo ago
root@71da4f8ff7ef:/usr/src/app# /usr/lib/jellyfin-ffmpeg/vainfo --display drm --device /dev/dri/renderD128
Trying display: drm
libva info: VA-API version 1.22.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_22
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.22 (libva 2.22.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 24.4.2 (b6b411f)
vainfo: Supported profile and entrypoints
VAProfileNone : VAEntrypointVideoProc
VAProfileNone : VAEntrypointStats
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlice
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointFEI
VAProfileH264Main : VAEntrypointEncSliceLP
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointFEI
VAProfileH264High : VAEntrypointEncSliceLP
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
... (message too long)
root@71da4f8ff7ef:/usr/src/app# /usr/lib/jellyfin-ffmpeg/vainfo --display drm --device /dev/dri/renderD128
Trying display: drm
libva info: VA-API version 1.22.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_22
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.22 (libva 2.22.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 24.4.2 (b6b411f)
vainfo: Supported profile and entrypoints
VAProfileNone : VAEntrypointVideoProc
VAProfileNone : VAEntrypointStats
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlice
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointFEI
VAProfileH264Main : VAEntrypointEncSliceLP
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointFEI
VAProfileH264High : VAEntrypointEncSliceLP
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
... (message too long)
Do you need the full output?
Mraedis
Mraedis5mo ago
no that's fine /usr/lib/jellyfin-ffmpeg/ffmpeg -v verbose -init_hw_device vaapi=va:/dev/dri/renderD128 -init_hw_device opencl@va Works?
Sam___D
Sam___DOP5mo ago
yep
No description
Sam___D
Sam___DOP5mo ago
it detected UHD 770 so it must be communicating with the DRI somehow
Mraedis
Mraedis5mo ago
Well now I'm all out of ideas 😦 mabye @sogan knows something I don't
Sam___D
Sam___DOP5mo ago
I was thinking about this part in the logs:
immich_microservices | 2024-12-12T12:26:13.102108260Z [vost#0:0/av1_qsv @ 0x5f63b5c1380] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
immich_microservices | 2024-12-12T12:26:13.102108260Z [vost#0:0/av1_qsv @ 0x5f63b5c1380] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
Sam___D
Sam___DOP5mo ago
Can one of the settings cause this?
No description
No description
No description
No description
No description
Mraedis
Mraedis5mo ago
I don't think so, HWA: Quicksync seems OK to me, UHD770 has AV1/VP9
Sam___D
Sam___DOP5mo ago
Oh....
Transcoding video bb63a57d-b012-44ff-8ee1-73438cbcaf42 with QSV-accelerated encoding and decoding
immich_microservices | 2024-12-12T12:31:20.015253442Z [Nest] 7 - 12/12/2024, 1:31:20 PM LOG [Microservices:MediaService] Successfully encoded bb63a57d-b012-44ff-8ee1-73438cbcaf42
immich_microservices | 2024-12-12T12:31:20.230394258Z [Nest] 7 - 12/12/2024, 1:31:20 PM LOG [Microservices:MediaService] Transcoding video cc9241e3-906c-456f-9862-741db4c6944c with QSV-accelerated encoding and decoding
immich_microservices | 2024-12-12T12:31:21.828915670Z [Nest] 7 - 12/12/2024, 1:31:21 PM LOG [Microservices:MediaService] Successfully encoded cc9241e3-906c-456f-9862-741db4c6944c
immich_microservices | 2024-12-12T12:31:21.904893444Z [Nest] 7 - 12/12/2024, 1:31:21 PM LOG [Microservices:MediaService] T
Transcoding video bb63a57d-b012-44ff-8ee1-73438cbcaf42 with QSV-accelerated encoding and decoding
immich_microservices | 2024-12-12T12:31:20.015253442Z [Nest] 7 - 12/12/2024, 1:31:20 PM LOG [Microservices:MediaService] Successfully encoded bb63a57d-b012-44ff-8ee1-73438cbcaf42
immich_microservices | 2024-12-12T12:31:20.230394258Z [Nest] 7 - 12/12/2024, 1:31:20 PM LOG [Microservices:MediaService] Transcoding video cc9241e3-906c-456f-9862-741db4c6944c with QSV-accelerated encoding and decoding
immich_microservices | 2024-12-12T12:31:21.828915670Z [Nest] 7 - 12/12/2024, 1:31:21 PM LOG [Microservices:MediaService] Successfully encoded cc9241e3-906c-456f-9862-741db4c6944c
immich_microservices | 2024-12-12T12:31:21.904893444Z [Nest] 7 - 12/12/2024, 1:31:21 PM LOG [Microservices:MediaService] T
After changing from AV1 to VP9 changing it back to AV1 and the errors come back
Mraedis
Mraedis5mo ago
right so it IS AV1 🤔 But UHD770 has that so I'm not sure where the issue is then
Sam___D
Sam___DOP5mo ago
indeed, that's why I picked that setting and also didn't bother getting an older gen CPU maybe the ffmpeg used isn't compiled in the right way to use av1 with qvs?
Mraedis
Mraedis5mo ago
it's jellyfin-ffmpeg I am 100% sure they are full in on AV1 😛 What kernel version does your truenas have @Sam___D ?
Sam___D
Sam___DOP5mo ago
6.6.44-production+truenas #1 SMP PREEMPT_DYNAMIC Fri Nov 8 18:37:36 UTC 2024 x86_64 GNU/Linux av1 is indeed there with quicksync/vaapi:
root@71da4f8ff7ef:/usr/src/app# ffmpeg -encoders | grep av1
ffmpeg version 7.0.2-Jellyfin Copyright (c) 2000-2024 the FFmpeg developers
built with gcc 12 (Debian 12.2.0-14)
configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto=auto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libxml2 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libharfbuzz --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
libavutil 59. 8.100 / 59. 8.100
libavcodec 61. 3.100 / 61. 3.100
libavformat 61. 1.100 / 61. 1.100
libavdevice 61. 1.100 / 61. 1.100
libavfilter 10. 1.100 / 10. 1.100
libswscale 8. 1.100 / 8. 1.100
libswresample 5. 1.100 / 5. 1.100
libpostproc 58. 1.100 / 58. 1.100
V..... libsvtav1 SVT-AV1(Scalable Video Technology for AV1) encoder (codec av1)
V....D av1_nvenc NVIDIA NVENC av1 encoder (codec av1)
V..... av1_qsv AV1 (Intel Quick Sync Video acceleration) (codec av1)
V....D av1_amf AMD AMF AV1 encoder (codec av1)
V....D av1_vaapi AV1 (VAAPI) (codec av1)
root@71da4f8ff7ef:/usr/src/app# ffmpeg -encoders | grep av1
ffmpeg version 7.0.2-Jellyfin Copyright (c) 2000-2024 the FFmpeg developers
built with gcc 12 (Debian 12.2.0-14)
configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto=auto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libxml2 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libharfbuzz --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
libavutil 59. 8.100 / 59. 8.100
libavcodec 61. 3.100 / 61. 3.100
libavformat 61. 1.100 / 61. 1.100
libavdevice 61. 1.100 / 61. 1.100
libavfilter 10. 1.100 / 10. 1.100
libswscale 8. 1.100 / 8. 1.100
libswresample 5. 1.100 / 5. 1.100
libpostproc 58. 1.100 / 58. 1.100
V..... libsvtav1 SVT-AV1(Scalable Video Technology for AV1) encoder (codec av1)
V....D av1_nvenc NVIDIA NVENC av1 encoder (codec av1)
V..... av1_qsv AV1 (Intel Quick Sync Video acceleration) (codec av1)
V....D av1_amf AMD AMF AV1 encoder (codec av1)
V....D av1_vaapi AV1 (VAAPI) (codec av1)
I don't know what it means but it's missing the final D for QSV
Mraedis
Mraedis5mo ago
Encoders:
V..... = Video
A..... = Audio
S..... = Subtitle
.F.... = Frame-level multithreading
..S... = Slice-level multithreading
...X.. = Codec is experimental
....B. = Supports draw_horiz_band
.....D = Supports direct rendering method 1
Encoders:
V..... = Video
A..... = Audio
S..... = Subtitle
.F.... = Frame-level multithreading
..S... = Slice-level multithreading
...X.. = Codec is experimental
....B. = Supports draw_horiz_band
.....D = Supports direct rendering method 1
I don't think that's an issue
Sam___D
Sam___DOP5mo ago
I think I'm going for VP9 for now then so that I get hw decoding/encoding. The error message that Immich gives seems to be incorrect. Thanks for your time @Mraedis !!! I wish I could repay the favour!
Mraedis
Mraedis5mo ago
No need, have a nice day 🙂 https://github.com/immich-app/immich/pull/14611 this seems relevant for you @Sam___D
Immich
Immich5mo ago
[Pull Request] fix(server): partial fallback for hardware transcoding (immich-app/immich#14611)
Sam___D
Sam___DOP5mo ago
I saw 😄 thanks! FWIW the AV1 is also failing in Jellyfin (I just configured it) hmm it's also not in the list, don't know where I got this from
Mraedis
Mraedis5mo ago
I looked it up myself and it was checked for UHD770 Ohhh it 's decode only Missed that
sogan
sogan5mo ago
Yeah the desktop chips don't get AV1 encode

Did you find this page helpful?