Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 351276

Summary: sys-kernel/gentoo-sources with x11-drivers/xf86-video-nouveau hangs the machine when acpi_call or vga_switcheroo are used to switch or turn off nvidia
Product: Gentoo Linux Reporter: Giacomo <delleceste>
Component: [OLD] Core systemAssignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers <kernel>
Status: RESOLVED UPSTREAM    
Severity: normal CC: tuupic, x11
Priority: High    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
URL: https://bugzilla.kernel.org/show_bug.cgi?id=24752
Whiteboard:
Package list:
Runtime testing required: ---

Description Giacomo 2011-01-10 09:34:25 UTC
<=xf86-video-nouveau-0.0.16_pre20101130
>=gentoo-sources-2.6.35-r13
xf86-video-intel-2.14.0.ebuild
>=libdrm-2.4.22

Any operation involving switch through 

/sys/kernel/debug/vgaswitcheroo/switch

as described in 

http://en.gentoo-wiki.com/wiki/Vga_switcheroo

immediately hangs the machine either when X is running or X is restarted.

If it can help, a distribution where this (partially) works is ubuntu 10.10.
The "partially" refers to the fact that the machine crashes whenever suspend or hibernate is performed after a switch.

acpi_call method described here

http://linux-hybrid-graphics.blogspot.com/2010/07/using-acpicall-module-to-switch-onoff.html

has the same behaviour.

NOTE:
I do not know whether the issue is related to nouveau kernel module or x86-video-nouveau, but disabling the nouveau module from the kernel build option makes acpi_call work, as long as the switch off of the NVidia card is concerned.

NOTE2:
As to suspend/hibernate/resume/reboot, acpi_call without nouveau kernel module seems not to interfere with system stability when suspending/hibernating and then resuming, but:

a)
on resume, both calls

echo "ON" > /proc/acpi/acpi_call
echo "OFF" > /proc/acpi/acpi_call 

are necessary (echo "OFF" > /proc/acpi/acpi_call is not enough) to turn off again the NVidia card, that means that on resume the state of the card is not restored to off and that the echo "OFF" alone is not enough to turn it off.

b) if I reboot, I am not able to turn off Nvidia by using

echo "OFF" > /proc/acpi/acpi_call

but if I shutdown and then echo "OFF" > ... it's ok again.

Hope it helps solving the issue.

Hardware:

ASUS U30JC intel i915 + nvidia Optimus.

Thanks in advance.

Giacomo
Elettra Synchrotron Radiation Facility
Trieste, Italy

Reproducible: Always

Steps to Reproduce:
See above
Comment 1 Chí-Thanh Christopher Nguyễn gentoo-dev 2011-01-10 10:45:54 UTC
Was the issue already reported to kernel or freedesktop bugzilla? If yes, then please add the URL to the bug.
Comment 2 Giacomo 2011-01-10 11:26:50 UTC
Hi. Yes the problem has been already discussed in different places:

1. kernel mailing lists

http://kerneltrap.org/mailarchive/linux-kernel/2010/12/10/4657804

2. dri-devel mailing lists (with subsequent discussion with Dave Airlie)

http://www.mail-archive.com/dri-devel@lists.freedesktop.org/msg06098.html

3. acpi mailing lists

http://comments.gmane.org/gmane.linux.acpi.devel/48758

Up to now, I cannot understand the reason why in ubuntu 10.10 it partially works. I checked the kernel configuration many times and, as to graphics support and acpi, they appear to be equivalent (nouveau and i915 built as modules, same options enabled...) the difference is in the version of the xf86-video-nouveau (and maybe intel and drm) installed by 10.10 and gentoo.

Another detail: it is very difficult to catch any debug info. I got it once and it said something about

PFIFO_CACHE_ERROR - Ch %d/%d  Mthd 0x%04x Data 0x%08x\n
(with integers and pointer addresses in place of %d and %h)

and, just before dying:

[drm] nouveau 0000:01:00.0: PFIFO still angry after 101 spins, halt

Thanks for your interest.

Any hint to reproduce the (partially) working behaviour of ubuntu is appreciated (since I love gentoo...).

The problems concerning hibernate, suspend and resume still persist in both versions.

Giacomo
Comment 3 Giacomo 2011-02-27 12:18:14 UTC
I can confirm the behaviour with 2.6.37 gentoo sources.
Some more details:

without compiling nouveau module (I just wanted to be able to switch off
nvidia card) 2.6.35 works with acpi_call module (card seems to switch off,
I gain 4 watts of power).

2.6.37 + acpi_call, used in the same way as 2.6.35 hangs again the machine.

So I must stay with 2.6.35.
Comment 4 Mike Pagano gentoo-dev 2011-03-17 20:42:03 UTC
We'll follow the upstream bug.