MrMEEE / bumblebee-Old-and-abbandoned

OUTDATED!!!!! - Replaced by "The Bumblebee Project" and "Ironhide"
http://www.martin-juhl.dk/2011/08/ironhide-reporting-for-duty/
469 stars 49 forks source link

Power Consumption when not using NVidia GPU #32

Closed markscsmith closed 13 years ago

markscsmith commented 13 years ago

I've attempted to use the ACPI hack for the m11xr2 to disable the GPU when not in use, but this seems to lock up my system. Any thoughts on when this will be integrated? When I tried the module at https://github.com/mkottman/acpi_call, it worked, but then my system locked up.

MrMEEE commented 13 years ago

This is something I definitely will look into... but right now i'm using all my time on just getting it to work on a majority of the optimus and switchable graphics machines out there..

I will probably get to working on the power stuff in a week or two...

aszczepanek commented 13 years ago

I have played a bit with bumblebee and acpi_call script, and I almost got it to work together. First of all, I'm Asus 1215n user so I use similiar acpi_call script to m11xr2 (https://github.com/peberlein/acpi_call). I the beginning when I tried to use acpi_call to turn off the nvidia card (with bumblebee working) my system hanged up (just like yours @tntc). I tried many possibilities, and one of them (almost) worked!

So what I've done: First I turned off xdm-optimus: sudo /etc/init.d/xdm-optimus stop

then killed xorg process responsible for nvidia card (there are 2 xorgs running). Before I killed that process, I wrote down how can I launch it again (sudo /usr/bin/X -ac -config /etc/X11/xorg.conf.nvidia -sharevts -modulepath /etc/alternatives/xorg_extra_modules-bumblebee,/usr/lib/xorg/modules -nolisten tcp -noreset :1 vt9). I checked, and I was able to launch nvidia xorg successfuly. So far so good. So I killed nvidia xorg, and then turned nvidia card off using acpi_call. Power consumption after that was much lower (time on battery increased from ~3:30h to ~4:45h). System didn't hang up! Then I tried to back to working nvidia, so: 1) Turned nvidia card on using acpi_call (power consumption rised). 2) Tried to launch xorg using command that worked before I turned nvidia card off, but now it doesn't work. It says:

(++) Using config file: "/etc/X11/xorg.conf.nvidia" (==) Using system config directory "/usr/share/X11/xorg.conf.d" NVIDIA: could not open the device file /dev/nvidia0 (Input/output error). (EE) NVIDIA(0): Failed to initialize the NVIDIA GPU at PCI:3:0:0. Please (EE) NVIDIA(0): check your system's kernel log for additional error (EE) NVIDIA(0): messages and refer to Chapter 8: Common Problems in the (EE) NVIDIA(0): README for additional information. (EE) NVIDIA(0): Failed to initialize the NVIDIA graphics device! (EE) Screen(s) found, but none have a usable configuration.

Fatal server error: no screens found

So theoretically nvidia card is on (because power consumption rised) but after acpi_call off-on xorg can't access card. And this is probably the reason, why system hangs up when we use acpi_call to turn off/on nvidia card without killing nvidia xorg - nvidia xorg is still running and suddenly it can't access graphics card, so it locks the system.

I know that my english is not very good, but I had to write it here. @MrMEEE, I hope that will help you, when you will decide to do something with power consumption. Maybe you will manage to turn nvidia card on that it will accessible for xorg? :) I have the feeling that it is the only thing that prevents anybody from implementing some script controling nvidia card (stop xdm-optimus(works) -> kill nvidia xorg (works) -> turn nvidia card off (works) -> turn nvidia card on (something goes wrong :/) -> launch nvidia xorg (works when nvidia card is enabled correctly) -> start xdm-optimus(works) ).

MrMEEE commented 13 years ago

I'll just put this link, provides by here..

http://blog.marcrische.de/archives/49-Asus-1215N-NVIDIA-ION2-ein-bzw.-ausschalten.html

I'll try to see if I can implement that into bumblebee in the weekend...

MrMEEE commented 13 years ago

Link provides by Marc Rische...

BlueCase commented 13 years ago

My way at the moment: Config: /etc/moduels -> #nvidia-current /etc/init.d/xdm-optimus -> change start) to startnow)

Script bumblebee ON: acpi_call GPU ON (On Startup off) modprobe -r apci_call modprobe nvidia-current /etc/init.d/xdm-optimus startnow /usr/bin/vglclient-service & disown

Script bumblebee off: killall vglclient-service /etc/init.d/xdm-optimus stop modprobe -r nvidia-current modprobe apci_call acpi_call GPU OFF

That work for me at the moment

beta992 commented 13 years ago

I know we are on Linux, but on Windows the nVidia card is also still running, and doesnt switches off from wat I understand.

So the battery consume must be the same, as on Windows.

aszczepanek commented 13 years ago

@beta992, you are wrong. Windows is able to switch off nvidia card when it doesn't use it. It's 1,5-2h more time on battery do there is significant

aszczepanek commented 13 years ago

*So this is significant issue.

beta992 commented 13 years ago

@BarzantMD: So they do switch the nVidia GPU off.. Hmm, maybe it would be an idea that the nVidia GPU starts in off position, when optirun32/optirun64 is enabled, nVidia GPU gets on, and when the proces is ended, the nVidia GPU is in off position again.

Maybe a solution with acpi_call maybe.. But that is just easy talking, I'm not a programmer. :P

MrMEEE commented 13 years ago

I can't get the reenabling of the card to work through acpi_call...

I use the m11xr2.sh script as I have a Alienware M11X R2...

falcon acpi_call # ./m11xr2.sh off NVOP {0x41, 0x00, 0x00, 0x11} _PS3 0x3

falcon acpi_call # ./m11xr2.sh on _PS0 0x0

Seems to work fine... Battery usage goes up and down... But the card is not functionel after.. getting:

6239.015 NVIDIA(0): Default visual is TrueColor 6239.015 NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0) 6239.015 NVIDIA(0): Option "ConnectedMonitor" "CRT-0" 6239.015 NVIDIA(0): ConnectedMonitor string: "CRT-0" 6239.021 NVIDIA(0): The NVIDIA GPU at PCI:1:0:0 is not supported by the 270.41.06 6239.021 NVIDIA(0): NVIDIA driver. 6239.021 NVIDIA(0): Failed to initialize the NVIDIA graphics device! 6239.021 UnloadModule: "nvidia"

markscsmith commented 13 years ago

That's exactly the same issue I ran into. I wonder if a separate ACPI call is required to start the card up?

rockorequin commented 13 years ago

I've got this working with the same basic technique as BlueCase on an XPS 15 L502x. The L502x uses "_SB.PCI0.PEG0.PEGP._OFF" and "_SB.PCI0.PEG0.PEGP._ON" to turn the card off and on, which I got from the acpi_call test.sh script (and I guessed at the ._ON bit).

In case it helps, I've posted a script that lets me manually turn the card off but which will automatically turn it back on to run an app with nvidia acceleration at http://ubuntuforums.org/showthread.php?p=10840004&comment#66. The most important thing that it does is to stop bumblebee and unload the nvidia module before turning the card off... or you get a kernel hang shortly afterwards.

Perhaps if you replace the COMMAND var in the script with the appropriate one for the Alienware, it might work? I'm not familiar with the syntax of the command used in m11xr2.sh though.

It would be nicer obviously if it all happened automatically, and to install it properly you'd also need to install the acpi_call module (is that going into the 2.6.40 kernel though?), but perhaps it's a start.

MrMEEE commented 13 years ago

Ok.. thanks rockorequin..

It works here...

I just didn't remove the nvidia module before turning it off.. and that locked the kernel...

MrMEEE commented 13 years ago

In the newest version i've included support for shutting down the nvidia card, when not in use :D...

I've included scripts for my own laptop, the Alienware M11X R2.. but it should be easy to change them to any machine that works with the acpi_call module...

Currently this is only implemented on Ubuntu.. but I'm hoping to get it ported to others as soon as possible.. Maybe with some help from people actually sitting on these distributions???

BlueCase commented 13 years ago

Hi MrMEEE, i looked in your enable card script. https://github.com/MrMEEE/bumblebee/blob/master/install-files/bumblebee-enablecard Do you have no problems to load the the nvidia module when at the same time acpi_call is already loaded? On my U36JC this don't work all the time...

MrMEEE commented 13 years ago

Hi..

This isn't a problem on my machine.. but then you just add that to the script.. and everything should be fine..

rockorequin commented 13 years ago

It's working on mine, thanks. It would be nice if the install script didn't overwrite my bumblebee-enablecard and bumblebee-disablecard each time, though.

What about having different enable/disable files for each computer and selecting the right one at install time? My XPS 15 L502x for instance works with

echo "_SB.PCI0.PEG0.PEGP._ON" > /proc/acpi/call echo "_SB.PCI0.PEG0.PEGP._OFF" > /proc/acpi/call

The installer could use something like "lshw -class system|grep product:" to find the computer model, eg:

product: Dell System XPS L502X (System SKUNumber)

and then match that to the file with the right command. I guess you might need to install lshw first.

And by the way, "/etc/init.d/bumblebee start" actually stops the bumblebee server now.

markscsmith commented 13 years ago

YOU DID IT! On my Alienware M11xR2, I run optirun64 java -jar minecraft.jar. Usage jumps to 35-ish Watts. Exit minecraft, wait a few seconds, and it drops to 15 Watts! Thanks!

rockorequin commented 13 years ago

A small suggestion: an improvement to the enable/disable scripts would be to use something like the code from the acpi_call/test.sh script when showing whether it worked or not:

    echo $m > /proc/acpi/call
    result=$(cat /proc/acpi/call)
    case "$result" in
    Error*)
        echo "failed ($result)"
    ;;
    *)
        echo "works!"
        break
    ;;
    esac

At the moment it prints out a whole bunch of zeros and stuff when I enable the card.

rockorequin commented 13 years ago

Another suggestion re acpi_call: if it's not already installed, the install script could install it permanently on Ubuntu with the following:

    sudo apt-get install dkms git
    git clone http://github.com/mkottman/acpi_call.git
    mkdir /usr/src/acpi_call-0.0.1
    cp -rp acpi_call/* /usr/src/acpi_call-0.0.1
    cp dkms.conf /usr/src/acpi_call-0.0.1
    dkms add -m acpi_call -v 0.0.1
    dkms build -m acpi_call -v 0.0.1
    dkms install -m acpi_call -v 0.0.1

where the dkms.conf file is something like:

    PACKAGE_NAME="acpi_call"
    PACKAGE_VERSION="0.0.1"
    CLEAN="make clean"
    BUILT_MODULE_NAME[0]="acpi_call"
    DEST_MODULE_NAME[0]="acpi_call"
    MAKE[0]="make IGNORE_CC_MISMATCH=1 KDIR=$kernel_source_dir PWD=$dkms_tree/acpi_call/0.0.1/build"
    DEST_MODULE_LOCATION[0]="/kernel/drivers/acpi"
    AUTOINSTALL="yes"

and the Makefile needs modifying to:

    obj-m := acpi_call.o

    default: 
            $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules

    clean:
        rm acpi_call.mod.o acpi_call.o acpi_call.ko

    load:
        -sudo /sbin/rmmod acpi_call
        sudo /sbin/insmod acpi_call.ko

and regarding bumblebee-enablecard and -disablecard, perhaps you could include them as .sample files that people can edit and rename and then the optirun scripts could check if they exist when deciding whether to turn the card on and off? Then the installer wouldn't overwrite them each time you run it.

aszczepanek commented 13 years ago

@MrMEEE, I've just tried your new version of bumblebee with switching nvidia off. I modified bumblebee-enable/disablecard and it works fine - until I suspend my 1215n and resume it - then I cannot enable nvidia. bumblebee-enablecard says:

FATAL: Error inserting nvidia_current (/lib/modules/2.6.38-8-generic/updates/dkms/nvidia-current.ko): No such device

Can you check how it behaves on your m11xr when you try to suspend with nvidia turned off? Do you have this similar problem?

Anyway, thank you for your work - it is awesome that at least I can use my laptop running linux comfortably :)

aszczepanek commented 13 years ago

@up update When I suspend laptop with nvidia truned on, the problem doesn't occur. So probably we only need to make a script in /etc/pm/sleep.d/ which would turn nvidia on before suspend and turn it off when resume. Now I don't have enough time. Maybe later I will try to do that, and if I'll get a fully working configuration I'll post all files I modified for asus 1215n :)

tuxkernel commented 13 years ago

I do:

cd acpi_call/ sudo insmod acpi_call.ko

write password

./m11x.sh off

Power consumption is working (I checked acpi_call module with lsmod command) but I can't enable nNVIDIA again, so I tried the follow:

./m11x.sh on

I tried to run optirun64 torcs but nVIDIA Card not turn on. Am I something wrong? I using Ubuntu 10.10 (2.6.35.28-generic Linux Kernel) HDMI port, finally, works!

Thanks in advance.

aszczepanek commented 13 years ago

@tuxkernel Read carefully all issue topic - you have to remove nvidia module before you turn nvidia off. You didn't do that so it locked the kernel.

But if you have m11xr you just have to download the newest bumblebee and you can use bumblebee-enable/disablecard script without any changes.

MrMEEE commented 13 years ago

Remember to remove the nvidia kernel module before using the m11x-script.. there is an example of this in the newest bumblebee code...

tuxkernel reply@reply.github.com skrev:

I do:

cd acpi_call/ sudo insmod acpi_call.ko

write password

./m11x.sh off

Power consumption is working (I checked acpi_call module with lsmod command) but I can't enable nNVIDIA again, so I tried the follow:

./m11x.sh on

I tried to run optirun64 torcs but nVIDIA Card not turn on. Am I something wrong? I using Ubuntu 10.10 (2.6.35.28-generic Linux Kernel) HDMI port, finally, works!

Thanks in advance.

Reply to this email directly or view it on GitHub: https://github.com/MrMEEE/bumblebee/issues/32#comment_1214124

tuxkernel commented 13 years ago

@BarzandtMD or @MrMEEE:

I installed the lastest or newest bumblebee version on Alienware M11x-R2 with Ubuntu 10.10 (2.6.35.28-generic Linux Kernel) and is working, but I can't disable nVIDIA Card (to get some more battery when I don't use it) During the installation, I saw something like this: to enable/disable nVIDIA Card you must go to /usr/local/bin/ and run bumblebee-enablecard or bumblebee-disablecard (i don't remember very well but something so says)

Then, go /usr/local/bin and execute this command: sudo chmod -x bumblebee-disablecard. Then run sudo sh ./bumblebee-disablecard and nothing. Power consumptions continues same. Am I doing something wrong? I'll be waiting yours instructions to disable nVIDIA Card.

Thanks in advance!

aszczepanek commented 13 years ago

@tuxkernel Scripts bumblebee-enable/disablecard are default commented by char "#". You have to uncomment them. If you've already installed bumblebee, you don't have to reinstall. Just: sudo gedit /var/local/bin/bumblebee-disablecard and uncomment all lines from "rmmod" (remove char #) and: sudo gedit /var/local/bin/bumblebee-enablecard and uncomment all lines from "modprobe".

To run manually these scripts you can just type "sudo bumblebee-enablecard" or "sudo bumblebee-disablecard" - ubuntu recognizes them as local scripts.

MrMEEE commented 13 years ago

Nice to see that a lot of people has started to take up some of the support :D...

@rockorequin Thanks for the feedback.. I'll include some of your corrections/fixes in the next version... For now, I'm not going to include acpi_call in bumblebee.. But it's a nice howto, that should be included in the hybrid graphics wiki: http://hybrid-graphics-linux.tuxfamily.org

@BarzantMD I don't have the suspend problem on my M11X... so it must be hardware specific.. send me the changes for the asus, and I will include them..

up commented 13 years ago

Please remove me from the mailing list. Thanks.

tuxkernel commented 13 years ago

@BarzantMD and @MrMEEE:

Solved! Yujuuuuuuuu! Guys like you need in the network. If you ever come to Mexico, will be waiting a dozen cold beers for you. Thanks ... Thank you very much! Cheers!

Tuxkernel ...

rockorequin commented 13 years ago

Great to see that the new bumblebee-enable/disablecards don't overwrite the old one, and they now give more user-friendly success/failure messages.

Another suggestion: since turning off the nvidia card is so catastrophic if something is still using nvidia, I think a check is essential in bumblebee-disablecard after removing the nvidia module, eg:

    #rmmod nvidia
    #if lsmod | grep -q nvidia; then
    # echo "Error: could not unload nvidia module, leaving card turned on"
    # exit
    #fi

Just out of interest, why does bumblebee use screen now? I don't get output messages displayed anymore (eg framerate in glxgears).

rockorequin commented 13 years ago

Another issue: if you run install.sh with the nvidia card turned off, modprobe nvidia-current reports that there is no device. The install.sh script happily keeps going but fails to detect the card, etc. Perhaps it should call the bumblebee-enablecard script before trying to modprobe nvidia?

MrMEEE commented 13 years ago

@rockorequin Your suggestion for the disable function has been added...

The reason why I use screen, is because I had some problems where the processes forked and the parent process was terminated.. and then the optirun process terminated... so the server was shutdown... this works when using screen and the output should be shown in the newest version... also the output is logged to screenlog.0 ...

rockorequin commented 13 years ago

I see there are now scripts for the x11r2 and p31jg. Would you like to also include bumblebee-enablecard and -disablecard scripts for the Dell XPS 15? Here are the commands for the acpi_call that work on my L502x:

bumblebee-enablecard.xps15:

    acpi_call "\_SB.PCI0.PEG0.PEGP._ON"

bumbebee-disablecard:

    acpi_call "\_SB.PCI0.PEG0.PEGP._OFF"

and if install.sh were ever to try and automatically detect the laptop model so as to install the correct file, which would be ever so cool, this is the output of "sudo lshw -system|grep product":

    product: Dell System XPS L502X (System SKUNumber)
pauloxnet commented 13 years ago

@rockorequin Your howto is good but makefile fails for me:

    $ sudo dkms add -m acpi_call -v 0.0.1

    Creating symlink /var/lib/dkms/acpi_call/0.0.1/source ->
                     /usr/src/acpi_call-0.0.1

    DKMS: add Completed.

    $ sudo dkms build -m acpi_call -v 0.0.1

    Kernel preparation unnecessary for this kernel.  Skipping...

    Building module:
    cleaning build area....(bad exit status: 2)
    make KERNELRELEASE=2.6.38-8-generic IGNORE_CC_MISMATCH=1 KDIR=/lib/modules/2.6.38-8-generic/build PWD=/var/lib/dkms/acpi_call/0.0.1/build....(bad exit status: 2)

    Error! Bad return status for module build on kernel: 2.6.38-8-generic (x86_64)
    Consult the make.log in the build directory
    /var/lib/dkms/acpi_call/0.0.1/build/ for more information.
    0
    0
    ERROR: binary package for acpi_call: 0.0.1 not found

    $ cat /var/lib/dkms/acpi_call/0.0.1/build/make.log 
    DKMS make.log for acpi_call-0.0.1 for kernel 2.6.38-8-generic (x86_64)
    gio 26 mag 2011, 11.28.17, CEST
    Makefile:7: *** separatore  mancante.  Arresto.

Instead using original makefile from https://github.com/mkottman/acpi_call works:

    $ sudo dkms build -m acpi_call -v 0.0.1

    Kernel preparation unnecessary for this kernel.  Skipping...

    Building module:
    cleaning build area....
    make KERNELRELEASE=2.6.38-8-generic IGNORE_CC_MISMATCH=1 KDIR=/lib/modules/2.6.38-8-generic/build PWD=/var/lib/dkms/acpi_call/0.0.1/build....
    cleaning build area....

    DKMS: build Completed.
    paulox@oz:/usr/src/acpi_call-0.0.1$ sudo dkms install -m acpi_call -v 0.0.1

    acpi_call.ko:
    Running module version sanity check.
     - Original module
       - No original module exists within this kernel
     - Installation
       - Installing to /lib/modules/2.6.38-8-generic/updates/dkms/

    depmod....

    DKMS: install Completed.
pauloxnet commented 13 years ago

@MrMEEE Would you like to also include bumblebee-enablecard and bumblebee-disablecard scripts for the Dell Vostro 3500? Here are the commands for the acpi_call that work on my 3500:

bumblebee-enablecard.vostro3500:

acpi_call "\_SB.PCI0.P0P1.PEGP._ON"

bumbebee-disablecard.vostro3500:

acpi_call "\_SB.PCI0.P0P1.PEGP._OFF"

and if install.sh were ever to try and automatically detect the laptop model so as to install the correct file, which would be ever so cool, this is the output of "sudo lshw -c system | grep product":

product: Vostro 3500 (To be filled by O.E.M.)
rockorequin commented 13 years ago

Thanks for spotting that. Did you get it from http://hybrid-graphics-linux.tuxfamily.org/index.php?title=Acpi_call? I'm not sure why it complains about a missing separator. But I think I posted the wrong one - the one I built with has this instead:

    obj-m := acpi_call.o

    default: 
        $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules

    clean:
        rm acpi_call.mod.o acpi_call.o acpi_call.ko

The problem with using the original makefile is that it always builds against the currently running kernel, meaning it might compile against the wrong version kernel if you install a newer one. But this one should pass in the correct kernel version from dkms.

Perhaps you could you try with the new one instead and see if it works?

aszczepanek commented 13 years ago

@MrMEEE, sorry for not respoding but I have now a lot of work (bunch of exams...). Here are scripts for asus1215n to disable/enable card. http://ubot007.strefa.pl/bumblebee-disablecard.1215n http://ubot007.strefa.pl/bumblebee-enablecard.1215n

pauloxnet commented 13 years ago

@MrMEEE Thanks for inclusion of vostro3500 specific script.

My script seems work but I found some difference from your script and mine, there's typo in your version? There's a bug in my script ? Can you improve my script or merge it with yours?

Thanks

bumblebee-disablecard.vostro3500

bumblebee-enablecard.vostro3500

rockorequin commented 13 years ago

The XPS15 scripts in bumblebee don't work either - they give Error: AE_BAD_PARAMETER.

The problem is similar to the one above for the Vostro 3500:

a) The acpi_call string is missing the leading backslash ()

b) bumblebee-enablecard.xps15 sends _OFF instead of _ON in the acpi_call string.

pauloxnet commented 13 years ago

@rockorequin You makefile for acpi_call in the script works well.

There's a way to disable the card at start time ?

aszczepanek commented 13 years ago

@pauloxnet sudo gedit /etc/rc.local and add line in the end of file: bumblebee-disablecard (command that you are diasbling your card) and save.

rockorequin commented 13 years ago

I think bumblebee is trying to disable the card itself at startup. /etc/init.dbumblebee is run at startup and the 'start' argument is treated in the same way as 'stop' argument, meaning it should shut down the card. Also the bumblebee installer now installs the acpi_call module for you, which is great. All you should need to do is ensure you have the right bumblebee-enablecard and bumblebee-disablecard scripts.

pauloxnet commented 13 years ago

Thanks for your replies.

In /etc/init.d/bumblebee the do_start() function call bumblebee-enablecard script and do_stop() function call bumblebee-disablecard script, so my nvidia card go up at start time, and if I call bumblebee-disablecard script manually the power consumption go down.

Why the do_start() function call bumblebee-enablecard at start time if optirun command call bumblebee-disablecard script when it start ? This is a bug ?

rockorequin commented 13 years ago

Yes, do_start() calls the enable script. But if you call "/etc/init.d/bumblebee start" it doesn't call do_start(), it calls do_stop() to try and disable the card at reboot. So optirun calls "/etc/init.d/bumblebee enable" to turn on the card, not "/etc/init.d/bumblebee start".

itsbilal commented 13 years ago

I also have a Dell XPS 15. I fixed the slash '\' and _ON/_OFF issues manually in the files, and then installed bumblebee. Everything's fine, but when I run optirun, the X server starts up well, the card gets enabled, the X server starts up , but the program doesn't start (it used to start before I put the enable/disable bits in place). It appears the nVidia driver isn't able to pick up a just-started card or something.

rockorequin commented 13 years ago

@bilalakhtar: Don't you get any errors at all? My bumblebee-enablecard works fine. Try doing "cat /usr/local/bin/bumblebee-enablecard" to check it contains the required code, which should look something like this:

    #!/bin/bash
    modprobe acpi_call
    if ! lsmod | grep -q acpi_call; then
        echo "Error: acpi_call module not loaded"
        exit
    fi
    acpi_call () {
        echo "$*" > /proc/acpi/call
        result=$(cat /proc/acpi/call)
        case "$result" in
         Error*)
          echo "Enabling nVidia Card failed ($result)."
          ;;
         *)
          echo "Enabling nVidia Card Succeded."
         ;;
        esac
    }
    echo _PS0 $(acpi_call "\_SB.PCI0.PEG0.PEGP._ON")
    modprobe nvidia-current

It needs to be executable (you'll get a permission denied error if it isn't and the server won't start up) which you can do with "chmod +x bumblebee-enablecard".

pauloxnet commented 13 years ago

Bugfix

A typo in disablecard script cause this error: _PS0 Disabling nVidia Card failed (Error: AE_BAD_PARAMETER).

bumblebee-disablecard.vostro3500: bad: echo _PS0 $(acpi_call " \_SB.PCI0.P0P1.PEGP._OFF") work: echo _PS0 $(acpi_call "\_SB.PCI0.P0P1.PEGP._OFF")

rockorequin commented 13 years ago

Should we open separate issues for the bugfixes needed for bumblebee-enablecard.xps15 / bumblebee-disablecard.xps15 / bumblebee-enablecard.vostro3500 / bumblebee-disablecard.vostro3500 ?

itsbilal commented 13 years ago

@rockorequin In my case it seems rmmod nvidia-current fails with 'module not found in /proc/modules' and rmmod nvidia fails with 'module nvidia in use' (shocking, considering the fact that modprobe clearly shows there's no module named nvidia, its nvidia-current on my Ubuntu Oneiric).

And when optirun is run, it seems to enable the card, and then it seems to load the module just fine, but nothing comes up on the screen, just NOTHING. If I Ctrl+C, screen exits, but it never manages to shut off the X server. Even shutting down the computer fails in this case. I have to press-and-hold the power button.

@rockorequin, Are you able to achieve a proper setup with proper enabling/disabling of the nvidia card? If yes then I'll install bumblebee again, I uninstalled it because battery power mattered more for me than graphics (currently having a setup which calls acpi_call to shutoff the nvidia card at boot, nouveau is blacklisted, nvidia driver not installed, and stuff moves on well :) ).