Ubuntu Intel N5105 QSV HW Transcoder not detected

Debian seemed to work for me, I couldn’t install Ubuntu on my Odroid H3.

The following steps will outline the install process to enable N5105 Plex Hardware Transcoding. At the time this was written, Plex was aroud 1.31.x and didn’t support Linux 5.15+. My solution involves installing Debian 11.5 which is Linux 5.10. Cheers!

— Install notes

Install Debian 11.5, I use the net install: https://cdimage.debian.org/mirror/cdimage/archive/11.5.0/amd64/iso-cd/debian-11.5.0-amd64-netinst.iso

1.) Install Intel i915 driver (part of firmware-linux-nonfree)

edit etc/apt/sources to include non-free

su -l
vi /etc/apt/sources.list

comment this line

deb Index of /debian bullseye main

add this line:

deb Index of /debian bullseye main non-free

apt update
apt install firmware-linux-nonfree

2.) Configure Intel driver

add force_probe and enable_guc to /etc/modprobe.d/i915.conf

su -l
vi /etc/modprobe.d/i915.conf

options i915 force_probe=4e61
options i915 enable_guc=2

update-initramfs -u

2.) Install plex

su -l
apt install gpg
wget -O- https://downloads.plex.tv/plex-keys/PlexSign.key | gpg --dearmor | tee /usr/share/keyrings/plex.gpg
echo deb [signed-by=/usr/share/keyrings/plex.gpg] https://downloads.plex.tv/repo/deb public main | tee /etc/apt/sources.list.d/plexmediaserver.list

apt update
apt install plexmediaserver
reboot now

— why?

why options i915 force_probe=4e61?

force_probe=4e61 is required because the default 5.10 kernel doesn’t seem to like the Intel drive, so it needs to be forced to load. Run dmesg after installing firmware-linux-nonfree to see this…

su -l
dmesg > dmesg.txt
vi dmesg.txt

[ 2.916017] i915 0000:00:02.0: Your graphics device 4e61 is not properly supported by the driver in this
kernel version. To force driver probe anyway, use i915.force_probe=4e61
module parameter or CONFIG_DRM_I915_FORCE_PROBE=4e61 configuration option,
or (recommended) check for kernel updates.

what options i915 enable_guc=2?

enable_guc=2 is required because Plex hardware transcoding seems to need “HuC load” configured. To determine “Huc load” look at the output of modinfo i915.

su -l
modinfo i915 | grep guc
firmware: i915/skl_guc_33.0.0.bin
firmware: i915/bxt_guc_33.0.0.bin
firmware: i915/kbl_guc_33.0.0.bin
firmware: i915/glk_guc_33.0.0.bin
firmware: i915/kbl_guc_33.0.0.bin
firmware: i915/cml_guc_33.0.0.bin
firmware: i915/icl_guc_33.0.0.bin
firmware: i915/ehl_guc_33.0.4.bin
firmware: i915/tgl_guc_35.2.0.bin
firmware: i915/tgl_guc_35.2.0.bin
parm: enable_guc:Enable GuC load for GuC submission and/or HuC load. Required functionality can be selected using bitmask values. (-1=auto, 0=disable [default], 1=GuC submission, 2=HuC load) (int)
parm: guc_log_level:GuC firmware logging level. Requires GuC to be loaded. (-1=auto [default], 0=disable, 1…4=enable with verbosity min…max) (int)
parm: guc_firmware_path:GuC firmware path to use instead of the default one (charp)

Hi @ChuckPa and everyone else!

I’m also having no luck making the N5105 to transcode using HW acceleration. I’ve tried Arch, Debian, Ubuntu, Windows, Docker and also Kubernetes, both the official and Linuxserver images, but so far I haven’t been able to make it hw transcode.

At first I thought that my processor was at fault, as this was a new Mini PC I ordered purposefuly to use as a K8s node and run Plex server on that node, so I tested everything I could think of and even ordered a second one. Both of them are able to transcode if I use ffmpeg. Just in case this is relevant, the command that worked for me was this one:

ffmpeg -hwaccel qsv -c:v hevc_qsv -i input.mkv -c:v h264_qsv -vf “scale_qsv=w=1920:h=1080:format=nv12” output.mp4

I’ve also followed the Jellyfin documentation regarding the Low Power mode to no avail.

But having determined that the devices are indeed not only transcoding but producing non-garbage results, I am reasonably certain I have ruled out both OS and hardware as the culprits.

Any insights will be appreciated. Let me know if more information is needed.

The logs are from a freshly installed Ubuntu 22.04 running Linuxserver’s image in Docker. I’d gladly try any and share logs for any other combination if needed.

Plex Media Server Logs_2023-04-18_14-27-54.zip (427.5 KB)

You could be facing different issues in each of the environments in which you tested. However, in this case (Linuxserver.io Docker image) it appears that the Intel drivers are unable to open the underlying hardware device.

Apr 18, 2023 13:52:03.691 [0x7f6d7e6c6b38] DEBUG - [Req#143/Transcode] Codecs: hardware transcoding: testing API vaapi
Apr 18, 2023 13:52:03.715 [0x7f6d7e6c6b38] ERROR - [Req#143/Transcode] [FFMPEG] - libva: /usr/lib/plexmediaserver/lib/dri/iHD_drv_video.so init failed
Apr 18, 2023 13:52:03.720 [0x7f6d7e6c6b38] ERROR - [Req#143/Transcode] [FFMPEG] - libva: /usr/lib/plexmediaserver/lib/dri/i965_drv_video.so init failed
Apr 18, 2023 13:52:03.720 [0x7f6d7e6c6b38] ERROR - [Req#143/Transcode] [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error).
Apr 18, 2023 13:52:03.720 [0x7f6d7e6c6b38] DEBUG - [Req#143/Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: I/O error
Apr 18, 2023 13:52:03.720 [0x7f6d7e6c6b38] DEBUG - [Req#143/Transcode] Could not create hardware context for h264_vaapi

That error, and a similar one for the decoder, is present several times in the logging.

Did you pass /dev/dri to the container, and ensure that the Plex user was a member of the appropriate groups to access the devices contained within?

@Nahue and all following here:

The Intel Media Driver, which is needed to properly support these N-series CPUs, is being updated.

We had a few challenges to overcome first. The Linux side of this is now proceeding.

I don’t know when it will be available (which PMS release) and I loathe saying ‘soon’ but it is being updated now.

As soon as I get a test build (or if Engineering offers a Preview thread), I’ll let everyone know.

It will :crossed_fingers: be VERY shortly.

@Nahue

JellyFin’s implementation doesn’t apply here. While FFMPEG based; the implementation is different and would only serve to confuse.

1 Like

I’m using a Celeron N5105 on one of my servers right now with hardware acceleration, with the latest Plex Media Server beta (1.32.0.6950). I don’t use docker on this particular server; it’s running the native Ubuntu/Debian package. It can definitely work in its current form.

@pshanew /dev/dri was passed and permissions were good, I could use ffmpeg to transcode within the container. In any case, I’ll try Ubuntu and the current beta build.

Otherwise I think I’ll be patient and wait for the release @ChuckPa mentioned.

Jellyfin documentation was kind of a last resort, I figured if that was relevant it would have been present on Plex’s documentation too, but didn’t hurt to try :smile:

Thanks!

If it helps, I use Pop!_OS on this particular server. They’re currently on Linux kernel version 6.2.6, which may be relevant. When I initially set this up, I had to enable GuC/HuC in the i915 module configuration (@ChuckPa created a Linux Tip for how to do this) and manually add the latest available kernel firmware for Jasper Lake processors’ integrated graphics. I’m not sure if that’s required any longer, the firmware packages may have been updated in the interim.

1 Like

As an status update, it didn’t work. I guess I’ll wait for the confirmation on Plex’s side that this should be working now. Thank you again for your help!

ALL:

I have a developer build with the updated Intel Media Driver.

I will transfer to my Gdrive for you to download

Please let me know what’s needed so I don’t transfer the entire build

I have this one:

and this one

1 Like

ALL:

I have confirmation of AlderLake N100 working.

May I please also have confirmation of these N and J series working?

It’s still hardware transcoding (and tone mapping) fine on my Celeron N5105-based (Jasper Lake) system using the build you provided above (native .deb package on Pop!_OS 22.04 LTS, kernel version 6.2.6).

image

@pshanew

Great… thank you for confirming. The above contains the much-needed Intel Media Driver update which impacts everyone.

I want to know make certain ALL the 5xxx and 4xxx CPUs are working before this becomes production for everyone.

1 Like

I can confirm an N95 working fine.
I still have no luck getting the N5105 to hw transcode. This is with a completely fresh Ubuntu 22.04, just

apt update
apt full-upgrade -y

afterwards installing the build @ChuckPa shared, but it is still resorting to software transcodes.

I’m getting the “No matching devices found.” error

Following this allowed the hw transcoding to work, but it is transcoding to SD for some reason.

HW Transcoding not working logs (295.7 KB)

HW Transcoding working with enable_guc=2 (366.2 KB)

I’ll gladly run as many tests as needed

@Nahue

We used the very latest Intel Media Driver. (it drops right in)

Back down and run the basics.

Can it transcode 1080p ?
Can it transcode H.264 2160p ?

I ask this because I’m not 100% certain that chip can do HEVC HDR

The problem is right here:

Processor Graphics Intel® UHD Graphics
Ref: Intel® Celeron® Processor N5105

The errors seen are in the OpenCL component. It fails to respond to commands (tonemapping)

Compare that to an i7-7700 and you see a completely different description and capability spec.

ALL 5105 owners:

I would like to gather some failure captures of the N5105 failing to transcode.

The specific tests I request

  1. 1080p H.264 – basic HW transcode
  2. 2160p H.264 or HEVC – Tone mapping turned OFF (or not applicable)
  3. 2160p HEVC tone mapping.

Only need a few seconds of each.

I’m asking this because the engineer and I are working on the updates now.
we’d like to get as much completed as possible.

@ChuckPa there you go.

  1. A 1080p transcoded to both 720p and 480p (first two small peaks on the CPU graph)
  2. A 2160p HECV to 1080p with tone mapping turned off
  3. Same 2160p HEVC to 1080p with tone mapping turned on

None of those managed to use hw transcoding. I reinstalled a fresh Ubuntu 22.04 to eliminate any possibility of intel-media-va-driver-non-free to skew the results.

Plex Media Server Logs_2023-04-24_14-30-37.zip (218.0 KB)

1 Like

Hello, I have a N5105 on Ubuntu 22.04 with 5.19.0 Kernel, Plex Version 1.32.3.7162 and I also cannot have HW transcoding enabled. Updates have been made since April? I’m a linux noobie so i’m struggling to understand everything on this topic.

Hello,

I manage to finally make it work by using 5.16 kernel and doing those steps :
Create and then edit the file:

/etc/modprobe.d/i915.conf
Add the line below and save the file:

options i915 enable_guc=2
then run this command:

sudo update-initramfs -u

Every video is transcoding well in HW mode :).
Only issues remaining is that it buffers when I have subtitles, i’ll have to get into that

1 Like

subtitle buffering is because the CPU isn’t fast enough to keep up with the realtime demand.

Look very carefully at the subtitle type AND the player settings.

  1. Subtitle PGS, VOBSUB, or DVDRIP – require burning because they are images.
  2. Subtitle SRT, ASS, and SSA – are text and only burn if the player requests burning.

Remuxing files (to remove tracks you don’t need) is a good start.
Replacing image based with text based subtitles is best if you need subtitles.

Setting Players to “Automatic” subtitles keeps ‘burn’ requests to a minimum.

Hello Chuck,

Thank you for your return, I use only SRT subtitles.
And it’s working very fine with every settings on Firefox PC or via the Android application on my Huawei P30 PRO.
However on XBOX Series X or Nvidia Shield app, it’s not working correctly.
On the XBOX whenever I try to read subtitles it freezes and it’s impossible to read anything, when subtitles are deactivated, it’s smooth, either on original quality or transcoded.
On the Shield, it’s stranger, as it freeze the first time I try to read subtitles, but when I deactivate and then reactivate them, it works…

Regards,

Thibaut