Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This gist will show you how to tune your Intel-based Skylake, Kabylake and beyond Integrated Graphics Core for performance and reliability through GuC and HuC firmware usage on Linux.

Tuning Intel Skylake and beyond for optimal performance and feature level support on Linux:

Note that on Skylake, Kabylake (and the now cancelled "Broxton") SKUs, functionality such as power saving, GPU scheduling and HDMI audio have been moved onto binary-only firmware, and as such, the GuC and the HuC blobs must be loaded at run-time to access this functionality.

Enabling GuC and HuC on Skylake and above requires a few extra parameters be passed to the kernel before boot.

Instructions provided for both Fedora and Ubuntu (including Debian):

Note that the firmware for these GPUs is often packaged by your distributor, and as such, you can confirm the firmware blob's availability by running:

1. On Fedora:

rpm -ql linux-firmware | fgrep i915

Sample output:

/usr/lib/firmware/i915 
/usr/lib/firmware/i915/bxt_dmc_ver1_07.bin 
/usr/lib/firmware/i915/kbl_dmc_ver1.bin
/usr/lib/firmware/i915/kbl_dmc_ver1_01.bin 
/usr/lib/firmware/i915/skl_dmc_ver1_23.bin 
/usr/lib/firmware/i915/skl_guc_ver1.bin 
/usr/lib/firmware/i915/skl_guc_ver4.bin 
/usr/lib/firmware/i915/skl_guc_ver6.bin 
/usr/lib/firmware/i915/skl_guc_ver6_1.bin 
/usr/share/doc/linux-firmware/LICENSE.i915

2. On Ubuntu:

dpkg -L linux-firmware | fgrep i915

It may be wise to install the linux-firmware-nonfree package as it may contain extra firmware blobs on Ubuntu releases prior to 16.04LTS. Don't install this on 16.04LTS and above.

Now, to the real meat:

See the supported module options:

Let's see if the features we're after are supported:

sudo modinfo i915 | egrep -i "guc|huc|dmc"

firmware:       i915/bxt_dmc_ver1_07.bin
firmware:       i915/skl_dmc_ver1_27.bin
firmware:       i915/kbl_dmc_ver1_04.bin
firmware:       i915/glk_dmc_ver1_04.bin
firmware:       i915/cnl_dmc_ver1_07.bin
firmware:       i915/icl_dmc_ver1_07.bin
firmware:       i915/kbl_guc_ver9_39.bin
firmware:       i915/bxt_guc_ver9_29.bin
firmware:       i915/skl_guc_ver9_33.bin
firmware:       i915/kbl_huc_ver02_00_1810.bin
firmware:       i915/bxt_huc_ver01_8_2893.bin
firmware:       i915/skl_huc_ver01_07_1398.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)
parm:           huc_firmware_path:HuC firmware path to use instead of the default one (charp)
parm:           dmc_firmware_path:DMC firmware path to use instead of the default one (charp)

Note: The intel_pstate driver is the default since Linux 4.10 on SKL+. Thanks for the updates on this @pcordes and the correction on module options syntax in /etc/modprobe.d/i915.conf, @vinzent. Gr33ts ;-)

Then, update grub on Fedora:

(Run commands as root):

For EFI boot (More common):

grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

And if you're still booting up in legacy BIOS mode on an MBR-style partitioning scheme or with CSM enabled on Fedora for whatever reason:

grub2-mkconfig -o /boot/grub2/grub.cfg

Then rebuild initramfs:

On Fedora:

dracut --force

On Debian-based distributions:

Simply run:

sudo update-initramfs

update-grub

Then reboot.

Your modern Intel HD Graphics processor graphics will work just fine.

You can also add this to: /etc/modprobe.d/i915.conf

In the following syntax:

options i915 enable_guc=3

Other safe options to pass are enable_fbc=1.

Reference:

See modinfo output for i915 for available GuC options:

modinfo i915 | grep guc

Further notes:

A list of all options along with short descriptions and default values can be generated with the following command:

$ modinfo -p i915

To check which options are currently enabled, run:

# systool -m i915 -av

You will note that many options default to -1, resulting in per-chip power-saving defaults. It is however possible to configure more aggressive powersaving by using module options. Warning: Diverting from the defaults will mark the kernel as tainted from Linux 3.18 onwards. This basically implies using other options than the per-chip defaults is considered experimental and not supported by the developers.

The following set of options should be generally safe to enable:

/etc/modprobe.d/i915.conf

options i915 enable_fbc=1 enable_guc=3

On Linux 4.16+, GuC firmware loading and submission is now handled by the enable_guc parameter in place of the former enable_guc_loading=1 and enable_guc_submission=1 parameters. Adjust as needed.

RC6 sleep modes (enable_rc6):

You can experiment with higher values for enable_rc6, but your GPU may not support them or the activation of the other options:

The available enable_dc values are a bitmask with bit values RC6=1, RC6p=2, RC6pp=4[4] - where "RC6p" and "RC6pp" are lower power states.

To confirm the current running RC6 level, you can look in sysfs:

# cat /sys/class/drm/card0/power/rc6_enable

If the value read is a lower number than expected, the other RC6 level are probably not supported. Passing drm.debug=0xe to the kernel boot options will add DRM debugging information to the kernel log - possibly including a line like this:

[drm:sanitize_rc6_option] Adjusting RC6 mask to 1 (requested 7, valid 1)

Framebuffer compression (enable_fbc):

Framebuffer compression may be unreliable or unavailable on Intel GPU generations before Sandy Bridge (generation 6). This results in messages logged to the system journal similar to this one:

kernel: drm: not enough stolen space for compressed buffer, disabling.

Tear-free video:

With the SNA acceleration method enabled, tearing may be observed. To fix this, enable the "TearFree" option in the driver by adding the following line to your xorg.conf (or ideally, a sub-configuration file under xorg.conf.d) configuration file:

Option "TearFree" "true"

This is not needed on server-grade SKUs where Xorg is unwelcome.

Debugging:

Simply inspect dmesg:

dmesg | grep drm

And also look at the output of:

journalctl -b -o short-monotonic -k

To confirm that the settings you wanted have been applied, run:

dmesg | grep -iE "huc|guc|dmc"

Output may look like this:

[    2.014699] Setting dangerous option enable_guc - tainting kernel
[    2.019971] [drm] Finished loading DMC firmware i915/kbl_dmc_ver1_04.bin (v1.4)
[    2.030651] [drm] HuC: Loaded firmware i915/kbl_huc_ver02_00_1810.bin (version 2.0)
[    2.040648] [drm] GuC: Loaded firmware i915/kbl_guc_ver9_39.bin (version 9.39)
[    2.051850] i915 0000:00:02.0: GuC firmware version 9.39
[    2.051850] i915 0000:00:02.0: GuC submission enabled
[    2.051851] i915 0000:00:02.0: HuC enabled

Which means you're good to go.

You can also take a look at:

  1. GuC load status:
sudo cat /sys/kernel/debug/dri/0/i915_guc_load_status
GuC firmware: i915/kbl_guc_ver9_39.bin
	status: fetch SUCCESS, load SUCCESS
	version: wanted 9.39, found 9.39
	header: offset 0, size 128
	uCode: offset 128, size 147392
	RSA: offset 147520, size 256

GuC status 0x800330ec:
	Bootrom status = 0x76
	uKernel status = 0x30
	MIA Core status = 0x3

Scratch registers:
	 0: 	0xf0000000
	 1: 	0x1
	 2: 	0xc
	 3: 	0x0
	 4: 	0x2
	 5: 	0x0
	 6: 	0x7f2000
	 7: 	0x8
	 8: 	0x3
	 9: 	0x403240
	10: 	0x0
	11: 	0x0
	12: 	0x0
	13: 	0x0
	14: 	0x0
	15: 	0x0
  1. HuC load status:
sudo cat /sys/kernel/debug/dri/0/i915_huc_load_status
 HuC firmware: i915/kbl_huc_ver02_00_1810.bin
	status: fetch SUCCESS, load SUCCESS
	version: wanted 2.0, found 2.0
	header: offset 0, size 128
	uCode: offset 128, size 218304
	RSA: offset 218432, size 256

HuC status 0x00006080:

Also see: https://01.org/linuxgraphics/downloads/firmware

Screen corruption observed when waking up from suspend

This is often observed as font and screen corruption in GTK+ applications (missing glyphs after suspend/resume).

Should you experience missing font glyphs in GTK+ applications, the following workaround might help. Edit /etc/environment to add the following line:

/etc/environment
COGL_ATLAS_DEFAULT_BLIT_MODE=framebuffer

See this bug here for more details.

Thanks and regards,

Brainiarc7

@j0nny55555

This comment has been minimized.

Copy link

commented May 1, 2017

Which configuration file needs the tear free option?

@Brainiarc7

This comment has been minimized.

Copy link
Owner Author

commented May 19, 2017

The xorg.conf file. Updated to reflect that.

@josedellabosca

This comment has been minimized.

Copy link

commented Aug 2, 2017

Thanks for the info, now i have enabled guc and huc firmware in gentoo.
Do you happen to now why are disk unrecognized (kernel panic) if i set the gpu as modules in the kernel?

thanks

@Brainiarc7

This comment has been minimized.

Copy link
Owner Author

commented Aug 3, 2017

Hello @josedellabosca,

No.

It might be a bug in the kernel package you're running.

@pcordes

This comment has been minimized.

Copy link

commented Aug 27, 2017

In recent kernels (for example 4.12), intel_pstate=skylake_hwp isn't listed as an option (https://github.com/torvalds/linux/blob/v4.12/Documentation/admin-guide/kernel-parameters.txt#L1604). Maybe it was removed, but that string doesn't appear in the source anywhere.

The pstate driver Just Works on my desktop (using hwp), and has since at least 4.10 (when I got this hardware) without using any options.

@pcordes

This comment has been minimized.

Copy link

commented Aug 27, 2017

On my Skylake i7-6700k, I'm getting

[drm:i915_gem_init_stolen [i915]] *ERROR* conflict detected with stolen region: [0x00000000c0000000 - 0x00000000c8000000]

in my kernel log, with i915 options all at their default settings. (Linux 4.12.8-2-ARCH, but I've seen this on 4.10 and 11). My firmware blobs are the latest versions.

Am I missing out on any performance here? Linux drm loads the DMC 1.26 firmware, but I guess GuC may not even be enabled by default?

@Brainiarc7

This comment has been minimized.

Copy link
Owner Author

commented Aug 29, 2017

So, according to commit 023f807989f4d6a076258f4efe6d1da0d7aaeb29
Author: Daniel Vetter daniel.vetter@ffwll.ch
Date: Wed Jul 19 12:00:43 2017 +0200

drm/i915: More stolen quirking 

The regression you're seeing should be fixed.

You may want to run the latest Xorg and Mesa stack on your host. If you're on Ubuntu, run the xorg-edgers PPA and the Oibaf PPA.

Since you seem to be on Arch, keep your host machine up to date. By default, Arch runs the latest and greatest mesa stack available.

@GrayJack

This comment has been minimized.

Copy link

commented Nov 22, 2017

Do i need to something else to these parameter to take place? I rebooted and they didn't take place.
I'm in an Manjaro install

@Brainiarc7

This comment has been minimized.

Copy link
Owner Author

commented Nov 27, 2017

Hello @GrayJack,

What kernel version are you running?
And what's the output of lspci ?

@GrayJack

This comment has been minimized.

Copy link

commented Jan 17, 2018

I'm running the 4.14.13 right now
lspci:
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers (rev 02) 00:02.0 VGA compatible controller: Intel Corporation HD Graphics 620 (rev 02) 00:08.0 System peripheral: Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th Gen Core Processor Gaussian Mixture Model 00:14.0 USB controller: Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller (rev 21) 00:14.2 Signal processing controller: Intel Corporation Sunrise Point-LP Thermal subsystem (rev 21) 00:16.0 Communication controller: Intel Corporation Sunrise Point-LP CSME HECI #1 (rev 21) 00:17.0 SATA controller: Intel Corporation Sunrise Point-LP SATA Controller [AHCI mode] (rev 21) 00:1c.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #1 (rev f1) 00:1c.1 PCI bridge: Intel Corporation Device 9d11 (rev f1) 00:1d.0 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port #9 (rev f1) 00:1f.0 ISA bridge: Intel Corporation Sunrise Point-LP LPC Controller (rev 21) 00:1f.2 Memory controller: Intel Corporation Sunrise Point-LP PMC (rev 21) 00:1f.3 Audio device: Intel Corporation Sunrise Point-LP HD Audio (rev 21) 00:1f.4 SMBus: Intel Corporation Sunrise Point-LP SMBus (rev 21) 01:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTL8411B PCI Express Card Reader (rev 01) 01:00.1 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 12) 02:00.0 Network controller: Intel Corporation Wireless 3165 (rev 81) 03:00.0 Non-Volatile memory controller: Device 1987:5007 (rev 01)

@skhilko

This comment has been minimized.

Copy link

commented Feb 19, 2018

Thanks for the great guide! According to this article https://www.pcworld.com/article/3173618/linux/kaby-lake-is-unleashed-with-kernel-410.html intel_pstate should not be needed since Linux 4.10

@vinzent

This comment has been minimized.

Copy link

commented Feb 27, 2018

options i915.enable_guc_loading=1 i915.enable_guc_submission=1

needed to be

options i915 enable_guc_loading=1 enable_guc_submission=1

and the initramfs had to be rebuilt (dracut --force on Fedora)

now cat /sys/kernel/debug/dri/0/i915_guc_load_status finally shows that FW is loaded.

@snorchel

This comment has been minimized.

Copy link

commented Mar 21, 2018

Hello,
great guide! It seems that you know what you are talking about. I came to this guide, because I have been searching for solutions of my problem a lot. Maybe you could help me.
Background:
System: Host: lunex Kernel: 4.15.11-041511-generic x86_64 bits: 64 Desktop: Gnome 3.26.2 Distro: Ubuntu 17.10

Machine:   Device: laptop System: Dell product: Inspiron 5379 serial: N/A
           Mobo: Dell model: 09NT72 v: A00 serial: N/A UEFI [Legacy]: Dell v: 1.6.0 date: 01/31/2018
Battery    BAT0: charge: 29.7 Wh 74.4% condition: 39.9/42.0 Wh (95%)
CPU:       Quad core Intel Core i7-8550U (-HT-MCP-) cache: 8192 KB
           clock speeds: max: 4000 MHz 1: 770 MHz 2: 759 MHz 3: 753 MHz 4: 853 MHz 5: 754 MHz 6: 737 MHz
           7: 763 MHz 8: 793 MHz
Graphics:  Card: Intel UHD Graphics 620
           Display Server: x11 (X.Org 1.19.5 ) driver: i915 Resolution: 1920x1080@60.00hz, 2048x1080@60.00hz
           OpenGL: renderer: Mesa DRI Intel UHD Graphics 620 (Kabylake GT2) version: 4.5 Mesa 17.3.6 - padoka PPA
Audio:     Card Intel Sunrise Point-LP HD Audio driver: snd_hda_intel Sound: ALSA v: k4.15.11-041511-generic
Network:   Card: Intel Wireless 3165 driver: iwlwifi
           IF: wlp1s0 state: up mac: 44:03:2c:d8:69:a9
Drives:    HDD Total Size: 512.1GB (33.3% used)
           ID-1: /dev/sda model: LITEON_CV3 size: 512.1GB
Partition: ID-1: / size: 469G used: 159G (36%) fs: ext4 dev: /dev/sda1
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 47.0C mobo: N/A
           Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 312 Uptime: 9 min Memory: 2028.0/15655.7MB Client: Shell (bash) inxi: 2.3.37

The problem is, when i connect external monitor trough HDMI, it gives me only 2048x1080, but monitor is 2560x1440. Tried different cables, monitors, different solutions on web, none of that worked for me.
I'm on Ubuntu 17.10, but tried other distributions - same. On windows it works fine.

Maybe somebody here could point me to the solution.
Thanks a lot.

@zd59

This comment has been minimized.

Copy link

commented Mar 28, 2018

Hello Brainiarc7!

Your manual above is extremely helpful! Than you so much.
Now that I set up my system right, I have two unresolved items.
Would you be so kind to help me with. Take a look at a link:

https://www.linuxquestions.org/questions/slackware-14/slackware64-14-2-i5-7200u-hardware-video-acceleration-problem-4175625326/page2.html#post5836394

Regards

@Brainiarc7

This comment has been minimized.

Copy link
Owner Author

commented Mar 29, 2018

Hello @zd59,

I noticed that your question mentions VLC.

Note that for VLC, they explicitly support VAAPI-based decoding through a specific libva branch ONLY. If this has changed (and does not reflect the content on the Wiki), I'll be glad to retest and verify.

@Brainiarc7

This comment has been minimized.

Copy link
Owner Author

commented Mar 29, 2018

@snorchel ,

I'll follow up with the resolution issue you mentioned shortly.

First, can you provide the output of:

xrandr

And the make of your display?

@Brainiarc7

This comment has been minimized.

Copy link
Owner Author

commented Mar 29, 2018

Hello @snorchel,

With xrandr, try adding these modes and confirm if your display accepts them:

xrandr --newmode "2560x1440_60.00" 146.25 2560 2680 2944 3328 1440 1443 1448 1468 -hsync +vsync
xrandr --addmode Virtual1 2560x1440_60.00

Most likely your display is sending the wrong EDID data. But without a dmesg log (with drm debugging enabled) I cannot rule this out as the case.

@zd59

This comment has been minimized.

Copy link

commented Mar 29, 2018

Hello Brainiarc7

Regarding VLC and libva branch - the page mentioned on a VLC wiki is obsolete - do not exist.
New page https://github.com/gbeauchesne/libva and libva-intel-driver - those pages are also more than 3 years old and do not support Intel Kaby Lake.

I've tested VLC (below) with video output=OpenGL and vdpau.
OpenGL uses libva - video distorted, lower CPU and higher GPU usage
vdpau uses ibvdpau_va_gl - video perfect, higher CPU and lower GPU usage

vdpauinfo:

display: :0.0   screen: 0
libva info: VA-API version 1.1.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib64/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_1
libva info: va_openDriver() returns 0
API version: 1
Information string: OpenGL/VAAPI backend for VDPAU

name                        level macbs width height
----------------------------------------------------
MPEG1                          --- not supported ---
MPEG2_SIMPLE                   --- not supported ---
MPEG2_MAIN                     --- not supported ---
H264_BASELINE                  51 16384  2048  2048
H264_MAIN                      51 16384  2048  2048
H264_HIGH                      51 16384  2048  2048
VC1_SIMPLE                     --- not supported ---
VC1_MAIN                       --- not supported ---
VC1_ADVANCED                   --- not supported ---
MPEG4_PART2_SP                 --- not supported ---
MPEG4_PART2_ASP                --- not supported ---
DIVX4_QMOBILE                  --- not supported ---
DIVX4_MOBILE                   --- not supported ---
DIVX4_HOME_THEATER             --- not supported ---
DIVX4_HD_1080P                 --- not supported ---
DIVX5_QMOBILE                  --- not supported ---
DIVX5_MOBILE                   --- not supported ---
DIVX5_HOME_THEATER             --- not supported ---
DIVX5_HD_1080P                 --- not supported ---
H264_CONSTRAINED_BASELINE      51 16384  2048  2048
H264_EXTENDED                  --- not supported ---
H264_PROGRESSIVE_HIGH          --- not supported ---
H264_CONSTRAINED_HIGH          --- not supported ---
H264_HIGH_444_PREDICTIVE       --- not supported ---
HEVC_MAIN                      --- not supported ---
HEVC_MAIN_10                   --- not supported ---
HEVC_MAIN_STILL                --- not supported ---
HEVC_MAIN_12                   --- not supported ---
HEVC_MAIN_444                  --- not supported ---

vanfo:

libva info: VA-API version 1.1.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib64/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_1
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.1 (libva 2.1.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Kaby Lake - 2.1.0
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Simple            :	VAEntrypointEncSlice
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSliceLP
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointEncSliceLP
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointEncSliceLP
      VAProfileH264MultiviewHigh      :	VAEntrypointVLD
      VAProfileH264MultiviewHigh      :	VAEntrypointEncSlice
      VAProfileH264StereoHigh         :	VAEntrypointVLD
      VAProfileH264StereoHigh         :	VAEntrypointEncSlice
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileNone                   :	VAEntrypointVideoProc
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointEncPicture
      VAProfileVP8Version0_3          :	VAEntrypointVLD
      VAProfileVP8Version0_3          :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSlice
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileHEVCMain10             :	VAEntrypointEncSlice
      VAProfileVP9Profile0            :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointEncSlice
      VAProfileVP9Profile2            :	VAEntrypointVLD

video output: OpenGL (libva)
h.265 HD video CPU use 20%, GPU use 10%
h.264 HD video CPU use 2%, GPU use 10%

video output: vdpau (libvdpau_va_gl)
h.265 HD video CPU use 27%, GPU use 6%
h.264 HD video CPU use 10%, GPU use 7%

Tests:
ffmpeg-GIT-20180323

  built with gcc 5.5.0 (GCC)
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --docdir=/usr/doc/ffmpeg-20180323 --mandir=/usr/man --enable-gpl --enable-version3 --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libass --enable-libdc1394 --enable-libfribidi --enable-libgsm --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-libssh --enable-libspeex --enable-libtheora --enable-libv4l2 --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libzvbi --enable-postproc --enable-runtime-cpudetect --enable-sdl2 --enable-vaapi --enable-vdpau --enable-pthreads --enable-bzlib --enable-zlib --enable-shared --enable-static --disable-debug --enable-opengl --enable-libpulse --enable-libfdk-aac --enable-openssl --enable-nonfree --arch=x86_64 --enable-pic --extra-cflags='-I/tmp/build/tmp-ffmpeg/ffmpegdeps/usr/include -I/tmp/build/tmp-ffmpeg/ffmpegdeps/usr/include/SDL2 -DRUNTIME_CPUDETECT' --extra-ldflags='-L/tmp/build/tmp-ffmpeg/ffmpegdeps/usr/lib64 -ldl -lssl -lcrypto -lz -lusb -ldrm' --pkg-config-flags=--static --extra-libs=-lpthread
  libavutil      56. 11.100 / 56. 11.100
  libavcodec     58. 15.100 / 58. 15.100
  libavformat    58. 10.100 / 58. 10.100
  libavdevice    58.  2.100 / 58.  2.100
  libavfilter     7. 13.100 /  7. 13.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  0.102 /  5.  0.102
  libswresample   3.  0.101 /  3.  0.101
  libpostproc    55.  0.100 / 55.  0.100

h.265 HD video CPU use 20%, GPU use 5%
h.264 HD video CPU use 3%, GPU use 6%

At more demanding h.265 CPU usage rise to 50% and GPU use to12% - that is opposed as it should be - high GPU and low CPU usage.
Why? As GPU usage is not null, I suppose HW acceleration works but very low GPU utilisation. VLC works much better.

VLC-3.0.1

video output: OpenGL (libva)
h.265 HD video CPU use 20%, GPU use 10%
h.264 HD video CPU use 2%, GPU use 10%

video output: vdpau (libvdpau_va_gl)
h.265 HD video CPU use 27%, GPU use 6%
h.264 HD video CPU use 10%, GPU use 7%

At some other tests with h.265 video and VLC show 50% drop of CPU usage and about same GPU usage if used video output=OpenGL oposed output=vdpau.

Do you have any suggestions? My main goal is excellent HW acceleration with ffmpeg, VLC is not important to me.

Thanks in advance.

@brendanrankin

This comment has been minimized.

Copy link

commented Apr 1, 2018

On multiple modern/recent hires laptops it's necessary to set "i915.edp_vswing=2" on the i915 module. This is most certainly the case for the Razer Blade Stealth (late 2017 model), but it exists on others as well.

So, if you have a recent (Kaby Lake/Kaby Lake R) based laptop and are experiencing flickering that reminds you of poor TV reception from the 60s/70s (maybe even 80s), try this!

For me, the rest of the recommended i915 "flicker fixes" fail.

@miniworm

This comment has been minimized.

Copy link

commented Apr 10, 2018

Kernel 4.16 changes name of parameter needed to load GUC and HUC. New one is called enable_guc:

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)

So i915.enable_guc=-1should be added to /etc/default/grub (value "-1" works for me and loads GUC and HUC on my Kaby Lake i5-7200U).

@vietzerg

This comment has been minimized.

Copy link

commented May 4, 2018

So i915.enable_guc=-1should be added to /etc/default/grub (value "-1" works for me and loads GUC and HUC on my Kaby Lake i5-7200U).

@miniworm I set this options i915 enable_guc=1 into /etc/modprobe.d/i915.conf and check load status. GuC loaded successfully, but HuC did not load. Do you happen to know why?

(I have kernel 4.16.7 and the same CPU as yours. Using -1 did not work for me. So I tried 1.)

@Brainiarc7

This comment has been minimized.

Copy link
Owner Author

commented May 14, 2018

Thanks for the updates @miniworm and @vietzerg. I'll follow up with them.

As for @zd59,

Are you running the latest kernel + firmware blobs? I'll update the gist shortly with instructions for both.

@miniworm

This comment has been minimized.

Copy link

commented May 14, 2018

@vietzerg
My experience with adding options to /etc/modprobe.d/i915.conf is not so good (at least on my Ubuntu 16.04 and 18.04), simply it doesn't work, and that's why I've added option to /etc/default/grub. This way it always works for me.
Anyway IMHO this option with value 1 loads only GuC (the same way value 2 loads only HuC). That's why I've used -1 and it works for me.
The thing which surprises me is why default values is 0 not -1. Normally you don't need GuC&HuC loaded? Strange IMHO.

@Venemo

This comment has been minimized.

Copy link

commented May 23, 2018

Hi,

What happened to enable_rc6? modinfo does not offer it to me:

[root@timur-xps ~]# modinfo -p i915
modeset:Use kernel modesetting [KMS] (0=disable, 1=on, -1=force vga console preference [default]) (int)
panel_ignore_lid:Override lid status (0=autodetect, 1=autodetect disabled [default], -1=force lid closed, -2=force lid open) (int)
enable_dc:Enable power-saving display C-states. (-1=auto [default]; 0=disable; 1=up to DC5; 2=up to DC6) (int)
enable_fbc:Enable frame buffer compression for power savings (default: -1 (use per-chip default)) (int)
lvds_channel_mode:Specify LVDS channel mode (0=probe BIOS [default], 1=single-channel, 2=dual-channel) (int)
panel_use_ssc:Use Spread Spectrum Clock with panels [LVDS/eDP] (default: auto from VBT) (int)
vbt_sdvo_panel_type:Override/Ignore selection of SDVO panel mode in the VBT (-2=ignore, -1=auto [default], index in VBT BIOS table) (int)
reset:Attempt GPU resets (0=disabled, 1=full gpu reset, 2=engine reset [default]) (int)
vbt_firmware:Load VBT from specified file under /lib/firmware (charp)
error_capture:Record the GPU state following a hang. This information in /sys/class/drm/card<N>/error is vital for triaging and debugging hangs. (bool)
enable_hangcheck:Periodically check GPU activity for detecting hangs. WARNING: Disabling this can cause system wide hangs. (default: true) (bool)
enable_ppgtt:Override PPGTT usage. (-1=auto [default], 0=disabled, 1=aliasing, 2=full, 3=full with extended address space) (int)
enable_psr:Enable PSR (0=disabled, 1=enabled - link mode chosen per-platform, 2=force link-standby mode, 3=force link-off mode) Default: -1 (use per-chip default) (int)
alpha_support:Enable alpha quality driver support for latest hardware. See also CONFIG_DRM_I915_ALPHA_SUPPORT. (bool)
disable_power_well:Disable display power wells when possible (-1=auto [default], 0=power wells always on, 1=power wells disabled when possible) (int)
enable_ips:Enable IPS (default: true) (int)
fastboot:Try to skip unnecessary mode sets at boot time (default: false) (bool)
prefault_disable:Disable page prefaulting for pread/pwrite/reloc (default:false). For developers only. (bool)
load_detect_test:Force-enable the VGA load detect code for testing (default:false). For developers only. (bool)
force_reset_modeset_test:Force a modeset during gpu reset for testing (default:false). For developers only. (bool)
invert_brightness:Invert backlight brightness (-1 force normal, 0 machine defaults, 1 force inversion), please report PCI device ID, subsystem vendor and subsystem device ID to dri-devel@lists.freedesktop.org, if your machine needs it. It will then be included in an upcoming module version. (int)
disable_display:Disable display (default: false) (bool)
enable_cmd_parser:Enable command parsing (true=enabled [default], false=disabled) (bool)
mmio_debug:Enable the MMIO debug code for the first N failures (default: off). This may negatively affect performance. (int)
verbose_state_checks:Enable verbose logs (ie. WARN_ON()) in case of unexpected hw state conditions. (bool)
nuclear_pageflip:Force enable atomic functionality on platforms that don't have full support yet. (bool)
edp_vswing:Ignore/Override vswing pre-emph table selection from VBT (0=use value from vbt [default], 1=low power swing(200mV),2=default swing(400mV)) (int)
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)
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)
guc_firmware_path:GuC firmware path to use instead of the default one (charp)
huc_firmware_path:HuC firmware path to use instead of the default one (charp)
enable_dp_mst:Enable multi-stream transport (MST) for new DisplayPort sinks. (default: true) (bool)
enable_dpcd_backlight:Enable support for DPCD backlight control (default:false) (bool)
enable_gvt:Enable support for Intel GVT-g graphics virtualization host support(default:false) (bool)
@Brainiarc7

This comment has been minimized.

Copy link
Owner Author

commented May 25, 2018

@Venemo what version of the Linux kernel are you running?

@daenney

This comment has been minimized.

Copy link

commented May 27, 2018

enable_rc6 was removed towards the end of 2017. Afaik it's gone since 4.15.

@daenney

This comment has been minimized.

Copy link

commented May 27, 2018

I'd recommend setting enable_guc to -1 instead, i.e auto/let the driver detect what options are available instead of forcing it on. If that results in it not being enabled for your system there's probably a good reason for it. In my case that results in enable_guc = "3" according to systool -m i915 -av, both GuC and HuC. Annoyingly enough this still causes the kernel to be marked as tainted.

If you add the option to files in /etc/modprobe.d, remember that a lot of configurations pull in i915 into the initramfs so by the time the OS gets to reading your custom options it'll be too late. You'll need to either pass it as a kernel boot option (for example through GRUB) or rebuild the initramfs to include your i915.conf. For example if you're using mkinitcpio, issue an mkinitcpio -P after updating the config to include the following (and don't forget to rebuild after changing an option):

MODULES=(i915 intel_agp)
FILES=(/etc/modprobe.d/i915.conf)

Specifically for Ubuntu Bionic/18.04, you'll need to be in 4.15.0-23 (which is as of today still in bionic-proposed) or newer for firmware loading to work correctly due to: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1728238

Similarly, instead of putting the intel_pstate on the kernel boot options, check if it's not enabled already for you:

# cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_driver

If it returns intel_pstate just leave it be.

@Venemo

This comment has been minimized.

Copy link

commented May 28, 2018

@Brainiarc7 I'm running 4.17-rc6 currently.

@Brainiarc7

This comment has been minimized.

Copy link
Owner Author

commented Jun 8, 2018

Yes, that option has been removed.

I'll need to update the documentation as appropriate.

@rakeshkumar125

This comment has been minimized.

Copy link

commented Jul 6, 2018

I have also face same type of issue. But I don't know how to resolve it. Please help us.
https://drive.google.com/file/d/1SUQ1eKUppxJ-LLcFo7F2XicywH1LX2lj/view?usp=sharing

@Brainiarc7

This comment has been minimized.

Copy link
Owner Author

commented Nov 1, 2018

@rakeshkumar125,

Do you still have the issue above? And what hardware are you on?

@jsravn

This comment has been minimized.

Copy link

commented Feb 11, 2019

enable_guc=3 caused me a lot of problems with external monitors. Enable it with care.

@Brainiarc7

This comment has been minimized.

Copy link
Owner Author

commented Feb 15, 2019

@jsravn,

What's the make of your system, and what Linux kernel version are you running?

@Sparsa

This comment has been minimized.

Copy link

commented Mar 27, 2019

I don't have the option called
semaphore
enable_rc6
I am on kernel 5.0

@cement-head

This comment has been minimized.

Copy link

commented Mar 31, 2019

So, Just to be explicitly clear on i7 8565U Intel HD Whisky Lake (3x8) GT2; the command I need to pass to the kernel at boot should look like this:
Screenshot from 2019-03-31 09-00-47

@cement-head

This comment has been minimized.

Copy link

commented Mar 31, 2019

Yep, that did it:

$ sudo cat /sys/kernel/debug/dri/0/i915_guc_load_status

GuC firmware: i915/kbl_guc_ver9_39.bin
status: fetch SUCCESS, load SUCCESS
version: wanted 9.39, found 9.39
header: offset 0, size 128
uCode: offset 128, size 147392
RSA: offset 147520, size 256

GuC status 0x800330ed:
Bootrom status = 0x76
uKernel status = 0x30
MIA Core status = 0x3

Scratch registers:
0: 0xf0000000
1: 0x1
2: 0x0
3: 0x5f5e100
4: 0x0
5: 0x7f3fd3
6: 0x0
7: 0x8
8: 0x3
9: 0x403240
10: 0x0
11: 0x0
12: 0x0
13: 0x0
14: 0x0
15: 0x0

And for HuC:

$ sudo cat /sys/kernel/debug/dri/0/i915_huc_load_status
HuC firmware: i915/kbl_huc_ver02_00_1810.bin
status: fetch SUCCESS, load SUCCESS
version: wanted 2.0, found 2.0
header: offset 0, size 128
uCode: offset 128, size 218304
RSA: offset 218432, size 256

HuC status 0x00006080:

@kevindd992002

This comment has been minimized.

Copy link

commented May 14, 2019

I have a J5005 (Gemini Lake/Pentium Silver) CPU on an ASRock J5005-ITX board and my Linux distro is Debian Stretch with kernel 4.19. I'm a Linux noob and the output of dmesg | grep drm on my system is:

[ 4.382634] [drm] GuC: No firmware known for this platform!
[ 4.382636] [drm] HuC: No firmware known for this platform!
[ 4.382965] fb: switching to inteldrmfb from EFI VGA
[ 4.383153] [drm] Replacing VGA console driver
[ 4.383252] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 4.383253] [drm] Driver supports precise vblank timestamp query.
[ 4.384617] [drm] Applying Increase DDI Disabled quirk
[ 4.389008] [drm] Finished loading DMC firmware i915/glk_dmc_ver1_04.bin (v1.4)
[ 5.503849] [drm] failed to retrieve link info, disabling eDP
[ 5.506747] [drm] Initialized i915 1.6.0 20180719 for 0000:00:02.0 on minor 0
[ 5.539627] fbcon: inteldrmfb (fb0) is primary device
[ 5.697868] i915 0000:00:02.0: fb0: inteldrmfb frame buffer device

I tried editing /etc/modprobe.d/i915.conf and put this:

options i915 enable_guc=-1

Then I rebooted the system and checked dmesg again. I still have both no firmware known for this platform on GuC and HuC. What am I doing wrong?

If I use enable_guc=1, I get this:

[ 4.428202] [drm] GuC: No firmware known for this platform!
[ 4.428205] [drm] HuC: No firmware known for this platform!
[ 4.428207] [drm] Incompatible option detected: enable_guc=1, no GuC firmware!
[ 4.437202] fb: switching to inteldrmfb from EFI VGA
[ 4.440301] [drm] Replacing VGA console driver
[ 4.440612] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 4.440613] [drm] Driver supports precise vblank timestamp query.
[ 4.446661] [drm] Applying Increase DDI Disabled quirk
[ 4.447278] [drm] Finished loading DMC firmware i915/glk_dmc_ver1_04.bin (v1.4)
[ 5.556753] [drm] failed to retrieve link info, disabling eDP
[ 5.558296] [drm:i915_gem_init_hw [i915]] ERROR Enabling uc failed (-8)
[ 5.576186] WARNING: CPU: 1 PID: 317 at /build/linux-tpKJY9/linux-4.19.28/drivers/gpu/drm/drm_mode_config.c:444 drm_mode_config_cleanup+0x288/0x2e0 [drm]
[ 5.576188] Modules linked in: ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter overlay nls_ascii nls_cp437 vfat fat evdev intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel i915(+) kvm irqbypass crct10dif_pclmul crc32_pclmul efi_pstore ghash_clmulni_intel intel_cstate intel_rapl_perf pcspkr wdat_wdt efivars drm_kms_helper drm sg mei_me mei processor_thermal_device i2c_algo_bit intel_soc_dts_iosf button fuse tpm_crb tpm_tis tpm_tis_core tpm int3406_thermal rng_core dptf_power pcc_cpufreq video int3400_thermal acpi_thermal_rel int3403_thermal int340x_thermal_zone nfsd auth_rpcgss nfs_acl lockd grace sunrpc efivarfs ip_tables x_tables autofs4 ext4 crc16 mbcache jbd2 crc32c_generic fscrypto ecb sd_mod crc32c_intel aesni_intel xhci_pci aes_x86_64 ahci crypto_simd cryptd
[ 5.576256] RIP: 0010:drm_mode_config_cleanup+0x288/0x2e0 [drm]
[ 5.576429] [drm:drm_mode_config_cleanup [drm]] ERROR connector HDMI-A-1 leaked!
[ 5.576518] WARNING: CPU: 1 PID: 317 at /build/linux-tpKJY9/linux-4.19.28/drivers/gpu/drm/i915/intel_atomic_plane.c:105 intel_plane_destroy_state+0x37/0x50 [i915]
[ 5.576519] Modules linked in: ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter overlay nls_ascii nls_cp437 vfat fat evdev intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel i915(+) kvm irqbypass crct10dif_pclmul crc32_pclmul efi_pstore ghash_clmulni_intel intel_cstate intel_rapl_perf pcspkr wdat_wdt efivars drm_kms_helper drm sg mei_me mei processor_thermal_device i2c_algo_bit intel_soc_dts_iosf button fuse tpm_crb tpm_tis tpm_tis_core tpm int3406_thermal rng_core dptf_power pcc_cpufreq video int3400_thermal acpi_thermal_rel int3403_thermal int340x_thermal_zone nfsd auth_rpcgss nfs_acl lockd grace sunrpc efivarfs ip_tables x_tables autofs4 ext4 crc16 mbcache jbd2 crc32c_generic fscrypto ecb sd_mod crc32c_intel aesni_intel xhci_pci aes_x86_64 ahci crypto_simd cryptd
[ 5.576607] drm_plane_cleanup+0xae/0x110 [drm]
[ 5.576654] drm_mode_config_cleanup+0x10d/0x2e0 [drm]
[ 5.577215] WARNING: CPU: 2 PID: 317 at /build/linux-tpKJY9/linux-4.19.28/drivers/gpu/drm/i915/i915_gem_gtt.c:3002 i915_ggtt_cleanup_hw+0xc9/0x190 [i915]
[ 5.577215] Modules linked in: ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter overlay nls_ascii nls_cp437 vfat fat evdev intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel i915(+) kvm irqbypass crct10dif_pclmul crc32_pclmul efi_pstore ghash_clmulni_intel intel_cstate intel_rapl_perf pcspkr wdat_wdt efivars drm_kms_helper drm sg mei_me mei processor_thermal_device i2c_algo_bit intel_soc_dts_iosf button fuse tpm_crb tpm_tis tpm_tis_core tpm int3406_thermal rng_core dptf_power pcc_cpufreq video int3400_thermal acpi_thermal_rel int3403_thermal int340x_thermal_zone nfsd auth_rpcgss nfs_acl lockd grace sunrpc efivarfs ip_tables x_tables autofs4 ext4 crc16 mbcache jbd2 crc32c_generic fscrypto ecb sd_mod crc32c_intel aesni_intel xhci_pci aes_x86_64 ahci crypto_simd cryptd
[ 5.577396] WARNING: CPU: 2 PID: 317 at /build/linux-tpKJY9/linux-4.19.28/drivers/gpu/drm/drm_mm.c:950 drm_mm_takedown+0x20/0x30 [drm]
[ 5.577397] Modules linked in: ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter overlay nls_ascii nls_cp437 vfat fat evdev intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel i915(+) kvm irqbypass crct10dif_pclmul crc32_pclmul efi_pstore ghash_clmulni_intel intel_cstate intel_rapl_perf pcspkr wdat_wdt efivars drm_kms_helper drm sg mei_me mei processor_thermal_device i2c_algo_bit intel_soc_dts_iosf button fuse tpm_crb tpm_tis tpm_tis_core tpm int3406_thermal rng_core dptf_power pcc_cpufreq video int3400_thermal acpi_thermal_rel int3403_thermal int340x_thermal_zone nfsd auth_rpcgss nfs_acl lockd grace sunrpc efivarfs ip_tables x_tables autofs4 ext4 crc16 mbcache jbd2 crc32c_generic fscrypto ecb sd_mod crc32c_intel aesni_intel xhci_pci aes_x86_64 ahci crypto_simd cryptd
[ 5.577440] RIP: 0010:drm_mm_takedown+0x20/0x30 [drm]
[ 5.577612] WARNING: CPU: 2 PID: 317 at /build/linux-tpKJY9/linux-4.19.28/drivers/gpu/drm/drm_mm.c:950 drm_mm_takedown+0x20/0x30 [drm]
[ 5.577614] Modules linked in: ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter overlay nls_ascii nls_cp437 vfat fat evdev intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel i915(+) kvm irqbypass crct10dif_pclmul crc32_pclmul efi_pstore ghash_clmulni_intel intel_cstate intel_rapl_perf pcspkr wdat_wdt efivars drm_kms_helper drm sg mei_me mei processor_thermal_device i2c_algo_bit intel_soc_dts_iosf button fuse tpm_crb tpm_tis tpm_tis_core tpm int3406_thermal rng_core dptf_power pcc_cpufreq video int3400_thermal acpi_thermal_rel int3403_thermal int340x_thermal_zone nfsd auth_rpcgss nfs_acl lockd grace sunrpc efivarfs ip_tables x_tables autofs4 ext4 crc16 mbcache jbd2 crc32c_generic fscrypto ecb sd_mod crc32c_intel aesni_intel xhci_pci aes_x86_64 ahci crypto_simd cryptd
[ 5.577722] RIP: 0010:drm_mm_takedown+0x20/0x30 [drm]
[ 5.627707] WARNING: CPU: 0 PID: 317 at /build/linux-tpKJY9/linux-4.19.28/drivers/gpu/drm/i915/i915_gem.c:5774 i915_gem_cleanup_early+0xc9/0xf0 [i915]
[ 5.627708] Modules linked in: iptable_nat nf_nat_ipv4 xt_addrtype xt_conntrack nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c br_netfilter bridge stp llc ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter overlay nls_ascii nls_cp437 vfat fat evdev intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel i915(+) kvm irqbypass crct10dif_pclmul crc32_pclmul efi_pstore ghash_clmulni_intel intel_cstate intel_rapl_perf pcspkr wdat_wdt efivars drm_kms_helper drm sg mei_me mei processor_thermal_device i2c_algo_bit intel_soc_dts_iosf button fuse tpm_crb tpm_tis tpm_tis_core tpm int3406_thermal rng_core dptf_power pcc_cpufreq video int3400_thermal acpi_thermal_rel int3403_thermal int340x_thermal_zone nfsd auth_rpcgss nfs_acl lockd grace sunrpc efivarfs ip_tables x_tables

Thanks in advance.

@mvduin

This comment has been minimized.

Copy link

commented May 16, 2019

Debian has no linux-firmware package, the GuC/HuC firmware is part of firmware-misc-nonfree

@kevindd992002

This comment has been minimized.

Copy link

commented May 16, 2019

And I do have the firmware-misc-nonfree (from Stretch backports) installed but it looks like it doesn't have drivers for Gemini Lake (glk). Any other ideas?

@mvduin

This comment has been minimized.

Copy link

commented May 16, 2019

They're just too new. The version in buster and stretch-backports (20190114) is still too old, the one in unstable (20190502) does include them.

@mvduin

This comment has been minimized.

Copy link

commented May 16, 2019

Note that in case of a firmware package like this, it should be pretty safe to just download the .deb from unstable and manually install it without running into any package dependency conflicts.

@mvduin

This comment has been minimized.

Copy link

commented May 16, 2019

Alternatively, you could add (the non-free section of) unstable as source to APT, but create an /etc/apt/preferences file that ensures it is only used for this specific package:

Package: *
Pin: release o=Debian,a=unstable
Pin-Priority: -1

Package: firmware-misc-nonfree
Pin: release o=Debian,a=unstable
Pin-Priority: 500
@kevindd992002

This comment has been minimized.

Copy link

commented May 19, 2019

Before installing the unstable firmware-misc-nonfree, I want to make sure I don't break anything. So I followed your instructions and then did an apt update && apt upgrade. I did see that it was trying to install the unstable version but got this error:

The following packages have been kept back: firmware-misc-nonfree 0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
I then tried apt install firmware-misc-nonfree and got this instead:

The following packages will be REMOVED: firmware-linux firmware-linux-nonfree The following packages will be upgraded: firmware-misc-nonfree 1 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.

Why will it need to remove firmware-linux and firmware-linux-nonfree? Will it damage anything if I proceed? A brief history of my system is that I installed firmware-linux from stretch-backports and it automatically installed firmware-linux-nonfree and firmware-misc-nonfree.

@mvduin

This comment has been minimized.

Copy link

commented May 20, 2019

firmware-linux and firmware-linux-nonfree are just metapackages, they don't actually contain any firmware themselves. You can verify that with e.g. dpkg -L firmware-linux-nonfree. They are being removed because firmware-linux depends on (a specific version of) firmware-linux-nonfree, which depends on a specific version of firmware-misc-nonfree which is different from the one you're installing. This shows the dependencies on unstable:

~$ dpkg -s firmware-linux | egrep 'Depends|Recommends'
Depends: firmware-linux-free, firmware-linux-nonfree (= 20190502-1)
Recommends: intel-microcode, amd64-microcode
~$ dpkg -s firmware-linux-nonfree | egrep '^Depends|^Recommends'
Depends: firmware-misc-nonfree (= 20190502-1), firmware-amd-graphics (= 20190502-1)
Recommends: intel-microcode, amd64-microcode

It's unlikely to be an issue for these metapackages to be removed. Just mark their dependencies as manually-installed (or remove them if unnecessary on your system).

@kevindd992002

This comment has been minimized.

Copy link

commented May 21, 2019

Ok, that makes sense. So they're like a bundle that includes all things but in this specific instance firmware-linux and firmware-linux-nonfree simply contain documentations/changelogs, right? In that case, I should have just installed firmware-linux-nonfree from the beginning because if I did firmware-linux-free won't be touched at all during upgrade or removal of these packages. Did I get that right?

If so, how do I properly uninstall firmware-linux without touching firmware-linux-free? And after I do, I install the firmware-linux-nonfree (unstable) so that firmware-misc-nonfree will also be installed together with it.

If the unstable packages make my system, well, "unstable" can I simply remove them without damaging anything?

@kevindd992002

This comment has been minimized.

Copy link

commented May 21, 2019

Would running sudo apt purge --auto-remove firmware-linux be fine to remove firmware-linux, all its dependencies, and all its config/data files?

@kevindd992002

This comment has been minimized.

Copy link

commented May 21, 2019

Ok, I went ahead and installed the unstable firmware-misc-nonfree and verified that the new glk firmwares are present:

$ ls -1 /lib/firmware/i915/
bxt_dmc_ver1_07.bin
bxt_dmc_ver1.bin
bxt_guc_32.0.3.bin
bxt_guc_ver8_7.bin
bxt_guc_ver9_29.bin
bxt_huc_ver01_07_1398.bin
cnl_dmc_ver1_07.bin
glk_dmc_ver1_04.bin
glk_guc_32.0.3.bin
glk_huc_ver03_01_2893.bin
icl_guc_32.0.3.bin
icl_huc_ver8_4_3238.bin
kbl_dmc_ver1_01.bin
kbl_dmc_ver1_04.bin
kbl_dmc_ver1.bin
kbl_guc_32.0.3.bin
kbl_guc_ver9_14.bin
kbl_guc_ver9_39.bin
kbl_huc_ver02_00_1810.bin
skl_dmc_ver1_23.bin
skl_dmc_ver1_26.bin
skl_dmc_ver1_27.bin
skl_dmc_ver1.bin
skl_guc_32.0.3.bin
skl_guc_ver1.bin
skl_guc_ver4.bin
skl_guc_ver6_1.bin
skl_guc_ver6.bin
skl_guc_ver9_33.bin
skl_huc_ver01_07_1398.bin

I also modified /etc/modprobe.d/i915.conf to include options i915 enable_guc=1 or options i915 enable_guc=-1 but still the GuC firmware won't load. Anything else I can try here? I'm pulling my hair already :(

@mvduin

This comment has been minimized.

Copy link

commented May 22, 2019

Maybe the kernel is too old as well? I'm just guessing though, I don't really know anything about these drivers or the firmware. I'm just a random guy who wanted to remark to the author of this page that his instructions fail at step 1 for debian. My original comment wasn't actually in reply to yours :)

@mvduin

This comment has been minimized.

Copy link

commented May 22, 2019

Also just mark firmware-linux-free (and any other of the dependencies listed that you want to keep, e.g. intel-microcode) as "manually installed" instead of "automatically installed", either by explicitly installing those packages or by using apt-mark manual. This ensures that removing firmware-linux won't cause APT to consider those packages redundant and autoremove them.

@kevindd992002

This comment has been minimized.

Copy link

commented May 22, 2019

I see. So I guess I'm stuck then :( I'm at kernel 4.19 already but it's possible that it's still old for my hardware. I really don't have a clue.

@mvduin

This comment has been minimized.

Copy link

commented May 22, 2019

It's one of the downsides of using debian stable, it tends to not be very up-to-date. If you're using backports already, you may be better off with debian testing or unstable. I always run unstable on my laptop (it isn't particularly unstable in practice).

@kevindd992002

This comment has been minimized.

Copy link

commented May 22, 2019

Right, I understand. I just wouldn't want to mess up anything with this media server if I absolutely don't need to. Well, it would be a Plex server so the GPU hardware transcoding would really help. Is GuC/HuC solely for transcoding? If there is no firmware for it, hardware transcoding won't work?

@Brainiarc7

This comment has been minimized.

Copy link
Owner Author

commented May 27, 2019

Hello @kevindd992002 GuC/HuC is mostly useful when you need low power encoding profiles and access to advanced features such as extra bitrate control modes. See https://01.org/linuxgraphics/downloads/firmware

@kevindd992002

This comment has been minimized.

Copy link

commented May 27, 2019

Thanks for the info, @Brainiarc7. Then I'm assuming it would still be beneficial to my media server as HuC is responsible for the CPU to GPU offloading, right? I still aim for these both to work though.

@Brainiarc7

This comment has been minimized.

Copy link
Owner Author

commented May 28, 2019

@kevindd992002

This comment has been minimized.

Copy link

commented May 28, 2019

I see. It's just that Gemini Lake support started with Kernel 4.11 and I'm using 4.19 so I thought these two modules should've loaded just fine with the unstable firmware-misc-nonfree package installed. How can I be certain that using a very new kernel will fix this though? Any other way to test other than really upgrading to the latest kernel?

@kev300

This comment has been minimized.

Copy link

commented May 29, 2019

Hi, I also have a Gemini Lake NUC on Manjaro with the 5.1 Kernel and the guc / huc firmware installed. But it's not loading it. There is also no message, which could indicate a reason. :(

@Brainiarc7

This comment has been minimized.

Copy link
Owner Author

commented May 29, 2019

@Brainiarc7

This comment has been minimized.

Copy link
Owner Author

commented May 29, 2019

@kevindd992002

This comment has been minimized.

Copy link

commented May 30, 2019

That's interesting. So it's at all possible that this is not due to an outdated kernel. I'd be interested in your tests.

@kev300

This comment has been minimized.

Copy link

commented May 30, 2019

[nas-pc ~]# dmesg | grep drm

[ 3.754283] fb0: switching to inteldrmfb from EFI VGA
[ 3.754508] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 3.754509] [drm] Driver supports precise vblank timestamp query.
[ 3.755341] [drm] Applying Increase DDI Disabled quirk
[ 3.755732] [drm] Finished loading DMC firmware i915/glk_dmc_ver1_04.bin (v1.4)
[ 3.776503] [drm] Initialized i915 1.6.0 20190207 for 0000:00:02.0 on minor 0
[ 3.815375] fbcon: inteldrmfb (fb0) is primary device
[ 3.815384] i915 0000:00:02.0: fb0: inteldrmfb frame buffer device
[nas-pc ~]#
[nas-pc ~]# dmesg | grep -iE "huc|guc|dmc"
[ 3.755732] [drm] Finished loading DMC firmware i915/glk_dmc_ver1_04.bin (v1.4)

[nas-pc ~]# modinfo i915 | egrep -i "guc|huc|dmc"
firmware: i915/bxt_dmc_ver1_07.bin
firmware: i915/skl_dmc_ver1_27.bin
firmware: i915/kbl_dmc_ver1_04.bin
firmware: i915/glk_dmc_ver1_04.bin
firmware: i915/cnl_dmc_ver1_07.bin
firmware: i915/icl_dmc_ver1_07.bin
firmware: i915/kbl_guc_ver9_39.bin
firmware: i915/bxt_guc_ver9_29.bin
firmware: i915/skl_guc_ver9_33.bin
firmware: i915/kbl_huc_ver02_00_1810.bin
firmware: i915/bxt_huc_ver01_8_2893.bin
firmware: i915/skl_huc_ver01_07_1398.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)
parm: huc_firmware_path:HuC firmware path to use instead of the default one (charp)
parm: dmc_firmware_path:DMC firmware path to use instead of the default one (charp)

The guc/huc firmwares are not listed above, but they exist here:

/usr/lib/firmware/i915/glk_dmc_ver1_04.bin
/usr/lib/firmware/i915/glk_huc_ver03_01_2893.bin
/usr/lib/firmware/i915/glk_guc_32.0.3.bin

I also tried to set enable_guc to -1, which did not help and to 1, which prevents the system from booting. :)

@kev300

This comment has been minimized.

Copy link

commented Jun 3, 2019

I gues we need to wait until a newer intel graphics driver made it into the kernel. :)
https://patchwork.kernel.org/patch/10963455/
https://patchwork.kernel.org/patch/10963459/

@kevindd992002

This comment has been minimized.

Copy link

commented Jun 11, 2019

@Brainiarc7

Do you have any other ideas regarding this? If those patchworks links are already commits, then how long does it take usually for them to reach general availability?

@Brainiarc7

This comment has been minimized.

Copy link
Owner Author

commented Jun 12, 2019

As @kev300 commented above, please wait.
Typically, you can get the latest, greatest Intel code from drm-intel, among others, from these repos.
For build guidelines, see this.

@kevindd992002

This comment has been minimized.

Copy link

commented Jun 12, 2019

Right, I figured that much but I just didn't know how to even know that those commits are already available for me to download from Debian repos since I'm an inexperienced Linux user. I guess I'd just have to wait and see if anyone posts here about any news.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.