Bug 54964 - [snb rc6 regression] RC6 black screen / freeze on autologin
Summary: [snb rc6 regression] RC6 black screen / freeze on autologin
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: unspecified
Hardware: All Linux (All)
: medium critical
Assignee: Rodrigo Vivi
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-15 12:18 UTC by serveralex
Modified: 2017-07-24 23:00 UTC (History)
11 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Kernel log without XBMC auto login (187.64 KB, text/plain)
2012-09-23 09:38 UTC, serveralex
no flags Details
Kernel log with auto login (110.86 KB, text/plain)
2012-09-23 09:38 UTC, serveralex
no flags Details
VGA workaround patch (2.02 KB, patch)
2012-12-18 21:58 UTC, Rodrigo Vivi
no flags Details | Splinter Review
syslog with 1st patch applied (642.73 KB, text/plain)
2012-12-20 22:42 UTC, sm
no flags Details
syslog with both patches applied (1.82 MB, text/plain)
2012-12-20 22:43 UTC, sm
no flags Details

Description serveralex 2012-09-15 12:18:20 UTC
I'm using an Intel G530 (Sandy Bridge) on an Asrock H77M-ITX board using the onboard gpu. I set up XBMC using xbmc-standalone as default session with autologin. Whenever RC6 is enabled (which is default) the system immediatly freezes on boot when XBMC is started. There is only a black screen with a mouse cursor and nothing else. The whole system is fully unresponsive. Network connection lost, even no reaction on SysRq keys. The strange thing is, that this only happens when XBMC is started via autostart. When I first login to a normal desktop and launch XBMC there, everything is fine. Same when I disable autologin, but use XBMC as login session (after manual login via unity greeter). I also tested glxgears as autologin session, which has exactly the same effect. So it must have something to do with 3d initialization?

I'm currently using Ubuntu 12.10 using the default kernel (vmlinuz-3.5.0-14-generic). Also tried 12.04 and also tried the current vanilla git kernel with drm-intel-nightly branch merged into it. When I disable RC6 (i915.i915_enable_rc6=0) everything works fine, but the power consumption is 10W higher.

Mesa version is
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Sandybridge Desktop
OpenGL version string: 3.0 Mesa 8.1-devel
OpenGL shading language version string: 1.30


Any ideas?
Comment 1 Daniel Vetter 2012-09-16 09:56:48 UTC
Just to confirm that this still happens on the latest code, can you please test the drm-intel-next-queued branch from

http://cgit.freedesktop.org/~danvet/drm-intel
Comment 2 serveralex 2012-09-16 12:07:00 UTC
Same problem with branch drm-intel-next-queued
Comment 3 Rodrigo Vivi 2012-09-21 02:44:33 UTC
Is there any difference on XBMC command line parameters on your autostart setup and when you are calling by hand? Just curious since I know nothing about xbmc.

Anyways, could you please attach dmesg output with drm.debug=0xe? Since the screen gets blank and system frozen my suggestion is to use netconsole to get this log.

Also, if possible, get glxgears output using LIBG_DEBUG=verbose?
Comment 4 serveralex 2012-09-23 09:38:25 UTC
Created attachment 67574 [details]
Kernel log without XBMC auto login
Comment 5 serveralex 2012-09-23 09:38:58 UTC
Created attachment 67575 [details]
Kernel log with auto login
Comment 6 serveralex 2012-09-23 09:51:01 UTC
I attached two log files i recorded via netconsole. The first one shows a kernel log without auto login (i.e. login via lightdm greeter and password entry), the second one with XBMC autologin. In both cases, RC6 is enabled (by default).

Obviously the driver timeouts directly after initialization in autologin case:
[   62.164512] [drm:__gen6_gt_force_wake_get] *ERROR* Timed out waiting for forcewake to ack request.
[   62.264890] [drm:__gen6_gt_wait_for_thread_c0] *ERROR* GT thread status wait timed out

I have no clue how I should record a LIBGL_DEBUG=verbose for glxgears in auto login mode as I can't record the output to disk because the system freezes immediately and does not flush the data. Any ideas? nc?
Comment 7 Rodrigo Vivi 2012-09-24 18:28:14 UTC
Thanks for the info. I'm going to take a look on the logs.

Regarding the LIBG_DEBUG output I think it can be done by using SSH:
DISPLAY=:0 LIBGL_DEBUG=verbose glxgears
Comment 8 sm 2012-10-10 19:34:37 UTC
I think i have exactly the same problem except that i am using an ubuntu minimal install to run XBMC. Here's my setup:

- Ubuntu 12.10 minimal install (from mini.iso), dated 06/10/2012
- Intel DH77CF Mainboard (Sandy Bridge)
- Intel 2100T CPU

I used Ubuntu 12.04 before with the same hardware and everything worked fine. I made the switch from Ubuntu 12.04 to 12.10 by installing a completely new fresh system (wiped the harddrive). After installing, I configured ubuntu like 12.04 and installed the same packages (wrote every step down i did after installing 12.04 half a year ago so that i could reproduce what i have to do for a new installation).

With 12.10, my problem is also that the whole system freezes after the start of XBMC, i get a black screen, lost network connection and so forth. The only way to solve this is to disable RC6 via kernel option. RC6 worked in Ubuntu 12.04 for me. I start XBMC kind of manually via a /etc/init/xbmc.conf file which simply starts X. The user for which X is started has an ~\.xsession file which starts XBMC. 

I've also tried with glxgears with the same result (freeze). i did: 

- boot
- login with my user
- type startx in the console
- x is started with basic a xterm i think
- type glxgears 
-> complete freeze of system, it is not responsive anymore. glxgears does nothing except displaying a black empty box

So the freeze has nothing to do with XBMC. After further testing, it is really simple reproduceable when you do this:

- install ubuntu minimal, no other extra software selected at the end of the install
- login with <myuser>
- Intel RC6 is now enabled by default
- sudo apt-get install xorg mesa-utils
- sudo apt-get install i965-va-driver vainfo        (install vaapi stuff to get vaapi acceleration)
- sudo add <myuser> video                           (needed so that vaapi works in x)
- reboot, login with <myuser>
- startx
- vainfo -> should work, should display some vaapi version infos and supported profiles etc.
- glxgears
- system freezes

The same steps work in ubuntu 12.04. I checked following values in both versions:

/sys/module/i915/parameters/i915_enable_rc6 => -1  on both
/sys/module/i915/parameters/i915_enable_fbc => -1  on both
/sys/module/i915/parameters/semaphores => -1 on both

So for both, RC6 was enabled. I tried uxa with 12.10, still didn't help.
Comment 9 George Henze 2012-10-20 15:33:20 UTC
I have the same problem, I guess. I am using this setup:

* MSI  H61MU-E35 
* Intel Core i3-2105 CPU 
* Ubuntu Minimal 12.10

When I disable RC6 by GRUB_CMDLINE_LINUX_DEFAULT line. i915.i915_enable_rc6=0 my system boots fine and automatically logs in in using LightDM. When I enable RC6 my systems freezes, just like sm's above my comment.
Comment 10 sm 2012-10-20 20:25:43 UTC
Found out another strange thing today:

I installed openbox windows manager today because the original bugreporter said that he has no problem running glxgears/xbmc with RC6 enabled from within unity or as a lightdm session. So i wanted to try out the same thing with openbox (because it's really small and installs onyl a few MBs).

And it works. XBMC and glxgears work perfectly when started from within an openbox session from the openbox terminal when RC6 is enabled. 

So this means: If RC6 is enabled on my Sandy Bridge System, glxgears freezes the whole system if i run it without running (any, i assume) window manager before. If i run glxgears from inside a window manager (openbox, unity...) it works perfectly.

Whats going on? How does a running window manager prevent the system from freezing when RC6 is enabled? Why didn't that happen in ubuntu 12.04?
Comment 11 Rodrigo Vivi 2012-10-30 18:19:00 UTC
Could you please post your CPU Stepping here?
just run intel_stepping
Comment 12 sm 2012-10-31 06:37:40 UTC
Sure, here it is:

Vendor: 0x8086, Device: 0x0102, Revision: 0x09 (??)
Comment 13 eezak 2012-11-09 15:00:29 UTC
Same problem here with same CPU stepping as above.
Comment 14 Jesse Barnes 2012-12-11 18:42:06 UTC
Can you give this patch a try?

https://patchwork.kernel.org/patch/1819391/
Comment 15 sm 2012-12-12 21:32:34 UTC
Unfortunatly the patch didn't solve the problem.

I applied the patch against the stock ubuntu 12.10 Kernel (3.5, got sources via apt-get install linux-source). Steps I did to build the kernel:

--
apt-get install kernel-package libncurses5-dev fakeroot wget bzip2 build-essential udev 

patch -p1 < yourpatch.patch         (patch was successfully applied)

cp -vi /boot/config-`uname -r` .config 
make kpkg-clean
fakeroot make-kpkg --initrd --append-to-version=testpatch kernel-image kernel-headers
--

The result is the same, the system completly freezes when RC6 is enabled. If you need more information or if I should test other patches/things, plz feel free to ask.
Comment 16 Rodrigo Vivi 2012-12-18 21:58:24 UTC
Created attachment 71760 [details] [review]
VGA workaround patch

I couldn't reproduce the bug here on my snb mobile and noticed your stepping is desktop, so I was looking at our database for a known workaround related to desktops that doesn't affect mobile ones.
I couldn't... but I found out a VGA wa that we weren't using.
So, let me know if this could be the case and if this patches helps in something.
Comment 17 sm 2012-12-20 22:41:29 UTC
Tried your second patch some minutes ago (together with the first one). Still no success, system freezes.

I have some syslogs for you, maybe they help. I did the following:

- boot
- login with <myuser>
- startx (this time without openbox installed as a windowmanager to force the mentioned RC6-freeze issue)
- after startx, i'm in xterm now
- run glxgears
- system freezes as expected

I attached two logs, one syslog from booting and running glxgeals with your first patch, the other one with both patches applied.

Can I help further with other logs or other testing?
Comment 18 sm 2012-12-20 22:42:33 UTC
Created attachment 71878 [details]
syslog with 1st patch applied
Comment 19 sm 2012-12-20 22:43:13 UTC
Created attachment 71879 [details]
syslog with both patches applied
Comment 20 Menno 2013-01-02 18:26:08 UTC
I'm running a similar setup as sm and am also having the same problem with XBMC after upgrading to Ubuntu 12.10 from 12.04. Disabling RC6 also solves the issue.

However during some testing with RC6 enabled to pinpoint the issue I found that if I run glxheads before glxgears in a fresh X session after booting there is no freeze. glxheads needs to be run only once, in new sessions it does not freeze when I run glxgears or XBMC. Maybe this helps a bit to pinpoint the issue.

I've added some info below, let me know if you need anything else.

CPU: Intel i3-2100T
Mobo: Asrock H67M-GE/HT (Intel H67 Express)

> glxheads :0
Name: :0
  Display:     0x1c76010
  Window:      0x600002
  Context:     0x1c84dd0
  GL_VERSION:  3.0 Mesa 9.1-devel
  GL_VENDOR:   Intel Open Source Technology Center
  GL_RENDERER: Mesa DRI Intel(R) Sandybridge Desktop 

> intel_stepping
Vendor: 0x8086, Device: 0x0102, Revision: 0x09 (??)

> uname -a
Linux htpc 3.7.0-7-generic #15-Ubuntu SMP Sat Dec 15 16:34:25 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
Comment 21 Daniel Vetter 2013-01-07 14:45:34 UTC
Please retest with a 3.8-rc2 kernel, that contains two workaround patches for snb which might apply:

drm/i915: Implement WaSetupGtModeTdRowDispatch
drm/i915: Implement WaDisableHiZPlanesWhenMSAAEnabled

If they help, we can backport them to stable kernels.
Comment 22 Rodrigo Vivi 2013-01-24 21:55:05 UTC
I could finally get a snb stepping 0x0102 rev 0x09 here and could reproduce the bug and also tested with today's drm-intel-fixes that contains wa patches and verified that the issue is gone.
Comment 23 mus.svz 2013-03-13 12:55:19 UTC
so the patches that are supposed to fix this were merged into 3.8-rc2 ? I'm asking because I'm running kernel 3.8.2 on ArchLinux x64 and can still reproduce this problem, see also the following bug:

https://bugs.freedesktop.org/show_bug.cgi?id=56684

This is definitively the same bug, I can also confirm that disabling rc6 fixes it for me.

Hardware:
Intel DH67CF 
Intel Core i5 2500
Comment 24 sm 2013-03-13 15:12:42 UTC
I tried the Ubuntu raring mainline kernel 3.8.0-030800 deb's (final Linux 3.8 kernel) on my machine with Ubuntu 12.10 and i still have the same problem. PC hangs completely when staring XBMC or glxgears when RC6 is enabled. 

My hope was that with Ubuntu 13.04 the problem might be fixed because other gfx related packages will be updated too. 

2 weeks ago, I bought a Core i3 3220T Ivy Bridge CPU. Using this CPU, everything works flawlessly (even with RC6pp and SNA enabled). So I fixed my problem with new hardware... unfortunately.
Comment 25 Daniel Vetter 2013-03-18 17:48:33 UTC
Note that rc6 issues come in tons of flavours. On latest mesa there's another on on snb:

https://bugs.freedesktop.org/show_bug.cgi?id=62141
https://bugs.freedesktop.org/show_bug.cgi?id=52424

Given that this precise issue here is solved the remaining rc6 fallout could one of the above or another (thus far unseen) bug.


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.