Bumblebee-Project / Bumblebee-old

nVidia Optimus support for GNU/Linux aimed at stability. Rewritten and improved fork
https://launchpad.net/~bumblebee
117 stars 5 forks source link

Bumblebee not working on Lenovo Y470 #149

Closed Y6b closed 12 years ago

Y6b commented 13 years ago

Hi there

I have a Lenovo Y470 with an nVidia GT 550M card and i7 2nd Gen Intel Proc.

The Linux distro I am using is Backtrack 5R1 (ported from Ubuntu Lucid).

Tried installing Bumblebee with latest nVidia drivers using x-swat ppa, but I am still getting errors of the following:

The Bumblebee X server was not available, please check the
Bumblebee logfile at /var/log/bumblebee.log
==================================================

Which always leads me to:

Nov  8 02:15:01 bt kernel: [ 4071.419800] NVRM: failed to copy vbios to system memory.
Nov  8 02:15:01 bt kernel: [ 4071.422925] NVRM: RmInitAdapter failed! (0x30:0xffffffff:864)
Nov  8 02:15:01 bt kernel: [ 4071.422932] NVRM: rm_init_adapter(0) failed

Its really annoying and I lost a night of sleep due to this :-/...please help :-)

Thank you

Y6b

Lekensteyn commented 13 years ago

Could you try blacklisting nouveau for now?

echo blacklist nouveau | sudo tee /etc/modprobe.d/blacklist-nouveau.conf
Y6b commented 13 years ago

I am still getting the same issue

I have blacklisted nouveau using the above command but init was still loading it before Linux started (saw this using dmesg command) So I disabled it by editing the grub configuration of my system by adding

nouveau.modeset=0

after vga=791 . Now, nouveau is not loaded but I am still having the same issue. I startx then go to a terminal and run

optirun glxgears

which tells me Bumblebee X server was not available which leads me to the above kernel error message.

Please help

Its really annoying :-/

Lekensteyn commented 13 years ago

Run sudo update-initramfs -u after blacklisting and undo the grub configuration changes.

Samsagax commented 13 years ago

Do you know wich chip your card has? Is known that some chips are not compatible with nvidia drivers. They don't even on windows (they need OEM drivers). Take a look at https://github.com/Bumblebee-Project/Bumblebee/issues/53#issuecomment-1887468

BTW: could you try nouveau (at least could make you card partial working)

Y6b commented 13 years ago

Will run the update-initramfs and undo the GRUB changes

My card is supported, already checked that :)

Its a Gefore GT 550M card (using lspci it has this code: "0df6" , included in the 285 version of the nVidia drivers)

Y6b commented 13 years ago

Still the same issue, and nouveau is not being loaded to.

BTW, I am using the testing branch of Bumblebee (the stable one was giving me the same so I thought the testing branch would have a fix for this)

I think Lenovo has a special configuration on this laptop where the nVIdia driver cant seem to access it.

I tryed also running nvidia-xconfig to get the GPU info, but I get the error below:

NVIDIA: could not open the device file /dev/nvidia0 (Input/output error).

Hopefully this will give a hint to something

I am open to suggestions

Lekensteyn commented 13 years ago

Please generate a bugreport using sudo bumblebee-bugreport and mail it to bumblebee@lists.launchpad.net (or if you don't have a LP account, lekensteyn@gmail.com; I'll forward it then)

Y6b commented 13 years ago

bugreport sent to bumblebee@lists.launchpad.net

Hope you find something

Lekensteyn commented 13 years ago

Get rid of Ironhide:

sudo ppa-purge ppa:mj-casalogic/ironhide

I see you've enabled power management. For that to work, you need to install acpi-call-tools:

sudo apt-get install acpi-call-tools

I also see that you've installed jprobe hacks from byo-switcheroo. Run make uninstall-ubuntu from the git repo of byo-switcheroo:

git clone git://github.com/awilliam/asus-switcheroo.git --depth 1
cd asus-switcheroo
sudo make uninstall-ubuntu
Y6b commented 13 years ago

same problem, same messages in the kernel after running "optirun glxgears"

Lekensteyn commented 13 years ago

Have you rebooted? If the problem persists, please post you kern.log to pastebin.com

Y6b commented 13 years ago

Yes, pastebin link : http://pastebin.com/sjphEfbM

Samsagax commented 13 years ago

Seems nvidia-related. Could you turn off power-management and try again?

Lekensteyn commented 13 years ago

Another user solved this issue by upgrading. Could you try Bumblebee on a newer Ubuntu version. The Live CD will suffice, but for Oneiric you've to edit the boot options and add:

modprobe.blacklist=mxm_wmi,wmi,nouveau

This is necessary because of https://github.com/Bumblebee-Project/Bumblebee/issues/132#issuecomment-2603607

Y6b commented 13 years ago

Samsagax: I dont know how its enabled, as I have checked the bumblebee.conf and its set to "N" as below:

ENABLE_POWER_MANAGEMENT=N

Lekensteyn: Upgrading is not an option, as this is not pure Ubuntu. Its a distro based on it ( called backtrack ). There should be a solution to this, it did work on Ubuntu Lucid before hadnt it?

I will try running the newer ubuntu using a Live CD and will report what happens

Y6b commented 13 years ago

Tried Ubuntu Oneiric (with and without the modprobe blacklist switch above) but I am still getting the issue with the same kernel message. :-/

BTW, I tried on an installed Ubuntu system instead of a LiveCD one.

I have sent the bug report to bumblebee@lists.launchpad.net for you to check

Samsagax commented 13 years ago

Seems that Lenovo is using a chip not supported even from nvidia. Could that be the case?

jm2 commented 13 years ago

I have this exact same laptop and the same issue. I'm running Arch with the latest versions of everything. Nvidia chip is supported by nvidia 285, but the driver fails to load properly on the device for whatever reason.

[ 1038.748597] NVRM: failed to copy vbios to system memory. [ 1038.751789] NVRM: RmInitAdapter failed! (0x30:0xffffffff:864) [ 1038.751797] NVRM: rm_init_adapter(0) failed

Y6b commented 13 years ago

Very weird indeed

It seems its an nVidia driver issue then, a bug report needs to be filed to them

ghost commented 13 years ago

I have the same model of computer and exactly the same issues. Should I submit a bug report?

Lekensteyn commented 13 years ago

If it's the very same machine, then it isn't necessary.

youngy commented 13 years ago

It seems to be the same problem as mine.My machine is Lenovo Y470 i3.It's really annoying.

gsgatlin commented 13 years ago

Hello. I am having the exact same issue as you with a Lenovo ideapad y470 with NVIDIA GeForce GT 550M GPU and i7 core. I did a fresh install of ubuntu 11.10 since I guessed perhaps it has best support for bumblebee? (unity driving me nuts tho) I can put any distro on it for testing purposes if required.

Does anyone know how we could possibly report this problem to Nvidia corp.? Maybe they can fix it in a future release of the binary driver? Perhaps some wording of exactly what the issue is might help? My stab at it: The NVIDIA GeForce GT 550M GPU shipped within a Lenovo ideapad Y470 is somehow "special" and so the NVidia drivers won't load X on the second virtual screen with tools such as bumblebee. (It will compile the driver blob, just not load, tried in fedora also and they compile just fine and recognize the chip) So the hex codes identifying that chip need to be recognized as a valid Nvidia GPU by the driver as it starts up. Is that correct? Is this true in nouveau also? Did not see instructions on using nouveau with bumblebee but am willing to try it out on a fresh install of ubuntu.

Does anyone know how to find out what makes this chip different or special? Such as the codes or whatever to put in a hypothetical bug report to NVidia? I used nvidia version 290.10 drivers in ubuntu 11.10 with bumblebee 2.4.1 if that helps.

jm2 commented 12 years ago

For the record the nouveau driver fails on this system as well. I don't have the exact error currently but it was something along the lines of not finding the video bios or video rom.

Lekensteyn commented 12 years ago

I've looked at the DSDT tables and haven't found either the "legacy" or "real" Optimus methods. The spec sheet does not mention "Optimus" either, just "switchable graphics".

DSDT

What's more interesting is the mention of "VENTURASTATUS" in the \_SB.PCI0.GFX0.SPB method. I've seen "Scott Ventura" before in a different ACPI table.

That \_SB.PCI0.GFX0.SPB Arg0 Arg1 Arg2 Arg3 method is called by \_SB.PCI0.PEG0.VGA._DSM {0xFD,0x88,0xDB,0x95,0x0A,0x94,0x53,0x42,0xA4,0x46,0x70,0xCE,0x05,0x04,0xAE,0xDF} Arg1 Arg2 Arg3 which prints the debug line "SPB DSM - dGPU".

Arg1 (revision ID) must be 0x0101 (equiv. to 0x101) Arg2 (function number) is an integer. Supported functions are:

A WMI method (WMAB) exists that calls \_SB.PCI0.PEG0.VGA.NVIF. I'm not sure what this does as it's pretty undocumented and guessing is hard here.

SSDT4

This is the only SSDT that is related to graphics. There is a method NVOP that has a debug message mentioning "------- NV OPTIMUS DSM --------" which is familar. Le'ts have a closer look. DOH. My analysis on SPB was not necessary, the "real" Optimus function (UUID 0xF8,...,0xE0 func 0x1A) exists in \_SB.PCI0.PEG0.PEGP._DSM. You should be able to use bbswitch for disabling/enabling the card (note that this does not necessarily mean that you can actually use the card).

Now, have you tried a more recent kernel with nouveau? The latest kernels (3.1+?) contains firmware for these newer graphics card (Fermi, NVC0)

jm2 commented 12 years ago

I just tried on an up-to-date Arch install with kernel 3.1.5 (using nouveau method). Here are the pertinent versions:

nouveau-dri 7.11.2-1 xf86-video-nouveau 0.0.16_git20110829-1 bumblebee-git 20111226-1 linux 3.1.5-1

And here is what I got in the kernel log after running "optirun glxgears" (Xorg.8.log shows failure):

[  313.059083] MXM: GUID detected in BIOS
[  313.059184] VGA switcheroo: detected DSM switching method \_SB_.PCI0.PEG0.VGA_ handle
[  313.059203] nouveau 0000:01:00.0: enabling device (0006 -> 0007)
[  313.059210] nouveau 0000:01:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
[  313.059213] nouveau 0000:01:00.0: setting latency timer to 64
[  313.061196] [drm] nouveau 0000:01:00.0: Detected an NVc0 generation card (0x0c1b00a1)
[  313.061198] [drm] nouveau 0000:01:00.0: acceleration disabled by default, pass noaccel=0 to force enable
[  313.066908] vga_switcheroo: enabled
[  313.066915] [drm] nouveau 0000:01:00.0: Attempting to load BIOS image from PRAMIN
[  313.076649] [drm] nouveau 0000:01:00.0: ... BIOS signature not found
[  313.076651] [drm] nouveau 0000:01:00.0: Attempting to load BIOS image from PROM
[  313.076660] [drm] nouveau 0000:01:00.0: ... BIOS signature not found
[  313.076662] [drm] nouveau 0000:01:00.0: Attempting to load BIOS image from PCIROM
[  313.086555] nouveau 0000:01:00.0: Invalid ROM contents
[  313.086649] [drm] nouveau 0000:01:00.0: ... BIOS signature not found
[  313.086653] [drm] nouveau 0000:01:00.0: Attempting to load BIOS image from ACPI
[  313.086659] [drm] nouveau 0000:01:00.0: ... BIOS signature not found
[  313.086661] [drm] nouveau 0000:01:00.0: No valid BIOS image found
[  313.090589] nouveau 0000:01:00.0: PCI INT A disabled

Let me know if you need any more info.

Lekensteyn commented 12 years ago

Please edit, build and load the acpi_call module.

Edit acpi_call.c as follows, replace "#define BUFFER_SIZE 256` by:

#define BUFFER_SIZE 20480
#undef printk
#define printk(x, ...)

Please provide the output of the below bash commands (run as root)

for i in {0..17}; do
  echo "\_SB_.PCI0.PEG0.PEGP._ROM $((4096*i)) 0x1000" > /proc/acpi/call
  cat /proc/acpi/call >> result.txt
done

Pastebin result.txt or mail it to lekensteyn@gmail.com

jm2 commented 12 years ago

Done and here is the pastebin: http://pastebin.com/Z3L50CNb

Lekensteyn commented 12 years ago

The video BIOS appears to be valid (starting with 0x55, 0xaa). Nouveau could be patched for this.

Lekensteyn commented 12 years ago

Looking further, it looks like a bug in the detection of the ACPI handle. The message VGA switcheroo: detected DSM switching method \_SB_.PCI0.PEG0.VGA_ handle is wrong here, nouveau did not check whether the switching method was really available, it just checked whether the _DSM method existed or not. I've written a patch that properly validates the available _DSM functions which would uncover this error. The handle that should be used is not _SB_.PCI0.PEG0.VGA, but_SB_.PCI0.PEG0.PEGP.

Lekensteyn commented 12 years ago

@jm2 Could you apply the patches:

Then recompile nouveau and report the result of modprobing it? I do not expect vga_switcheroo nor bbswitch to work.

jm2 commented 12 years ago

@Lekensteyn I'd be glad to test it for you, but the patches have to go into nouveau_acpi.c which is part of the kernel source right? I'm just running a standard Arch kernel and really don't want to make a custom kernel. If you could give me a quick rundown of how to recompile that kernel module without redoing the whole kernel or all the modules I'd be glad to try it and report back.

Lekensteyn commented 12 years ago

You do not need to recompile the kernel as nouveau is just a module. The next instructions were made for Ubuntu, but the make part should be the same http://pastebin.com/c5XqKSsW

jm2 commented 12 years ago

@Lekensteyn I successfully applied the patch and loaded it. The paste shows the original kernel 3.2 nouveau module load and the patched one after it.

http://pastebin.com/d2NNSXmR

Lekensteyn commented 12 years ago

@jm2 Thanks for testing. Could you run acpidump > acpidump.txt (install acpidump if necessary) and pastebin it?

\_SB.PCI0.GFX0 contains the _DSM call, indeed. But the _ROM call is missing from there. I don't know why the names are changing here, but can you try hardcoding the _ROM call by editing drivers/gpu/drm/nouveau/nouveau_acpi.c, around line 410 (with the previous patches) replace:

status = acpi_get_handle(dhandle, "PEGP._ROM", &rom_handle);

by:

status = acpi_get_handle(NULL, "\\_SB.PCI0.PEG0.PEGP._ROM", &rom_handle);
jm2 commented 12 years ago

@Lekensteyn You are amazing! That last edit allowed nouveau to be properly loaded and "optirun glxgears" now works!

Here's the acpidump: http://pastebin.com/tQmtSHNs

and the latest nouveau load: http://pastebin.com/y96BLaP5

Now hopefully nvidia can follow suit :D

Lekensteyn commented 12 years ago

Awesome, now I need to find a way to properly detect that handle since hardcoding it is not really an option. Thanks for testing!

jm2 commented 12 years ago

No problem. If you need any further testing just let me know.

Lekensteyn commented 12 years ago

@jm2 Then I ask you to test the PM method bbswitch which is used in Bumblebee 3.0 https://github.com/Bumblebee-Project/bbswitch

jm2 commented 12 years ago

I installed dkms-bbswitch-git from the AUR, but the bbswitch module failed to load with no such device.

[  488.245779] bbswitch: Found integrated VGA device 0000:00:02.0: \_SB_.PCI0.GFX0
[  488.245791] bbswitch: Found discrete VGA device 0000:01:00.0: \_SB_.PCI0.PEG0.VGA_
[  488.245893] bbswitch: No suitable _DSM call found.
Samsagax commented 12 years ago

@jm2: Try installing again that package. git has been updated a couple of times now.

jm2 commented 12 years ago

I reinstalled dkms-bbswitch-git as of 9:30pm EST and I get the same result.

[  707.303400] bbswitch: Found integrated VGA device 0000:00:02.0: \_SB_.PCI0.GFX0
[  707.303412] bbswitch: Found discrete VGA device 0000:01:00.0: \_SB_.PCI0.PEG0.VGA_
[  707.303517] bbswitch: No suitable _DSM call found.
Lekensteyn commented 12 years ago

Both handles are invalid. Can you follow the "Reporting bugs" instructions at https://github.com/Bumblebee-Project/bbswitch (the machine information submission on LP can be skipped) and post the results on https://github.com/Bumblebee-Project/bbswitch/issues/2?

jm2 commented 12 years ago

Done. I'll post further updates for bbswitch testing on that issue.

malibu66 commented 12 years ago

I'd just like to report that I am having the same issue on an IdeaPad Y570. Looking forward to seeing the resolution on this.

Ubuntu 11.10, IdeaPad Y570, bumblebee 3.0.1

Lekensteyn commented 12 years ago

See https://github.com/Bumblebee-Project/bbswitch/issues/2#issuecomment-3797568 for getting Y470/Y570 working for now.