Bug 76699

Summary: [ivb/hsw] suddenly slow intel graphics
Product: Mesa Reporter: juantascon
Component: Drivers/DRI/i965Assignee: Ian Romanick <idr>
Status: RESOLVED FIXED QA Contact: Intel 3D Bugs Mailing List <intel-3d-bugs>
Severity: normal    
Priority: medium CC: eero.t.tamminen, enrico.tagliavini, intel-gfx-bugs, ryan.roper
Version: 10.1   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: dmesg
list of updated packages
xorg.0.log
glxinfo
unified diff between Xorg.0.log using xserver 1.14 and 1.15

Description juantascon 2014-03-27 16:58:39 UTC
Hi! 

I'm experiencing a problem where I haven't been able to run my
games/videos as I used to do on my intel graphics card. I don't know
what happened, it really just suddenly started going slow, I notice
this while playing videos using mpv over vdpau, playing left4dead2
over steam and even on chromium scrolling. So far I've tried the
following:

* Using "AccelMethod" "glamor" / "sna" on xorg.conf.d
* Resetting my bios settings to the default config.
* Enabling/disabling, as suggested by the wiki[1], on
modprobe.d/i915.conf: options i915 i915_enable_rc6=7 i915_enable_fbc=1
lvds_downclock=1

A little of extra info:

* I tried to watch the contents of
/sys/class/drm/card0/gt_cur_freq_mhz but it is always somewhere
between 300-500-700 it never reaches 1050 which is supposed to be the
max freq that my card allows, but not sure how it was before it got
slow.
* I'm running qtile as window manager which is a tiling wm with no
compositing, along with it I run kdeinit4, gnome-settings-daemon and
pulse to have a modern desktop.
* I close my browser when I run the game/video and vice versa.
* htop doesn't seem to be showing weird processes running at the same time
* On systemd only cups and networkmanager are enabled
* Before the slow occurred I tried running gmabooster[2] ant it
segfaulted, not sure if this could be the problem because gmabooster
changes are not supposed to be permanent, I have rebooted my laptop
several times after this.
* This is the result of $ lspci |grep -i vga
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core
processor Graphics Controller (rev 09)
* I'm using archlinux with: linux kernel 3.13.7, libva 1.3.0, libva-intel-driver 1.3.0, libva-vdpau-driver 0.7.4, xf86-video-intel 2.99.911

I really don't know what else to do, so if any of you guys have a
recommendation or suggestion it will be very welcome.

Thanks

** references:

[1] https://wiki.archlinux.org/index.php/Intel_Graphics
[2] https://aur.archlinux.org/packages/gmabooster
Comment 1 Daniel Vetter 2014-03-27 20:46:31 UTC
Any system updates in between? Kernel/mesa/ddx are the candidates here. Try downgrading to older versions to fix the issues. Also please boot with drm.debug=0xe and attach dmesg and also attach Xorg.log and the output of glxinfo.

Also in /sys/class/drm/card0 there's a bunch of files to control the gpu freq. Try to set the min to max and see what happens.
Comment 2 juantascon 2014-03-27 21:17:25 UTC
Created attachment 96490 [details]
dmesg
Comment 3 juantascon 2014-03-27 21:17:48 UTC
Created attachment 96491 [details]
list of updated packages
Comment 4 juantascon 2014-03-27 21:18:06 UTC
Created attachment 96492 [details]
xorg.0.log
Comment 5 juantascon 2014-03-27 21:25:59 UTC
I Tried as you suggested setting /sys/class/drm/card0/gt_min_freq_mhz as max freq but same result.

I tried downgrading according to the recent updates (attached) but no luck either.

I've also attached the output of dmesg and the xorg.0.log both logged while running the updated version of those packages.

Something else that I think might be related to the issue is that my laptop is getting considerably hotter wile browsing, I have GPU compositing on all pages on chrome but I feel like the gpu is not being used.

Thank you
Comment 6 Daniel Vetter 2014-03-27 21:28:58 UTC
glxinfo output is missing. Also I don't see any attempts to downgrade mesa/kernel to earlier versions, they're also part of the gfx driver stack.

Logs look sane thus far.
Comment 7 juantascon 2014-03-27 21:33:49 UTC
Created attachment 96495 [details]
glxinfo
Comment 8 juantascon 2014-03-27 21:39:04 UTC
I've attached the glxinfo.

Those were the only packages updated since the last moment I know was working well. In arch "linux" is the kernel, I downgraded that one, but mesa was upgraded on the 17th, almost 2 weeks ago, and I played videos/games this weekend without issues.

Should I downgrade mesa?
Comment 9 Chris Wilson 2014-03-27 21:53:28 UTC
(In reply to comment #5)
> I Tried as you suggested setting /sys/class/drm/card0/gt_min_freq_mhz as max
> freq but same result.

Can you confirm that RPSWREQ and CAGF are 1050MHz after doing so?

If you get really bored, try http://cgit.freedesktop.org/~ickle/linux-2.6/log/?h=pmu, SNA and intel-gpu-overlay (from http://cgit.freedesktop.org/xorg/app/intel-gpu-tools/). That should give a graph of what is going on with render requests, CPU and GPU frequencies.
Comment 10 Daniel Vetter 2014-03-27 22:17:32 UTC
/sys/kernel/debug/dri/0# cat i915_cur_delayinfo

To look at the values Chris' mentioned. You need to have debugfs enabled in the kernel config and mounted ofc.
Comment 11 Enrico Tagliavini 2014-03-28 12:18:38 UTC
Looks like I have the same problem.

GPU: IVB 00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
CPU: core i7-3667U

OS: gentoo

Today I updated xorg server to 1.15 from 1.14 and video-intel from 2.99.910 to 2.99.911 alongside a bunch of xorg, proto and similar packages. Mesa was already at 10.1.0 and was working well until this update (very well I should say).

I can downgrade video-intel if needed, Xorg is a bit more complicated.

Symptom: I use KDE (4.11.5 atm), with vsync enabled in KWin. I use the setting "full screen repaints", which is the only one giving me tear free VLC. From the update I get something like 5 fps fopr screen updates. glxgears still reports around 60, even if what is displayed is obviously less. Guess the compositor is in the middle here as well.

Using the automatic vsync setting, will trigger the issue only when KWin choose to enable vsync, so it is harder to reproduce. Disabling vsync cause no issue at all.
Comment 12 Chris Wilson 2014-03-28 12:27:18 UTC
Enrico, let's try the simple step of checking with xf86-video-intel-2.99.910 then.
Comment 13 Enrico Tagliavini 2014-03-28 13:19:27 UTC
(In reply to comment #12)
> Enrico, let's try the simple step of checking with xf86-video-intel-2.99.910
> then.

Sound will try that now.

This is the complete list of packages updated from yesterday btw

x11-proto/xproto-7.0.25
x11-proto/xextproto-7.3.0
x11-libs/xtrans-1.3.3
sys-apps/hwids-20140317
sys-apps/tcp-wrappers-7.6.22-r1
x11-proto/xf86driproto-2.1.1-r1
x11-proto/dri2proto-2.8-r1
app-emulation/virtualbox-additions-4.3.10-r1
dev-libs/libaio-0.3.109-r4
app-emulation/virtualbox-modules-4.3.10
x11-misc/xkeyboard-config-2.11
x11-proto/glproto-1.4.17
app-misc/ca-certificates-20130906-r1
x11-libs/xcb-util-wm-0.4.1
x11-base/xorg-drivers-1.15
x11-libs/cairo-1.12.16
virtual/opengl-7.0-r1
x11-apps/xauth-1.0.8
media-libs/glu-9.0.0-r1
virtual/glu-9.0-r1
x11-base/xorg-server-1.15.0
x11-drivers/xf86-input-keyboard-1.7.0
x11-drivers/xf86-input-mouse-1.9.0
x11-drivers/xf86-input-synaptics-1.7.4
x11-drivers/xf86-video-intel-2.99.911
x11-drivers/xf86-input-evdev-2.8.2
media-libs/freeglut-2.8.1-r1
www-client/firefox-28.0
app-emulation/virtualbox-4.3.10
app-emulation/virtualbox-extpack-oracle-4.3.10.93012
x11-drivers/nvidia-drivers-334.21-r1
Comment 14 Enrico Tagliavini 2014-03-28 13:26:10 UTC
Btw about the frequency (this is still with the lastest video-intel, so before the downgrade)

When I enable vsync:

root@schroedingerscat /s/k/d/d/0 # cat i915_cur_delayinfo 
GT_PERF_STATUS: 0x000014a8
RPSTAT1: 0x00041415
Render p-state ratio: 20
Render p-state VID: 168
Render p-state limit: 255
RPNSWREQ: 1000MHz
CAGF: 1000MHz
RP CUR UP EI: 7526us
RP CUR UP: 7526us
RP PREV UP: 2512us
RP CUR DOWN EI: 4760us
RP CUR DOWN: 4760us
RP PREV DOWN: 5279us
Lowest (RPN) frequency: 350MHz
Nominal (RP1) frequency: 350MHz
Max non-overclocked (RP0) frequency: 1150MHz
Max overclocked frequency: 1150MHz

When vsync is disabled:
root@schroedingerscat /s/k/d/d/0 # cat i915_cur_delayinfo 
GT_PERF_STATUS: 0x0000078b
RPSTAT1: 0x00040708
Render p-state ratio: 7
Render p-state VID: 139
Render p-state limit: 255
RPNSWREQ: 350MHz
CAGF: 350MHz
RP CUR UP EI: 5965us
RP CUR UP: 0us
RP PREV UP: 796us
RP CUR DOWN EI: 16429us
RP CUR DOWN: 796us
RP PREV DOWN: 1610us
Lowest (RPN) frequency: 350MHz
Nominal (RP1) frequency: 350MHz
Max non-overclocked (RP0) frequency: 1150MHz
Max overclocked frequency: 1150MHz
Comment 15 Enrico Tagliavini 2014-03-28 13:31:03 UTC
Gone back to x11-drivers/xf86-video-intel-2.99.910 and nothing changed :(
Comment 16 juantascon 2014-03-28 14:56:31 UTC
(In reply to comment #10)
> /sys/kernel/debug/dri/0# cat i915_cur_delayinfo
> 
> To look at the values Chris' mentioned. You need to have debugfs enabled in
> the kernel config and mounted ofc.

this is the full output:

GT_PERF_STATUS: 0x00000700
RPSTAT1: 0x00048700
Render p-state ratio: 7
Render p-state VID: 0
Render p-state limit: 255
RPNSWREQ: 1050MHz
CAGF: 350MHz
RP CUR UP EI: 685us
RP CUR UP: 56us
RP PREV UP: 0us
RP CUR DOWN EI: 21816us
RP CUR DOWN: 57us
RP PREV DOWN: 0us
Lowest (RPN) frequency: 350MHz
Nominal (RP1) frequency: 350MHz
Max non-overclocked (RP0) frequency: 1050MHz
Max overclocked frequency: 1050MHz

seems like RPNSWREQ changes properly but CAGF doesn't
Comment 17 Enrico Tagliavini 2014-03-31 16:19:45 UTC
Just downgraded to mesa 10.0.4 and the issue looks gone at first glance. Now I get almost fixed 60 fps in KWin with vsync always enabled (full screen repaint option selected). Dropping to 40 and very rarely when moving windows around like crazy with the wobbly windows enabled.

This is weird. xserver 1.14 with mesa 10.1.0 works, xserver 1.15 with mesa 10.0.4 works, but xservere 1.15 with mesa 10.1.0 doesn't work (the subject is vsync indeed).
Comment 18 Chris Wilson 2014-03-31 21:00:43 UTC
Is there anyway we can find out the differences in fbconfig configuration used by the working/broken setups? For that is what I suspect is key here (e.g. Xorg 1.15.0 returning a different order of fbconfigs tricking kwin into selecting an msaa configuration or something.)
Comment 19 juantascon 2014-04-01 02:22:36 UTC
downgrading to mesa 10.0.4 also did it for me, which is weird because it was updated on archlinux more than a month ago, will be using this version until the issues gets solved, if needed I'll be glad to give additional info / test patches, etc
Comment 20 Enrico Tagliavini 2014-04-01 09:37:46 UTC
Created attachment 96709 [details]
unified diff between Xorg.0.log using xserver 1.14 and 1.15

I've collected log when using xserver 1.14 and 1.15 when using mesa 10.1.0. This is the unified diff of the logs. Only difference I can see is DRI3 (enabled in mesa 10.1.0 as well at compile time) adn Backing store.

I've also collected KWin support information from both config, but there is no difference at all unfortunately.
Comment 21 Enrico Tagliavini 2014-04-09 12:22:02 UTC
Hi everybody,

I hope I have a good news. Since I had the issue exposed by KDE KWin I tried to ask to its developers if they had some advise. Thomas Lübking pointed me to bug #74316 and https://bugs.kde.org/show_bug.cgi?id=330986 . He suggested to apply the patches to mesa 10.1.0 to see if the problem was fixed by them from comment 8 in the FDO bug report. I was not able to. Patches were rejected. So I gone to the simple and lazy way and I checked out git master for mesa, which includes that code. The issue looks solved, I'm running xorg xserver 1.15, mesa git master from today and KWin with full screen repaints enabled.

If I understood well that code is already in queue for mesa 10.1.1 so hopefully it will be fixed in a release soon.

I would like to thank you Thomas Lübking for the winner advise, Martin Gräßlin for his offer of help and Chris Wilson for the patience of spending 2 days with me trying to debug the issue on IRC and answering my newbie questions.

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.