Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am current using the default nouveau driver on my Macbook Pro 9,1. I tried installing nvidia-current, then Ubuntu just went blank after restart.

Is there any safe way to install nvidia proprietary driver?

share|improve this question
    
I have been trying to solve this exact issue for weeks now. Hope someone has an answer... –  Oz. Feb 27 at 3:20
    
Hey I was able to install nvidia driver from the nvidia page. Just grab the driver in .run file and install it. –  Krypton Mar 16 at 17:55
    
However I found that I could switch off the nvidia and run intel card instead. The intel card is much better than nvidia considering I'm not using my MBP mostly for work and study but not gaming. –  Krypton Mar 16 at 17:57

1 Answer 1

I was able to install nvidia driver from the nvidia page. Just grab the driver in .run file and install it.

The command is like this:

sudo stop service lightdm
chmod +x NVIDIA-Linux-x86_64-331.49.run
sudo ./NVIDIA-Linux-x86_64-331.49.run

However I found that I could switch off the nvidia and run intel card instead. The intel card is much better than nvidia considering I'm using my MBP mostly for work and study but not gaming. Following is how I did that:

sudo vi /etc/grub.d/10_linux

+ Add following:
   echo "    outb 0x728 1" | sed "s/^/$submenu_indentation/"
   echo "    outb 0x710 2" | sed "s/^/$submenu_indentation/"
   echo "    outb 0x740 2" | sed "s/^/$submenu_indentation/"
   echo "    outb 0x750 0" | sed "s/^/$submenu_indentation/"
after these lines:
   if [ x$type != xrecovery ] ; then
        echo "    gfxmode \$linux_gfx_mode" | sed "s/^/$submenu_indentation/"
   fi

   echo "    insmod gzio" | sed "s/^/$submenu_indentation/"

+ Rebuild grub:
grub-mkconfig > /boot/grub/grub.cfg

+ Open Grub Customizer, add following options:
i915.lvds_channel_mode=2 i915.modeset=1 i915.lvds_use_ssc=0

+ Reboot and enjoy low power and low heat

+ To confirm Nvidia is off:
sudo cat /sys/kernel/debug/vgaswitcheroo/switch

+ Download mbp_power.c and compile it:
sudo gcc -O2 -o /usr/local/bin/mbp_power mbp_power.c

+ Make it run right after resuming from sleep
vim /etc/pm/sleep.d/10_disable_nvidia.sh

case "${1}" in
    hibernate|suspend)
        # this is called when going to hibernate or to sleep
            ;;
    resume|thaw)
        # this is called when waking up
        /usr/local/bin/mbp_power
            ;;
esac

+ Make sure every thing is executable
chmod +x /usr/local/bin/mbp_power
chmod +x /etc/pm/sleep.d/10_disable_nvidia.sh

mbp_power.c:

// compile:
// sudo gcc -O2 -o /usr/local/bin/mbp_power mbp_power.c


#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);
}

static void mb_gpu_print()
{
    printf("SELECT:  %hhu\n", inb(PORT_SWITCH_SELECT));
    printf("DISPLAY: %hhu\n", inb(PORT_SWITCH_DISPLAY));
    printf("DDC:     %hhu\n", inb(PORT_SWITCH_DDC));
    printf("POWER:   %hhu\n", inb(PORT_DISCRETE_POWER));
}

int main(int argc, char **argv)
{
    if (iopl(3) < 0) {
        perror ("No IO permissions");
        return 1;
    }
    int state=0;
    if (argc > 1) state = atoi(argv[1]);
    printf("Before:\n");
    mb_gpu_print();
    mbp_gpu_power(state);
    gmux_switch_to_igd();
    printf("After:\n");
    mb_gpu_print();
    return 0;
}

Proof in the following pic: enter image description here

share|improve this answer
    
An alternate method to turn off nvidia. ubuntuforums.org/showthread.php?t=2137538 –  philcolbourn Apr 18 at 18:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.