[How to] Install UBUNTU on Switchable Graphics models

OBSIDIAN PC
OBSIDIAN PC
edited October 2016 in Linux
This guide is just a quick guide on how to install Linux on systems with switchable graphics like the P6 series.

If you are going to dual boot Windows and Linux you should first install Windows. After installing Windows you should set a unllocated partition size for Linux in the Windows Disk Manager.

It is also advised to disable the Fast Boot Feature in Windows. - Google it :P

Now Linux Install:

-Set your Laptop to DISCRETE mode in BIOS (Press F2 when PC turns on)

-Install UBUNTU- Boot from pen (probably need to press F7 to select pen after PC turns on)

-After installing Ubuntu reboot, login into your Ubuntu system and add this ppa - do this in terminal:

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update

-Now Go to the drivers aplication in Ubuntu and install latest NVIDIA driver:
It´s a Window like this:
software-updates-drivers.png

-Reboot

-Go to BIOS and enable MSHYBRID GPU mode

-Now in UBUNTU open the NVIDIA driver control panel and you can now choose which graphic card to use, the option that matters looks like this:
49BIw.png

  • donthertzme
    donthertzme
    I've followed this tutorial on my P650RP-6 and once I switch to Intel and reboot I'm no longer able to login. I have go into tty mode and purge everything NVIDIA related to be able to login again.

    I've also tried bumblebee but that makes it worse. I'm totally unable to boot with bumblebee, can't even enter tty mode.

    Is there any solution? My goal is to completely disable the NVIDIA card in order to get better battery life (6+ hours with Windows, 2 hours tops with Linux).

    I've tried with Ubuntu 16.10 with both UEFI and BIOS.

    (Also for the trackpad to be recognized after installation in UEFI mode I had to add to the grub options 'i8042.reset')
  • OBSIDIAN PC
    OBSIDIAN PC
    I've followed this tutorial on my P650RP-6 and once I switch to Intel and reboot I'm no longer able to login. I have go into tty mode and purge everything NVIDIA related to be able to login again.

    I've also tried bumblebee but that makes it worse. I'm totally unable to boot with bumblebee, can't even enter tty mode.

    Is there any solution? My goal is to completely disable the NVIDIA card in order to get better battery life (6+ hours with Windows, 2 hours tops with Linux).

    I've tried with Ubuntu 16.10 with both UEFI and BIOS.

    (Also for the trackpad to be recognized after installation in UEFI mode I had to add to the grub options 'i8042.reset')

    Yes you are right current ubuntu versions might not be that easy?
    Would be up to test the same on ELEMENTARYOS? I know it should make no difference since it is also UBUNTU based, but last time i installed Elementary all went well and with Ubuntu i had the same problems you just had.

    I will try to setup a model like yours so i can test it myself too.
  • donthertzme
    donthertzme
    I'll give a try then. I've never been a fan of Elementary but if it works I guess I can make the effort :smile:

    I'll make sure to say something after testing it.

    PS: I'm portuguese. Only using English since the original post was in english.
  • donthertzme
    donthertzme
    I've been trying but no success. With elementary I'm actually able to install the nvidia-drivers and change to Intel only.

    Thing is with that change the nvidia graphics card is still on despite not being used.
    As my main goal is to save battery this is not a great solution.

    Trying to install bumblebee on top of that just make it worse as any command that makes use of the graphics card just freezes the computer (total freeze, no keyboard response, not even capslock/numlock change the led on the bottom of the case).

    I pretty much followed this tutorial to try bumblebee, updating the command to the 367/375 nvidia drivers version: http://nlug.ml1.co.uk/2016/02/an-almost-authoritative-guide-to-nvidia-prime-and-bumblebee/5065
  • donthertzme
    donthertzme
    [Update]

    I got it working. As I stated before my goal was not to have the nvidia drivers installed nor to use the nvidia card. It was simply to be able to completely turn off the nvidia card to get the best battery life out of my device (P650RP-6). I dual boot to Windows if I want to game so it really doesn't matter that I don't have the nvidia card properly working.

    (Side note: Using the official nvidia drivers I was able to use the Intel-only option but after that I wouldn't be able to suspend/shutdown/reboot whatsoever. Computer would just freeze with some kernel issue)

    I'll leave here what I've done:

    First things first, as mentioned by @OBSIDIAN PC I went with Elementary OS 0.4 this time. I don't think this made any difference but it's still worth mentioning.

    For the installation/first boot I set it to DISCRETE mode (in UEFI mode).

    When installing I had to use "nomodeset" on the grub options in order to get more than just a black screen.
    Just highlight the install option, press 'e' and add 'nomodeset' just before 'quiet splash' and press F10 to boot.

    Complete the installation and reboot.

    After reboot, you need to edit grub boot options once again. If grub doesn't appear keep shift pressed after the spashscreen from UEFI.

    Once again, highlight the boot option you want and press 'e' to edit.
    The same way you added 'nomodeset' you'll need to add 'i8042.reset' in order to get the trackpad working.

    Boot and login.

    You'll want to update your system right away, so just fire up the terminal and use: 'sudo apt update && sudo apt upgrade'.
    As Elementary doesn't disabled the add-apt-repository option you need to install the following to get it: 'sudo apt install software-properties-common python3-software-properties python-software-properties'

    You may also install intel-microcode as it performs better than the open-source driver that comes with the installation: 'sudo apt install intel-microcode'

    Now, to make the those grub boot options permanent edit the grub config file:
    'sudo nano /etc/default/grub' replace the GRUB_CMDLINE_LINUX_DEFAULT with:
    GRUB_GFXPAYLOAD_LINUX=text
    GRUB_CMDLINE_LINUX_DEFAULT="i8042.reset vga=0 rdblacklist=nouveau nouveau.modeset=0 nvidia.modeset=0 quiet splash acpi_osi='!Windows 2015'"

    GRUB_GFXPAYLOAD_LINUX=text allows to not use nomodeset (nomodeset has detrimental behavior on the long run).
    As mentioned before i8042.reset allows to use the trackpad.
    'vga=0 rdblacklist=nouveau nouveau.modeset=0 nvidia.modeset=0' is used to disable the nouveau and nvidia drivers.
    acpi_osi='!Windows 2015' was recommend as this unit is supposedly very Windows specific and allows to override somethings to make it work properly (i.e. sometimes when I hadn't this I would not be able to use the keyboard)

    We also need to blacklist the nouveau driver:
    "ou can add Nouveau Driver in /etc/modprobe.d/blacklist.conf file. Or create file like /etc/modprobe.d/disable-nouveau.conf with below entries
    blacklist nouveau
    options nouveau modeset=0

    After this run 'sudo update-grub'

    To update the intel card properly I had to add the obaif repository: https://launchpad.net/~oibaf/+archive/ubuntu/graphics-drivers
    Just use 'sudo add-apt-repository ppa:oibaf/graphics-drivers' followed by 'sudo apt update && sudo apt upgrade'

    I also update the intel drivers using this: https://01.org/linuxgraphics/downloads/firmware

    Now all we need to do is to install and enable to tool to shutdown the nvidia card. This can be done by using 'sudo apt install bbswitch-dkms'
    Now you need to enable it by adding to /etc/modules so: 'sudo nano /etc/modules' and just add a line with 'bbswitch'. Save the file and run 'sudo update-initramfs -u -k all'

    Reboot.

    After rebooting the nvidia card despite not being used will still be on and consuming a lot of resources. You can check this by running 'cat /proc/acpi/bbswitch' (the result will be ON).
    To turn it off run 'sudo tee /proc/acpi/bbswitch <<<OFF'.
    If you try to automate this on boot/default behavior you'll most likely not be able to start X (login).
    For now I'm just happy to run this last command one time after login. Maybe I'll turn it into some script/service someday.

    You can check the power usage by running powerstat, a tool that shows power consumption.
    'sudo apt install powerstat' and 'sudo powerstat'. It will take some time to measure properly (180 seconds to start) but you'll see that 'Watts' column value will be under 15 usually. My average was around 13/14 compared to the 22+ with the nvidia turned on.

    Also, if you want to further improve your battery life you can use TLP.
    sudo add-apt-repository ppa:linrunner/tlp
    sudo apt update
    sudo apt-get install tlp tlp-rdw
    sudo tlp start

    Well, I guess that's all and hope this can help whoever else faces the same problems I faced.

    If something goes wrong or if I've written some mistake here, just reply.
  • OBSIDIAN PC
    OBSIDIAN PC
    Wow that is a great guide.
    Will try it myself and maybe make a guide with pictures and all.
    Thank you.
  • donthertzme
    donthertzme
    edited March 2017
    I've been tinkering with it since I wrote it. There's another thing that must be tweaked in order for it to work properly.
    If the computer goes to sleep with the nvidia card off, when it resumes you'll have no control over it whatsoever. Meaning you're back to the point where suspend/reboot/shutdown will freeze. To solve this you have to turn the graphics card on before the suspend action.
    I've went on and tried to automate this (I think it only works for distros based on 15.10 and after. For previous distros the file would have to be somewhere else).
    sudo nano /lib/systemd/system-sleep/suspend_resume_tweak
    

    and save this:
    #!/bin/bash
    case $1/$2 in
      pre/*)
        sudo tee /proc/acpi/bbswitch <<<ON
        ;;
      post/*)
        sudo tee /proc/acpi/bbswitch <<<ON
        ;;
    esac
    

    After saving it, you need to make it executable:
    sudo chmod a+x /lib/systemd/system-sleep/suspend_resume_tweak
    

    And it's done.

    Remember, since you turned it on, you'll have to turn it off again with
    sudo tee /proc/acpi/bbswitch <<<OFF
    
    if you want that extra battery life.

    I've tried to automate this also but it just broke my X session. Had to enter in tty mode to remove those change. I guess I'll just be happy that I can do it manually. I've put the command in a .sh to be easier.

    Btw, f*** NVidia. This has been a longstanding problem from at least the 9xx generation with MSHybrid technology and they never cared enough to solve it properly.

    Although these might be a lot of steps to just get better battery life, I guess it's kind of worth it. Instead of +-2 hours I can now get up to 7 hours!!

    (If you want to game on Linux or don't need the extra battery life just keep the nvidia drivers with NVidia performance mode. It works pretty well though the laptop will run at a few ºC higher)

    PS: I forgot I could use BBCode here. Otherwise this would be much more readable, but I can't edit the other post anymore now.
  • tonhi
    tonhi
    Muchas gracias por el tutorial.
    Yo la única forma que fui capaz anteriormente de instalar bien ubuntu fue cambiando el modo de la bios de uefi a legacy, haciendo esto ya configura automáticamente todo.


Sign In or Register to comment.
© Copyright 2016 - OBSIDIAN PC
All times are GMT