Re: Experiments in refit shell to enable 9400M on MBP 5,1
Booting with "energy save" mode (=with the integrated 9400M card active):
<"Apple Inc.">
<"MacBookPro5,1">
FrameBufferBase: 0xc0010000
Switching the "energy saving" preference to "performance" (dunno remember the setting-name exactly, anyhow I mean the discrete 9600M GT card), log-out, log-in does not change the above!
Rebooting and re-executing the "ioreg" command(s) returns:
9600M GT:
<"Apple Inc.">
<"MacBookPro5,1">
FrameBufferBase: 0xb0030000
Regards, Nikos
Re: Experiments in refit shell to enable 9400M on MBP 5,1
Hello,
Thanks to all the people who gave an early feedback in this thread. They allowed me to validate the method on other machines than mine.
Now I created a new thread calling for volunteers, hoping to broaden the audience and get more results.
Thanks again,
metatech
Re: Experiments in refit shell to enable 9400M on MBP 5,1
Hi everybody,
I think I found the most easiest way to disable the 9600M GT of MBP5,1 (or any other one depending on MBP version) in EFI-Mode.
As you might know, the second card is still powered, even if you use the 9400M, and consumes some amount of energy, reducing the battery life.
Ok, here we go...
Code:
sudo -s
echo 1 > /sys/bus/pci/devices/<pci_addr_of_card>/remove
It's simple, isn't it?
Unfortunately it doesn't seem to work just with
Code:
sudo echo 1 > /sys/bus/pci/devices/<pci_addr_of_card>/remove
since it says "Permission denied".
A simple
will confirm that the device has been removed.
Of course, you can do this with most of the other PCI hardware as well.
To reactivate the removed devices, do a
Code:
sudo -s
echo 1 > /sys/bus/devices/rescan
I still have to verify the drop in the power consumption. What makes me suspicious is that the "NVIDIA X Server Settings" still show the second GPU, including temperature and clock frequency...
Please post if it's working for you or not.
Cheers,
Thomas Gerlach
EDIT:
Well, it seems not to have the effect I wanted to. At least not in EFI mode.
I checked the disabling strategy in BIOS mode (9600M GT only) by disabling the graphics device. It worked, the screen blanked. But immediately after that, the screen came back online, however spawning a console to log in. So something happens, but the graphis driver seems to enable the device again.
In EFI mode using the 9400M, when trying to disable the graphca, nothing happens. Although the device is not listed by "lspci" anymore. So I assume it doesn't work for the 9600M GT either.
Anyway, seems to go into the right direction...keep you posted. :)
EDIT2:
Ok, just tested something. The problem is - oh my - related to the nvidia-drivers.
Here is what I did:
1) Boot in BIOS mode, with "nouveau" activated.
Do the "remove" trick.
-> Screen blanks (and stays so). System is still up (pommed still working; power-button and ENTER shuts down MBP).
2) Boot in BIOS mode, with "nvidia" enabled.
Do the "remove" trick again.
-> Nothing happens (but device is removed from output of "lspci").
Well, the nvidia-drivers have a different behavior in EFI mode than in BIOS mode. BTW, display backlight dimming doesn't work in EFI mode. And let me guess: Might have something to do with nvidia-drivers???
Re: Experiments in refit shell to enable 9400M on MBP 5,1
Thomas,
Thanks for your research…
There is another very promising track to try and disable the 9600M, which was proposed by Sidolin in this thread (his work is much more ambitious in that he is implementing dynamic graphic card switching).
http://ubuntuforums.org/showthread.php?t=1564298
If you look at the attached source code,
http://andreas.meetr.de/gmux/apple_gmux.c
The two following lines should do the magic to disable the 9600M.
#define PORT_DISCRETE_POWER 0x750
outb(0, PORT_DISCRETE_POWER);
[edited:replaced 1 by 0 according to tmg1981's feedback]
On a MBP 6,2 the power consumption goes from 28 W to 10 W !!
http://www.mail-archive.com/hybrid-g.../msg00174.html
Regards,
metatech
Re: Experiments in refit shell to enable 9400M on MBP 5,1
Hi,
well, this sounds really very promising. I checked it (by writing a small program which accesses the corresponding port), and it seems to work, the 9600M GT seems to be disabled!!! Great job, Sidolin, and thanks Metatechbe for posting this.
However, I did the following:
#define PORT_DISCRETE_POWER 0x750
outb(0, PORT_DISCRETE_POWER);
^--- 0, not 1
I didn't try the driver sources attached to the threads pointed to in your last post. I'll check that soon.
Greetings,
Thomas
Re: Experiments in refit shell to enable 9400M on MBP 5,1
Hi Thomas,
Can you please post your program ?
I thought a kernel driver was needed in order to access these memory ranges...
Thanks,
metatechbe
1 Attachment(s)
Re: Experiments in refit shell to enable 9400M on MBP 5,1
Hi all,
Here is the small program called "gpupwr" that can disable the discrete graphic card. Linux must be booted in EFI mode on the integrated graphic card. The program must be run as root, otherwise you will get a "ioperm failed" error.
On a MacBookPro5,3 the power consumption reported by "powertop" is greatly reduced.
9600M enabled and used : 23 Watt
9400M used : 19 Watt
9400M used + 9600 disabled : 16 Watt
Also the temperatures are much lower (these measures are taken during typical web browsing + "ondemand" CPU governor + Bluetooth disabled) :
9600M enabled and used : 55 degrees Celsius
9400M used : 50 degrees Celsius
9400M used + 9600 disabled : 42 degrees Celsius
The program should normally also work on MacBookPro 2010 with Intel integrated graphics.
[edit : alternative]
Alternatively, you can add the following line in grub.cfg. Without it, the "suspend" and the "logout" do not work anymore.
Thanks to Sidolin for finding the "magic" offsets of the gmux device.
metatech
1 Attachment(s)
Re: Experiments in refit shell to enable 9400M on MBP 5,1
Hi Metatech,
sorry for the delay...but I see, you already found the solution how to access IO without building a kernel driver.
It's quite the same what I did...
I attached my version just for comparison...there's also some stuff inside to read the current intensity. However, changing it doesn't work for me yet.
Maybe you can try and write some value to 0x774 and see if the brightness changes.
Thanks so far and cheers,
Thomas
Re: Experiments in refit shell to enable 9400M on MBP 5,1
Any news out there? Someone managed to use his/her dual GPU laptop using the 9400?
Re: Experiments in refit shell to enable 9400M on MBP 5,1
Update : by adding in grub.cfg :
outb 0x750 0
The suspend/resume works fine !