Bug 66281

Summary: DRI_PRIME=1 glxinfo crashes and causes session to restart
Product: Drivers Reporter: mortem.dei
Component: Video(DRI - non Intel)Assignee: drivers_video-dri
Status: NEW ---    
Severity: high CC: areyaargaurav, imirkin, mortem.dei, squan, sven.pilz+linux, szg00000
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.13 rc2 Subsystem:
Regression: No Bisected commit-id:
Attachments: lspci -v output

Description mortem.dei 2013-12-01 21:01:17 UTC
I have a new laptop but the secondary GPU can't be accessed by the system (neither with Nouveau nor bumblebee). With the kernel 3.12 the output of xrandr didn't even show the card, but with the new one I do get the following output:


xrandr --listproviders

Providers: number : 2
Provider 0: id: 0x66 cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 4 outputs: 3 associated providers: 1 name:Intel
Provider 1: id: 0x3f cap: 0x5, Source Output, Source Offload crtcs: 0 outputs: 0 associated providers: 1 name:nouveau

However, when I try to run anything with DRI_PRIME=1 glxinfo the system crashes and I have to restart the session.

OS: Ubuntu 13.10
Laptop: Lenovo Ideapad u430p

Hardware: See lspci:

09:00.0 3D controller: NVIDIA Corporation GK208M [GeForce GT 730M] (rev a1)
	Subsystem: Lenovo Device 3800
	Flags: bus master, fast devsel, latency 0, IRQ 68
	Memory at b3000000 (32-bit, non-prefetchable) [size=16M]
	Memory at a0000000 (64-bit, prefetchable) [size=256M]
	Memory at b0000000 (64-bit, prefetchable) [size=32M]
	I/O ports at 3000 [size=128]
	Expansion ROM at <ignored> [disabled]
	Capabilities: [60] Power Management version 3
	Capabilities: [68] MSI: Enable+ Count=1/1 Maskable- 64bit+
	Capabilities: [78] Express Endpoint, MSI 00
	Capabilities: [100] Virtual Channel
	Capabilities: [128] Power Budgeting <?>
	Capabilities: [600] Vendor Specific Information: ID=0001 Rev=1 Len=024 <?>
	Kernel driver in use: nouveau
Comment 1 mortem.dei 2013-12-01 21:03:52 UTC
Created attachment 116991 [details]
lspci -v output
Comment 2 Gaurav Shukla 2014-05-09 17:11:37 UTC
Exactly same thing is happening with me. I have the following kernel:

uname -a output:

Linux localhost.localdomain 3.14.2-200.fc20.x86_64 #1 SMP Mon Apr 28 14:40:57 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

xrandr --listproviders output:

Provider 0: id: 0x66 cap: 0xb, Source Output, Sink Output, Sink Offload crtcs: 3 outputs: 4 associated providers: 1 name:Intel
Provider 1: id: 0x3f cap: 0x5, Source Output, Source Offload crtcs: 0 outputs: 0 associated providers: 1 name:nouveau

However, when I try to run anything with DRI_PRIME=1 glxinfo the system crashes and I have to restart the session.

I am also neither able to load NVIDIA drivers, nor run bumblebee.

lspci -v output:

01:00.0 3D controller: NVIDIA Corporation GK208M [GeForce GT 740M] (rev a1)
	Subsystem: Acer Incorporated [ALI] Device 0836
	Flags: bus master, fast devsel, latency 0, IRQ 44
	Memory at b2000000 (32-bit, non-prefetchable) [size=16M]
	Memory at a0000000 (64-bit, prefetchable) [size=256M]
	Memory at b0000000 (64-bit, prefetchable) [size=32M]
	I/O ports at 2000 [size=128]
	Expansion ROM at <ignored> [disabled]
	Capabilities: <access denied>
	Kernel driver in use: nouveau
	Kernel modules: nouveau
Comment 3 Ilia Mirkin 2014-05-09 17:27:59 UTC
Make sure that

(a) You're using a kernel 3.14 or higher (3.13 introduced modesetting but not the firmware required for acceleration for the gk208)
(b) You're not using bumblebee (3.12 introduced runtime pm support for nouveau)
(c) You have runtime pm and vga switcheroo enabled in your kernel
(d) You're using xf86-video-nouveau 1.0.10 (first version to add gk208 support)

If you want 3d accel to be anywhere near working, I would also recommend grabbing mesa 10.2-rc1 as that has a number of instruction emission fixes, although simple programs like glxgears are likely to work on older mesa versions as well.

Lastly, as per http://nouveau.freedesktop.org/wiki/Bugs/, you will find the fdo bugtracker a much more reliable way to reach nouveau developers.
Comment 4 Gaurav Shukla 2014-05-09 17:45:52 UTC
(In reply to Ilia Mirkin from comment #3)
> Make sure that
> 
> (a) You're using a kernel 3.14 or higher (3.13 introduced modesetting but
> not the firmware required for acceleration for the gk208)
> (b) You're not using bumblebee (3.12 introduced runtime pm support for
> nouveau)
> (c) You have runtime pm and vga switcheroo enabled in your kernel
> (d) You're using xf86-video-nouveau 1.0.10 (first version to add gk208
> support)
> 
> If you want 3d accel to be anywhere near working, I would also recommend
> grabbing mesa 10.2-rc1 as that has a number of instruction emission fixes,
> although simple programs like glxgears are likely to work on older mesa
> versions as well.
> 
> Lastly, as per http://nouveau.freedesktop.org/wiki/Bugs/, you will find the
> fdo bugtracker a much more reliable way to reach nouveau developers.

Thank you for your response! 

(a) I am using the following kernel (3.14.2)

uname -a output:

Linux localhost.localdomain 3.14.2-200.fc20.x86_64 #1 SMP Mon Apr 28 14:40:57 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

(b) Although I had installed bumblebee, it is not running. Optirun said that bumblebee service is not running. I have removed bumblebee now.

(c) How do I check that runtime pm and vga switcheroo are enabled in my kernel. (Sorry, but I am a newbie to Linux).

(d) I cannot be sure about this as well. AFAIK, the nouveau module is built into the kernel. The modinfo result is as below:

# modinfo nouveau
filename:       /lib/modules/3.14.2-200.fc20.x86_64/kernel/drivers/gpu/drm/nouveau/nouveau.ko
license:        GPL and additional rights
description:    nVidia Riva/TNT/GeForce/Quadro/Tesla
author:         Nouveau Project
alias:          pci:v000012D2d*sv*sd*bc03sc*i*
alias:          pci:v000010DEd*sv*sd*bc03sc*i*
depends:        drm,drm_kms_helper,ttm,mxm-wmi,i2c-core,wmi,video,i2c-algo-bit
intree:         Y
vermagic:       3.14.2-200.fc20.x86_64 SMP mod_unload 
signer:         Fedora kernel signing key
sig_key:        70:1A:CB:03:0B:0C:4F:4F:E5:1E:D7:E7:B6:83:13:3D:AF:30:12:81
sig_hashalgo:   sha256
parm:           tv_norm:Default TV norm.
		Supported: PAL, PAL-M, PAL-N, PAL-Nc, NTSC-M, NTSC-J,
			hd480i, hd480p, hd576i, hd576p, hd720p, hd1080i.
		Default: PAL
		*NOTE* Ignored for cards with external TV encoders. (charp)
parm:           tv_disable:Disable TV-out detection (int)
parm:           ignorelid:Ignore ACPI lid status (int)
parm:           duallink:Allow dual-link TMDS (default: enabled) (int)
parm:           nofbaccel:Disable fbcon acceleration (int)
parm:           agpmode:AGP mode (0 to disable AGP) (int)
parm:           vram_pushbuf:Create DMA push buffers in VRAM (int)
parm:           config:option string to pass to driver core (charp)
parm:           debug:debug string to pass to driver core (charp)
parm:           noaccel:disable kernel/abi16 acceleration (int)
parm:           modeset:enable driver (default: auto, 0 = disabled, 1 = enabled, 2 = headless) (int)
parm:           runpm:disable (0), force enable (1), optimus only default (-1) (int)

Actually I am working on some OpenGL/GLSL projects, for which I need GLSL 4.3, which I believe is still not available in nouveau driver. I was looking forward to be able to install the latest NVIDIA drivers. Will mesa 10,2-rcl solve this issue? Can you please recommend any other solution.

Thank you for your time and effort. For future reference, I will use wiki/bugs.
Comment 5 Ilia Mirkin 2014-05-09 18:02:16 UTC
(In reply to Gaurav Shukla from comment #4)
> (c) How do I check that runtime pm and vga switcheroo are enabled in my
> kernel. (Sorry, but I am a newbie to Linux).

If you have your .config (which, depending on options, may be visible from /proc/config.gz), you can look for

CONFIG_VGA_SWITCHEROO
CONFIG_PM_RUNTIME

Make sure both of those are set to 'y'. (This is only for optimus-type systems, of which I'm assuming yours is one.)

> 
> (d) I cannot be sure about this as well. AFAIK, the nouveau module is built
> into the kernel. The modinfo result is as below:

xf86-video-nouveau is the xorg ddx which interacts with the kernel driver. In some distros, for maximal confusion, it is called something else, like xorg-xserver-video-nouveau or something like that (don't have the exact name, sorry).

> Actually I am working on some OpenGL/GLSL projects, for which I need GLSL
> 4.3, which I believe is still not available in nouveau driver. I was looking
> forward to be able to install the latest NVIDIA drivers. Will mesa 10,2-rcl
> solve this issue? Can you please recommend any other solution.

Mesa 10.2 will support a few more extensions which are part of GL4+, but will not provide all the features required to advertise GL 4.0 support (or GL 4.3, obviously). You can see the general progress of things at http://cgit.freedesktop.org/mesa/mesa/tree/docs/GL3.txt.

However it's rare to need ALL of the features available in GL 4.3, so chances are you could restrict yourself to a lower, supported version + a few extensions.

Also note that GK208, while covered by the nvc0 driver, has some extra-special issues that the GK10x cards (and GF1xx cards) don't have. Hopefully they'll be resolved semi-soon, but the hardware is not easily available.
Comment 6 Gaurav Shukla 2014-05-12 08:24:49 UTC
(In reply to Ilia Mirkin from comment #5)
> (In reply to Gaurav Shukla from comment #4)
> > (c) How do I check that runtime pm and vga switcheroo are enabled in my
> > kernel. (Sorry, but I am a newbie to Linux).
> 
> If you have your .config (which, depending on options, may be visible from
> /proc/config.gz), you can look for
> 
> CONFIG_VGA_SWITCHEROO
> CONFIG_PM_RUNTIME
> 
> Make sure both of those are set to 'y'. (This is only for optimus-type
> systems, of which I'm assuming yours is one.)
> 
> > 
> > (d) I cannot be sure about this as well. AFAIK, the nouveau module is built
> > into the kernel. The modinfo result is as below:

There is no config.gz file in my system. I have tried using "locate" as well. Is there some other way I can find this out.

> 
> xf86-video-nouveau is the xorg ddx which interacts with the kernel driver.
> In some distros, for maximal confusion, it is called something else, like
> xorg-xserver-video-nouveau or something like that (don't have the exact
> name, sorry).

Can you please tell me how to find out (or search) if this is the case. Even if you can tell me where and how to look for, I will follow.  
> 
> > Actually I am working on some OpenGL/GLSL projects, for which I need GLSL
> > 4.3, which I believe is still not available in nouveau driver. I was
> looking
> > forward to be able to install the latest NVIDIA drivers. Will mesa 10,2-rcl
> > solve this issue? Can you please recommend any other solution.

The latest mesa based DRI drivers through yum is listed as 10.1.1. Will it work?

> 
> Mesa 10.2 will support a few more extensions which are part of GL4+, but
> will not provide all the features required to advertise GL 4.0 support (or
> GL 4.3, obviously). You can see the general progress of things at
> http://cgit.freedesktop.org/mesa/mesa/tree/docs/GL3.txt.
> 
> However it's rare to need ALL of the features available in GL 4.3, so
> chances are you could restrict yourself to a lower, supported version + a
> few extensions.
> 
> Also note that GK208, while covered by the nvc0 driver, has en some
> extra-special issues that the GK10x cards (and GF1xx cards) don't have.
> Hopefully they'll be resolved semi-soon, but the hardware is not easily
> available.
Comment 7 Ilia Mirkin 2014-05-12 10:53:06 UTC
(In reply to Gaurav Shukla from comment #6)
> (In reply to Ilia Mirkin from comment #5)
> > (In reply to Gaurav Shukla from comment #4)
> > > (c) How do I check that runtime pm and vga switcheroo are enabled in my
> > > kernel. (Sorry, but I am a newbie to Linux).
> > 
> > If you have your .config (which, depending on options, may be visible from
> > /proc/config.gz), you can look for
> > 
> > CONFIG_VGA_SWITCHEROO
> > CONFIG_PM_RUNTIME
> > 
> > Make sure both of those are set to 'y'. (This is only for optimus-type
> > systems, of which I'm assuming yours is one.)
> > 
> 
> There is no config.gz file in my system. I have tried using "locate" as
> well. Is there some other way I can find this out.

http://nouveau.freedesktop.org/wiki/Optimus/

Check

/sys/kernel/debug/vgaswitcheroo/switch
/sys/class/drm/card1/power/runtime_status

If both files are there, that means that you have both of those options. Further you can check dmesg for references to 'optimus'.

> 
> > 
> > xf86-video-nouveau is the xorg ddx which interacts with the kernel driver.
> > In some distros, for maximal confusion, it is called something else, like
> > xorg-xserver-video-nouveau or something like that (don't have the exact
> > name, sorry).
> 
> Can you please tell me how to find out (or search) if this is the case. Even
> if you can tell me where and how to look for, I will follow.

A quick way to find out the version of xf86-video-nouveau is to look in your Xorg.0.log file (often located in /var/log). There should be a section like

[     7.016] (II) Loading /usr/lib64/xorg/modules/drivers/nouveau_drv.so
[     7.019] (II) Module nouveau: vendor="X.Org Foundation"
[     7.019]    compiled for 1.15.0, module version = 1.0.10
[     7.019]    Module class: X.Org Video Driver
[     7.019]    ABI class: X.Org Video Driver, version 15.0

Note the "module version". Make sure yours is 1.0.10. Earlier versions did not support GK208.

> > 
> > > Actually I am working on some OpenGL/GLSL projects, for which I need GLSL
> > > 4.3, which I believe is still not available in nouveau driver. I was
> looking
> > > forward to be able to install the latest NVIDIA drivers. Will mesa
> 10,2-rcl
> > > solve this issue? Can you please recommend any other solution.
> 
> The latest mesa based DRI drivers through yum is listed as 10.1.1. Will it
> work?

A large number of shader opcode generation issues for GK110/GK208 are fixed in the 10.2 release. 10.1.x will work enough for like glxgears though. The final 10.2 release should be out on May 30 or so, dunno how long it takes to get into distros though.
Comment 8 sven 2014-07-26 13:26:13 UTC
I guess I have the same problem on a T420, see "https://bugs.freedesktop.org/show_bug.cgi?id=80769".

Can you boot your system with setting the display to discrete (instead of Optimus) in the BIOS? https://bugzilla.kernel.org/show_bug.cgi?id=80321