1

I have a MacbookPro 5,1/5,2/5,3 that comes with two graphic cards, and by default I get the 9600M GT that consumes more battery that the other one. I have no idea how to deactivate it and activate the second one.

More details after the Bruno's reply:

I'm using Ubuntu :

  • 11.10 64 bits with kernel 3.0.0-15-generic (Zegnus, MBP 5,1)
  • 12.04 64 bits with kernel 3.2-0-24-generic (Megagolgoth, MBP 5,3)

I have installed rEFIt 0.14, and GRUB2 EFI64

I've modified the entry on the file /boot/grub/grub.cfg adding

outb 0x750 0

even though at the top of the file it says:

DO NOT EDIT THIS FILE

It is automatically generated by grub-mkconfig using templates
from /etc/grub.d and settings from /etc/default/grub

I save the file, boot, select the entry and then I have a black screen and nothing more happens.

I've tried https://help.ubuntu.com/community/UEFIBooting#Selecting_the_graphic_card too, with the same result.

Thank you.

zegnus
  • 111
  • Have you had any luck with this? I have the same problem, if I disable 9600 with outb, I get black screen. – Mladen Jablanović Jan 04 '14 at 20:22
  • @MladenJablanović: I'm on MBP5,3 and having severe trouble with the graphics. Maybe we should share results. – bot47 Mar 25 '14 at 12:33
  • This helped me: http://askubuntu.com/questions/149921/how-to-add-a-command-permanently-to-grub2 – Mladen Jablanović Mar 25 '14 at 21:22
  • I need more help. After adding Outb 0x750 0 to grub.cfg. I stuck at black screen at startup. I even cant switch between terminals using alt+F1. What do you suggest My laptop is 5,1 9600M GT with 256 megs of memory. –  Apr 02 '14 at 11:35

1 Answers1

3

To disable the Nvidia 9600M GT you have to add the following to the grub menu entry outb 750x0, ie:

menuentry 'Ubuntu, with Linux 3.0.0-12-generic' --class ubuntu --class gnu-linux     --class gnu --class os {
    outb 0x750 0
    recordfail
    set gfxpayload=$linux_gfx_mode
    insmod gzio
    insmod part_gpt
    insmod ext2
    set root='(hd0,gpt5)'
    search --no-floppy --fs-uuid --set=root bc495raf-515r-4r2b-b3de-0ec679a7303a
    linux   /boot/vmlinuz-3.0.0-12-generic root=UUID=bc495raf-515r-4r2b-    b3de-0ec679a7303a ro hpet=force
    initrd  /boot/initrd.img-3.0.0-12-generic
}

Additionally for powerdown after resume after suspend:

On resume, the discrete graphics controller will be turned on and active. We need to turn it off and switch back to the integrated GPU.

This can be done with a very simple little program:

#include <stdio.h>
#include <sys/io.h>

#define PORT_SWITCH_DISPLAY 0x710
#define PORT_SWITCH_SELECT 0x728
#define PORT_SWITCH_DDC 0x740
#define PORT_DISCRETE_POWER 0x750

static int gmux_switch_to_igd()
{
outb(1, PORT_SWITCH_SELECT);
outb(2, PORT_SWITCH_DISPLAY);
outb(2, PORT_SWITCH_DDC);
return 0;
    }

    static void mbp_gpu_power(int state)
{
    outb(state, PORT_DISCRETE_POWER);
    }

int main(int argc, char **argv)
{
if (iopl(3) < 0) {
perror ("No IO permissions");
return 1;
}
mbp_gpu_power(0);
gmux_switch_to_igd();
return 0;
}

Save that in a file called igd.c. Compile it with gcc -O2 igd.c -o igd. This will create an executable called igd. Executed with superuser privileges, it will turn off the discrete controller and switch to the integrated controller.

Now we need to execute this on resume. Create a file called /etc/pm/sleep.d/10igd

It should contain:

#!/bin/sh
#
/path/to/igd

Where /path/to is the path to where you put the igd executable we created in the previous step.

chmod +x /etc/pm/sleep.d/10igd

This file will be executed on suspend and resume. Done right, that 10igd script would check to see if this is a suspend/resume/freeze/thaw and only execute when needed. As-is, it executes on all of them. No big deal, it won't hurt to run it during freeze or suspend.

I got everything working on my mbp5,1: Sound, LCD Backlight, Keyboard backlight, Fans running low (since disabling 9600M GT),Apple like short cut (CMD+C to copy),Flash (almost stable)... So just ask if you need more help

Bruno Pereira
  • 73,643
remi
  • 607
  • Hi @BrunoPereira, I've updated my question with more details based on your reply. Thank you very much. – zegnus Feb 08 '12 at 13:03