Bug 84932

Summary: Optimus with nouveau no longer works with xorg-server 1.16.1
Product: Mesa Reporter: dura <dura>
Component: Drivers/DRI/nouveauAssignee: Nouveau Project <nouveau>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: 10.2   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: dmesg
xorg-server 1.15 log
xorg-server 1.16 log

Description dura 2014-10-12 12:02:25 UTC
Created attachment 107736 [details]
dmesg

I have an optimus laptop with intel HD4000 and nvidia GTX 660M.
With xorg-server 1.16.1 the GPU cannot be used. Replacing xorg-server with 1.15.1 version (and same version drivers) make it works again without making any other changes (even rebooting).

xrandr --listproviders 
xrandr --setprovideroffloadsink nouveau Intel
DRI_PRIME=1 glxinfo | grep "OpenGL vendor string"

With 1.16 version:
Providers: number : 2
Provider 0: id: 0x88 cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 4 outputs: 5 associated providers: 1 name:Intel
Provider 1: id: 0x5f cap: 0x5, Source Output, Source Offload crtcs: 0 outputs: 0 associated providers: 1 name:nouveau
OpenGL vendor string: Intel Open Source Technology Center

With 1.15 version:
Providers: number : 2
Provider 0: id: 0x88 cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 4 outputs: 5 associated providers: 1 name:Intel
Provider 1: id: 0x5f cap: 0x5, Source Output, Source Offload crtcs: 0 outputs: 0 associated providers: 1 name:nouveau
OpenGL vendor string: nouveau

Software versions:
MesaLib-10.3.0
xf86-video-nouveau-1.0.11
libdrm-2.4.58
Linux version 3.16.5
Comment 1 dura 2014-10-12 12:03:46 UTC
Created attachment 107737 [details]
xorg-server 1.15 log
Comment 2 dura 2014-10-12 12:04:26 UTC
Created attachment 107738 [details]
xorg-server 1.16 log
Comment 3 Ilia Mirkin 2014-10-12 14:55:26 UTC
You appear to have bbswtich referenced in your dmesg. Bumblebee is more likely to just mess things up, and adds nothing over the runtime pm functionality present in nouveau since 3.12 or so. [There are situations where that's not working for one reason or another, but this is the minority of situations.]

Do you have customized xorg.conf settings? If so, try moving them out of the way. (I notice that you're probably explicitly loading glamoregl -- no reason to do that, can only cause trouble...)

Probably the big difference between 1.15 and 1.16 is DRI3, perhaps something is going wrong there... you could either try a git xf86-video-intel ddx or disable DRI3 (either at build time or with Option "DRI" "2" in the driver section). However I'm moderately sure this has worked fine for others.
Comment 4 Tobias Klausmann 2014-10-12 16:32:22 UTC
DRI3 does not work "out of the box", you'd need some work. But for now try disabling DRI3!
Comment 5 Ilia Mirkin 2014-10-12 17:01:38 UTC
Looks like for prime + dri3 to work, you need render nodes. I thought they were enabled by default in 3.16, but that is not the case. You can enable them by adding "drm.rnodes=1" to the kernel cmdline. Or you can upgrade to 3.17.
Comment 6 dura 2014-10-12 17:49:33 UTC
Upgrading to kernel 3.17, or booting 3.16 with drm.rnodes=1 do not make it work.
Recompiling xorg-server 1.16 without dri3 make it work.
Comment 7 Tobias Klausmann 2014-10-12 18:21:42 UTC
A last note:
for DRI3 you dont have to do the

xrandr --listproviders 
xrandr --setprovideroffloadsink nouveau Intel

dance anymore, it works without! You can disable the compositor as well with DRI3.

Closing as fixed, feel free to reopen if something is still unclear.

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.