Bug 93871 - [SKL] No version found when installing GuC 4.3
Summary: [SKL] No version found when installing GuC 4.3
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Rodrigo Vivi
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-26 10:24 UTC by cprigent
Modified: 2016-11-21 13:53 UTC (History)
2 users (show)

See Also:
i915 platform: SKL
i915 features: firmware/guc


Attachments
i915_guc_info_bxt (979 bytes, text/plain)
2016-01-26 18:48 UTC, cprigent
no flags Details
i915_guc_info_skl (808 bytes, text/plain)
2016-01-26 18:48 UTC, cprigent
no flags Details
i915_guc_load_stat_skl (461 bytes, text/plain)
2016-01-26 18:49 UTC, cprigent
no flags Details
i915_guc_load_status_bxt (811 bytes, text/plain)
2016-01-26 18:49 UTC, cprigent
no flags Details
i915 dmesg log (208.22 KB, text/plain)
2016-01-28 16:33 UTC, Olivier Berthier
no flags Details
dmesg log file for SKL (251.53 KB, text/plain)
2016-01-29 15:58 UTC, Olivier Berthier
no flags Details
guc 4.3 package with install.sh updated (59.42 KB, text/plain)
2016-02-10 16:02 UTC, Rodrigo Vivi
no flags Details
Updated install.sh with dpkg-reconfigure (59.56 KB, text/plain)
2016-02-10 20:22 UTC, Rodrigo Vivi
no flags Details
Another attempt of install.sh (59.16 KB, text/plain)
2016-03-07 23:39 UTC, Rodrigo Vivi
no flags Details

Description cprigent 2016-01-26 10:24:33 UTC
BXT/APL:
======
Platform: Broxton P A0 Platform
CPU Name : Intel(R) @ 1.2 GHz (family: 6, model: 92, stepping: 8) – 4 cores
SoC : BROXTON-P A0
CRB :  Apollo Lake RVPC1 Fab1 
Reworks : R14, R06C and R16

Software:
BIOS (IFWI Version): APLK_IFWI_X64_R_2015_41_5_02 
KSC : 1.02
Linux distribution: Ubuntu 15.10 64 bits
Kernel: drm-intel-nightly 4.4.0 8114b00 from http://cgit.freedesktop.org/drm-intel/
  commit 8114b003c45a9463152a3a30be1f120caf32e92b
  Author: Daniel Vetter <daniel.vetter@ffwll.ch>
  Date:   Mon Jan 18 09:02:45 2016 +0100
  drm-intel-nightly: 2016y-01m-18d-08h-02m-22s UTC integration manifest
drm: tag libdrm-2.4.66 e342c0f from http://cgit.freedesktop.org/mesa/drm/
mesa: tag mesa-11.0.8 261daab from http://cgit.freedesktop.org/mesa/mesa/
cairo: tag 1.15.2 db8a7f1 from http://cgit.freedesktop.org/cairo
waffle: master bb29b2a from https://github.com/waffle-gl/waffle
xorg-server-macros: master d7acec2 from git://git.freedesktop.org/git/xorg/util/macros
libva: tag libva-1.6.1 cb418f6 from http://cgit.freedesktop.org/libva/
vaapi-intel-driver: tag 1.6.1 2110b3a from http://cgit.freedesktop.org/vaapi/intel-driver


SKL
======
Hardware
Platform: NUC6i3SYH
CPU: Intel(R) Core(TM) i3-6100U CPU @ 2.30GHZ (family 6, model 78, stepping 3)
Motherboard version: H81132-502
GPU: Intel® HD Graphics 520 - Intel Corporation Sky Lake Integrated Graphics (rev 07)
Memory: one 8GB card Kingston KVR21S15D8/8
SSD: Samsung 850 EVO M.2 120 Go

Software:
Bios: SYSKLi35.86A.0024.2015.1027.2142
Linux distribution: Ubuntu 15.10 64 bits
Kernel: drm-intel-nightly 4.4.0 8fe9e78 from http://cgit.freedesktop.org/drm-intel
  commit 8fe9e785ae04fa7c37f7935cff12d62e38054b60
  Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
  Date:   Thu Jan 21 11:03:06 2016 +0000
  drm-intel-nightly: 2016y-01m-21d-11h-02m-42s UTC integration manifest
drm: tag libdrm-2.4.66 e342c0f from http://cgit.freedesktop.org/mesa/drm/
mesa: tag mesa-11.0.8 261daab from http://cgit.freedesktop.org/mesa/mesa/
cairo: tag 1.15.2 db8a7f1 from http://cgit.freedesktop.org/cairo
waffle: master bb29b2a from https://github.com/waffle-gl/waffle
xorg-server-macros: master d7acec2 from git://git.freedesktop.org/git/xorg/util/macros
libva: tag libva-1.6.1 cb418f6 from http://cgit.freedesktop.org/libva/
vaapi-intel-driver: tag 1.6.1 2110b3a from http://cgit.freedesktop.org/vaapi/intel-driver

Pre-conditions:
------------------
On BXT, apply patches from: 
  http://patchwork.freedesktop.org/patch/69500/
  http://patchwork.freedesktop.org/patch/71510/
  http://patchwork.freedesktop.org/series/2715/
On BXt and SKL, install GuC from: https://01.org/linuxgraphics/downloads/sklgucver43 

Steps:
------
1. Execute commands:
cat /sys/kernel/debug/dri/0/i915_guc_load_status 
cat /sys/kernel/debug/dri/0/i915_guc_info

Actual results:
----------------
1. Commands show
on SKL:
	version wanted: 4.3
	version found: 0.0
on BXT:
        version wanted: 0.0
        version found: 0.0

Expected results:
-----------------
1. Versions wanted and found are correct.
Comment 1 cprigent 2016-01-26 10:27:19 UTC
Reproduced with kernel testing tag drm-intel-testing-2016-01-24
Comment 2 Yu Dai 2016-01-26 17:59:11 UTC
On BXT, this is correct because the firmware is only for SKL. The fw loading will be skipped on BXT and submission is fallback to ExecList mode. BXT fw is not available yet on 01.org.

On SKL, could you provide more information? Such as what files look like in your system folder /lib/firmware/i915. Is there a kernel dmesg log?
Comment 3 Yu Dai 2016-01-26 18:06:19 UTC
Could you post the full message of running commands:

cat /sys/kernel/debug/dri/0/i915_guc_load_status 
cat /sys/kernel/debug/dri/0/i915_guc_info
Comment 4 cprigent 2016-01-26 18:48:39 UTC
Created attachment 121307 [details]
i915_guc_info_bxt
Comment 5 cprigent 2016-01-26 18:48:58 UTC
Created attachment 121308 [details]
i915_guc_info_skl
Comment 6 cprigent 2016-01-26 18:49:15 UTC
Created attachment 121309 [details]
i915_guc_load_stat_skl
Comment 7 cprigent 2016-01-26 18:49:36 UTC
Created attachment 121310 [details]
i915_guc_load_status_bxt
Comment 8 Yu Dai 2016-01-26 19:24:09 UTC
Thanks for the log. The only case this happens is that patch http://patchwork.freedesktop.org/patch/69500/ is not applied properly. I noticed that in Pre-conditions, it is applied to BXT. Is this done for SKL as well? Is there a link of this kernel I can try it?
Comment 9 Olivier Berthier 2016-01-28 16:33:19 UTC
Created attachment 121354 [details]
i915 dmesg log

I attach the dmesg log.
Comment 10 Yu Dai 2016-01-28 16:53:44 UTC
Thanks for the dmsg. Again, this was from BXT. As I said, this is currently not enabled for BXT.

I believe the patches mentioned here are not applied for SKL. Please double check and collect debug info from SKL system.
Comment 11 Yu Dai 2016-01-28 22:54:03 UTC
I installed this kernel on my SKL system. It looks like everything works fine. This is so confused to me.

root@alexSkylake:/sys/kernel/debug/dri/0# uname -a
Linux alexSkylake 4.4.0-drm-intel-nightly-bxt-guc+ #3 SMP PREEMPT Mon Jan 25 18:00:09 CET 2016 x86_64 x86_64 x86_64 GNU/Linux
root@alexSkylake:/sys/kernel/debug/dri/0# cat i915_guc_load_status
GuC firmware status:
    path: i915/skl_guc_ver4.bin
    fetch: SUCCESS
    load: SUCCESS
    version wanted: 4.3
    version found: 4.3
    header: offset is 0; size = 128
    uCode: offset is 128; size = 127936
    RSA: offset is 128064; size = 256

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

Scratch registers:
     0:     0xf0000000
     1:     0x3
     2:     0x0
     3:     0x5f5e100
     4:     0x600
     5:     0x0
     6:     0x0
     7:     0x8
     8:     0x3
     9:     0x430200
    10:     0x0
    11:     0x0
    12:     0x0
    13:     0x0
    14:     0x0
    15:     0x0
Comment 12 Yu Dai 2016-01-28 22:57:19 UTC
In dmesg, on my system I see command line option with "BOOT_IMAGE=/boot/vmlinuz-4.4.0-drm-intel-nightly-bxt-guc+". But in the version attached here it is "vmlinuz-4.4.0-bxt-guc". Does this make any different?

alex@alexSkylake:~/intel-gpu-tools/tests$ dmesg
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 4.4.0-drm-intel-nightly-bxt-guc+ (oberthierx@VANAHEIMR) (gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04) ) #3 SMP PREEMPT Mon Jan 25 18:00:09 CET 2016
[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.4.0-drm-intel-nightly-bxt-guc+ root=UUID=df4be8cc-29b5-421a-861c-d507a91dd6cb ro noprompt persistent quiet splash vt.handoff=7
Comment 13 Olivier Berthier 2016-01-29 15:58:04 UTC
Created attachment 121394 [details]
dmesg log file for SKL

On broxton the files initrd and vmlinuz are manualy copied on the EFI partition, sometimes we use a customized name, I don't think this make a difference.

I attach a dmesg captured on SKL Y with the same kernel.
Comment 14 Olivier Berthier 2016-01-29 16:10:38 UTC
The installed GUC is the one from 01.org :
Release Date: 23 Jul, 2015
Version: ver4_3
Comment 15 Yu Dai 2016-01-29 16:53:20 UTC
Thanks. This helps.

[    3.805335] [drm:intel_guc_ucode_init] GuC firmware pending, path i915/skl_guc_ver4.bin
[    3.805337] [drm:guc_fw_fetch] before requesting firmware: GuC fw fetch status PENDING
[    3.805477] i915 0000:00:02.0: Direct firmware load for i915/skl_guc_ver4.bin failed with error -2
[    3.805497] [drm:guc_fw_fetch] GuC fw fetch status FAIL; err -2, fw           (null), obj           (null)
[    3.805548] [drm:intel_guc_ucode_init [i915]] *ERROR* Failed to fetch GuC firmware from i915/skl_guc_ver4.bin (error -2)

The "Direct firmware load" failure means kernel does not find it in file system. Can you check if fw is installed correctly? It should be in /lib/firmware/i915/. A symbolic link of skl_guc_ver4.bin should link to skl_guc_v4_3.bin.

Maybe you can try "dpkg-reconfigure linux-image-4.4.0-drm-intel-nightly-bxt-guc+". Whenever I updated the fw, I run dpkg-reconfigure to make sure the fw is built into kernel image.
Comment 16 Olivier Berthier 2016-01-29 17:20:37 UTC
Thanks, this resolve the problem.
The symbolic link and the md5sum were correct, but after reconfiguring the kernel the guc is correctly loaded :

# cat /sys/kernel/debug/dri/0/i915_guc_load_status 
GuC firmware status:
        path: i915/skl_guc_ver4.bin
        fetch: SUCCESS
        load: SUCCESS
        version wanted: 4.3
        version found: 4.3
        header: offset is 0; size = 128
        uCode: offset is 128; size = 127936
        RSA: offset is 128064; size = 256

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

Scratch registers:
         0:     0xf0000000
         1:     0x3
         2:     0x0
         3:     0x5f5e100
         4:     0x600
         5:     0x0
         6:     0x0
         7:     0x8
         8:     0x3
         9:     0xd1a00
        10:     0x0
        11:     0x0
        12:     0x0
        13:     0x0
        14:     0x0
        15:     0x0
Comment 17 cprigent 2016-02-02 13:52:30 UTC
Works on SKL. We will track the feature for BXT.
Comment 18 Rodrigo Vivi 2016-02-10 16:02:49 UTC
Created attachment 121650 [details]
guc 4.3 package with install.sh updated

I've updated the install script to make sure the initrd/initramfs is updated.
Could you please help me by giving a try on this new install script and let me know if it works so I will be able to update the official one at 01.org.

Thanks,
Rodrigo.
Comment 19 cprigent 2016-02-10 16:20:16 UTC
Assign to me, I will try it
Comment 20 Rodrigo Vivi 2016-02-10 16:36:32 UTC
Perfect timing then! ;)

hm... best way to test this new script in your case is running:
$ sudo rm -rf /lib/firmware/i915/skl_guc_ver4_3.bin 
$ sudo touch /lib/firmware/i915/skl_guc_ver4_2.bin
$ sudo ln -sf /lib/firmware/i915/skl_guc_ver4_2.bin /lib/firmware/i915/skl_guc_ver4.bin 
$ dpkg-reconfigure #with the options you used.

So by this point we would fake an old one is there in your initrd.

Then run this new install script. The output from command line needs to show you it created a backup initrd and a updated it.

During any step, if you want to verify which version is inside your initrd you can use:
$ lsinitramfs /boot/"initrd.img-$(uname -r)" | grep i915

Thanks for the help here!
Comment 21 cprigent 2016-02-10 17:40:20 UTC
Hi Rodrigo,
I confirm this new script give the details you mentioned but I still see GuC not loaded:

root@nuc-skl-i3:~/GUC/skl_guc_ver4_3# ./install.sh
Success: /lib/firmware/i915/skl_guc_ver4_3.bin installed!
Old version found in your initramfs. Trying to replace it...
Created a bakcup of your current initramfs /boot/initramfs-4.5.0-rc3-without-patch-guc+.img.i915-fw.backup
update-initramfs: Generating /boot/initrd.img-4.5.0-rc3-without-patch-guc+
WARNING: Your initrd still contains the old firmware. After rebooting please verify you have the desired version loaded by checking  /sys/kernel/debug/dri/0/i915_dmc_info
Success: Please reboot your machine!
root@nuc-skl-i3:~/GUC/skl_guc_ver4_3#
....
....
qa@nuc-skl-i3:~$
qa@nuc-skl-i3:~$
qa@nuc-skl-i3:~$ sudo -s
[sudo] password for qa:
root@nuc-skl-i3:~#
root@nuc-skl-i3:~#
root@nuc-skl-i3:~# cd /sys/kernel/debug/dri/0/
root@nuc-skl-i3:/sys/kernel/debug/dri/0# cat i915_guc_load_status
GuC firmware status:
        path: i915/skl_guc_ver4.bin
        fetch: FAIL
        load: NONE
        version wanted: 4.3
        version found: 0.0
        header: offset is 0; size = 0
        uCode: offset is 0; size = 0
        RSA: offset is 0; size = 0

GuC status 0x00000001:
        Bootrom status = 0x0
        uKernel status = 0x0
        MIA Core status = 0x0

Scratch registers:
         0:     0x0
         1:     0x0
         2:     0x0
         3:     0x0
         4:     0x0
         5:     0x0
         6:     0x0
         7:     0x0
         8:     0x0
         9:     0x0
        10:     0x0
        11:     0x0
        12:     0x0
        13:     0x0
        14:     0x0
        15:     0x0
Comment 22 Rodrigo Vivi 2016-02-10 17:43:53 UTC
"WARNING: Your initrd still contains the old firmware. After rebooting please
verify you have the desired version loaded by checking "

:( it seems that my generic script didn't work. Could you please try running the dpkg-reconfigure now and see if this would solve? So it seems that I will need to use that instead of the generic update-initramfs.
Comment 23 cprigent 2016-02-10 17:52:52 UTC
Then confirm GuC is successfully loaded if I reinstall DMC and reboot.
Comment 24 Rodrigo Vivi 2016-02-10 20:22:39 UTC
Created attachment 121655 [details]
Updated install.sh with dpkg-reconfigure

Hi, could you please try this new version that besides the update-initramfs also does the dpkg-reconfigure.

From what I understand initramfs-update should be enough, but let's keep safe at least on Ubuntu :/

Thanks,
Rodrigo.
Comment 25 cprigent 2016-02-12 09:18:40 UTC
Hi Rodrigo,
I confirm this new script (install.sh with dpkg-reconfigure) allows to successfully load the GuC. After a reboot, I see: 
path: i915/skl_guc_ver4.bin
    fetch: SUCCESS
    load: SUCCESS
    version wanted: 4.3
    version found: 4.3
Comment 26 Rodrigo Vivi 2016-03-07 23:39:15 UTC
Created attachment 122155 [details]
Another attempt of install.sh

Hi, The one with dpkg-reconfigure wasn't good and not helping in 100% of cases, so I fully updated the install script.

Could you please check if this one solves this issue here.

thanks,
Rodrigo.
Comment 27 Olivier Berthier 2016-03-08 11:10:29 UTC
Hi,

The GuC is correctly loaded with the new install script.
Comment 28 Rodrigo Vivi 2016-03-14 20:32:27 UTC
Packages available at 01.org has been updated with the new script.
Thanks for the reporting and testing.
Comment 29 cprigent 2016-11-21 13:53:47 UTC
So closed.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.