Bumblebee-Project / bbswitch

Disable discrete graphics (currently nvidia only)
GNU General Public License v2.0
489 stars 78 forks source link

NVidia card cannot be turned off on Lenovo Yoga 700 #128

Open janjanech opened 8 years ago

janjanech commented 8 years ago

I am trying to use bbswitch on my new laptop. It seems to be impossible to turn off my NVidia card using this module.

janikl janik # echo OFF > /proc/acpi/bbswitch
janikl janik # cat /proc/acpi/bbswitch
0000:02:00.0 ON

dmesg does not contain any relevant info about this problem. The only record about turning off NVidia is:

[ 4681.168621] bbswitch: disabling discrete graphics
[ 4681.168658] ACPI Warning: \_SB_.PCI0.RP09.PEGP._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)

I have found that there is a way to turn off NVidia directly using ACPI method _OFF

janikl janik # echo "\_SB.PCI0.RP09.PEGP._OFF" >> /proc/acpi/call
janikl janik # cat /proc/acpi/bbswitch
0000:02:00.0 OFF
janikl janik # echo "\_SB.PCI0.RP09.PEGP._ON" >> /proc/acpi/call
janikl janik # cat /proc/acpi/bbswitch
0000:02:00.0 ON

I want to let bumblebee to manage turning the NVidia card on and off, so I need to have bbswitch module functional.

janjanech commented 8 years ago

I have made patch for this issue. I know, this is not the cleanest solution, but the _DSM method is really not working for me. The patch adds possibility to use _ON/_OFF methods directly instead. Can someone review the patch, whether it could be applied to the project or not?

onoff.zip

ArchangeGabriel commented 8 years ago

It might be #112.

Lekensteyn commented 8 years ago

@janusko Can you attach your sudo acpidump > acpidump.txt (unzipped please)?

I think that calling _ON on the DGPU handle is too specific for your device. Looks indeed like #112 (and others that rely on DSM instead of the parent device (PCI port))

shmerl commented 8 years ago

I have a similar issue (Lenovo W540, Debian testing, Linux 4.5.0-2-amd64),

Running: sudo tee /proc/acpi/bbswitch <<<OFF

Doesn't turn the discrete Nvidia GPU off. dmesg shows this:

ACPI Warning: \_SB.PCI0.PEG.VID._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20160108/nsarguments-95)

That's what lspci --vvv shows for the card:

Status: D3 NoSoftRst+ PME-Enable- DSel=0 DScale=0 PME-

But bbswitch shows it as still on:

cat /proc/acpi/bbswitch
0000:01:00.0 ON

Any idea if it really means ON, or it's actually off? Any workarounds?

ArchangeGabriel commented 8 years ago

The dmesg output is normal. bbswitch reporting of status might not be accurate, but @Lekensteyn might be able to tell you more about this if you attach the acpidump like he asked for @janusko. ;)

Lekensteyn commented 8 years ago

The reported status is most likely correct, the card is indeed not off. Newer laptops require the power resources on the PCIe port to be disabled to make the graphics card really enter D3cold. I have tagged issues caused by this with "ACPI Power Resources". Will be able to look into again this in two weeks.