Intel Graphics - Best practices and settings for hardware acceleration?

An update:

I upgraded to Fedora 36 beta yesterday which comes with a number of upgrades to the underlying hardware acceleration stack. intel-media-driver, gstreamer, oneVPL, and more all show updated packages in F36.

Now when I play videos with Totem (the built-in video player called Videos that runs on top of gstreamer), both Video AND VideoEnhance are activated!

This is what tells me that hardware acceleration is finally taking advantage of the hardware.

MPV and VLC still only use the Video engine so there are updates that need to still be made to FFMPEG and VLC (and browsers in general) but it looks like gstreamer is the most mature option for gen12+ graphics so far.

One interesting thing to note: Gnome Web, the web browser formerly called Epiphany, was touted to have full hardware acceleration support in Gnome 42 as well but it continues to have a glitch where videos are green and contain corrupted info from the GPU. I believe Gnome Web is also backed by gstreamer so I’m not sure why acceleration works in Videos but not Web.

3 Likes

Is there any meaningful advantage in doing this for older CPU’s? Like 5th gen i7?

These steps are just to make sure that you are using your laptop hardware at full throttle, every inch of it from every corner. (if that make sense)

1 Like

That’s a very good documentation of the process.

One note still, I would like to update.
There should be no need to “hardcode” the driver to iHD. it should be autodetected automatically and iHD (intel-media-driver) should be choosen by default as soon as the correct hardware is used.
(there is a previous bug in early fc35 that because of the switch to iris, some card didn’t used the appropriate driver, but it’s now fixed upstream.

The long term is that if there is an even better driver for some hw, having iHD hardcoded on end-users system will block them from using the more appropriate driver.

Thank in advance to remove this mention.

1 Like

That’s good to know that it was fixed upstream. Unfortunately I can’t edit the original post anymore though, I think edits can only be made within a certain timeframe after posting.

I believe that’s based on your user level. At the next level up, you can edit for up to one month:

1 Like

It seesm atleast on my hardware (10th gen intel) this part is not working:

options i915 enable_guc=3

after reboot when I check the dmesg i get this:

[    2.084958] Setting dangerous option enable_guc - tainting kernel
[    2.085550] i915 0000:00:02.0: [drm] Incompatible option enable_guc=3 - GuC submission is N/A
[    2.180501] i915 0000:00:02.0: [drm] GuC firmware i915/kbl_guc_62.0.0.bin version 62.0 submission:disabled
1 Like

welcome to ask :fedora:

The first line that tells you it is tainting kernel is related to secure boot and an out-of-tree module.
The second line says that option is incompatible. What is it supposed to do? Have you checked the available and functional modes that do work? Do you need that option? Most have no issues with the intel IGP and drivers.

Please provide a bit more info about the video. inxi -Fzx will assist us, as will lsmod | grep i915

1 Like

options i915 enable_guc=3 doesn’t work for me either on 8th gen Intel.

So, I set options i915 enable_guc=2 to enable HuC.

1 Like

Very useful info, thanks for posting.

It’s not actually related to secure boot and there’s no out-of-tree module in this case. It’s just that kernel developers decided that enabling this particular non-default option makes debugging eventual issues too difficult or impossible as the option itself may cause issues. See Tainted kernels — The Linux Kernel documentation for more details.

1 Like

According to the link in the first post, GuC/HuC are only available from Gen9 processors, so it should be safer to skip this part as Gen8 (or less) users.

3 Likes

Thanks a lot! Worked like a charm for getting HD video playback working in gwenview (before hd-video was laggy/stuttering with every player except VLC).

One additional question: with Fedora 37 it has been announced that hardware video acceleration for x264 and x265 will be dropped (due to legal reasons) - does anybody know if that means that vaapi will no longer work? Efficient video playback is one of the central tasks of any OS - so dropping this will probably force me to review my distro choice. Thanks!

1 Like

The rpmfusion mesa drivers (mesa-freeworld) just hit testing, so it looks like they will be available.

2 Likes

Sounds good, thanks! Fedora is clearly my favorite distro running perfectly on my brandnew laptop (HP envy x360 - although opensuse does since 10 yrs a good job on my desktop PC). So I will wait a little bit and then see …

https://discussion.fedoraproject.org/t/firefox-using-more-cpu-while-playing-videos/27927/14?u=ozeszty

1 Like

Work in progress … Alder Lake is a glimpse of heterogeneous hybrid CPU/GPU giving sense to DPC++ being kernel programming similar to NVidia Cuda extension of C++ or modern C++ 20 and further. Debian blindly refuses to install whatever you try, CentOS Stream is fine. A lot of people will need to repackage, rewrite code to take full advantage of new hardware falling back to compatibility mode by default, FLEX is the new hardware GPU for data centers, ARC for general purpose configuration.

1 Like

For some clarification about the modprobe config, the Intel Graphics for Linux website (originally posted by @beuraud) says the correct line is i915.enable_guc=2 for 12th-gen Alder Lake-S (desktop) chips and earlier, whereas i915.enable_guc=3 is for Alder Lake-P (laptop) chips and later, though in this setting the config is potentially unnecessary as it’s enabled by default.

The reason for the i915.enable_guc=3 line is to ensure that HuC is also enabled along with GuC.

It’s a bit odd since the ArchWiki page also seems to imply that HuC is not supported on Tigerlake (which I have) but my dmesg lines show the following:

[    2.841002] i915 0000:00:02.0: [drm] GuC firmware i915/tgl_guc_70.1.1.bin version 70.1
[    2.841011] i915 0000:00:02.0: [drm] HuC firmware i915/tgl_huc_7.9.3.bin version 7.9
[    2.844385] i915 0000:00:02.0: [drm] HuC authenticated
[    2.844777] i915 0000:00:02.0: [drm] GuC submission enabled
[    2.844778] i915 0000:00:02.0: [drm] GuC SLPC enabled
[    2.845358] i915 0000:00:02.0: [drm] GuC RC: enabled

So it does seem like the i915.enable_guc=3 line does enable both GuC and HuC on all 12th gen Intel graphics (not to be confused with Intel processor generations) and Tigerlake is in that generation.

Definitely confusing though and I could be wrong myself.

Read the notice at the beginning of linked ArchWiki paragraph.