Dell Inspiron 7559 Ubuntu Linux Guide

Last updated 10 July 2018

This guide will show you how to install and configure an Ubuntu Linux 16.04/18.04 LTS distribution (Ubuntu, Lubuntu, Xubuntu, Kubuntu, Ubuntu Gnome, Ubuntu MATE) on the Dell Inspiron 7559 laptop.

Do not try to upgrade from Ubuntu 16.04 LTS to 18.04 LTS now. This might crash your OS (Crashed mine! Had to do a fresh install of Ubuntu 18.04 LTS.). Upgrade from 16.04 LTS to 18.04 LTS will be enabled late july.

DISCLAIMER This document just details the processes that I discovered through hours of trial and error to get a stable Ubuntu distribution working on my laptop. I'm not liable for any damage or adverse effects that this has on your system. Always back up your important data before doing any major work to your computer.

Table of Contents

  1. Reading this Guide
  2. Pre-requisites
  3. Installation
  4. Initial Setup
  5. Installing the Nvidia Driver
  6. Update Linux kernel to 4.8.5.
  7. Installing Bumblebee
  8. Installing Power-Management Utilities
  9. Running Games and Applications with the Right GPU
  10. (Optional) Installing the Intel Driver and Firmware
  11. Known Issues

Reading this Guide

While it might seem straightforward, I just want to make sure this document's structure is absolutely clear.

Text within blue boxes indicates instructions intended only for Ubuntu Linux 18.04 LTS. The sections that were not tested with Ubuntu Linux 18.04 LTS will be explicitly stated.

Text within green boxes usually contains clarifying information and could be helpful if you're curious as to why something is the way it is.

Text within a red box like this should never be ignored as it usually contains warning information.

Text in a black box like this usually represents something typed into a terminal or a text file!

sudo apt update

Text like this usually represents something you need to select, click, or a program name to use. Something that you interact with or may see in a text file or interface.

Pre-requisites

Installation

  1. Make sure Secure Boot is disabled from the BIOS.
  2. If you intend to dual boot with Windows, make sure Window's Fast Boot is disabled.
  3. I updated my BIOS to v1.1.8, but I don't think it is required for all of this to work as I had a successful setup following these procedures prior to doing so.

  4. Boot from your installation media.
  5. Highlight the Install Ubuntu entry and press e on your keyboard.
  6. Modify the line that contains quiet splash at the end and change it to:
  7. nomodeset i915_bpo.nomodeset=1 quiet splash
  8. Press F10 to boot.
  9. Proceed with the installation as normal.
  10. Reboot.

Initial Setup

  1. Follow Installation steps 4-6 to boot into the operating system.
  2. Connect to a network.
  3. If you didn't do this during the install, update your system.
  4. sudo apt update
    sudo apt upgrade

Installing the Nvidia Driver

  1. Add the proprietary graphics drivers repository.
  2. sudo add-apt-repository ppa:graphics-drivers/ppa
    sudo apt update
  3. Install your chosen Nvidia driver.
  4. sudo apt install nvidia-367

    As of 30 Oct 2016, nvidia-370 is in beta, so I used nvidia-367.

    As of 10 July 2018, nvidia-390 is the most recent stable version and hence I used that.

  5. Open the GRUB configuration file: /etc/default/grub.
  6. sudo vi /etc/default/grub
  7. Change the line that reads GRUB_CMDLINE_LINUX="" to
  8. GRUB_CMDLINE_LINUX="acpi_backlight=native acpi_osi="

    In case of 18.04 LTS, use the below line instead of the above to adjust screen brightness using brightness function keys. GRUB_CMDLINE_LINUX="acpi_backlight=vendor acpi_osi="

    WARNING The system won't boot without these parameters. Since we are now using a different driver, we don't need the old nomodeset parameters anymore. I'm not sure if it's because the ACPI settings are odd/broken. At least with these we can adjust the brightness of the screen with brightness applets/settings since the function keys won't work with this driver.

  9. Save your changes and close the file.
  10. Apply the changes to GRUB. Doing this means that we no longer have to manually add kernel boot parameters to boot like we did earlier in the guide.
  11. sudo update-grub
  12. Switch to the Intel GPU to save power.
  13. sudo prime-select intel
  14. Reboot.

Update to Linux kernel 4.8.5 for better GTX 900 & Optimus support

Did not test this section with 18.04 LTS installation.

  1. Make a directory to download the kernel files to, make sure it's empty then cd into it.
  2. Download the Ubuntu mainline Linux kernel 4.8.5. You need the header files for amd64, all, and the image files for amd64.
  3. wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.8.5/linux-headers-4.8.5-040805-generic_4.8.5-040805.201610280434_amd64.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.8.5/linux-headers-4.8.5-040805_4.8.5-040805.201610280434_all.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.8.5/linux-image-4.8.5-040805-generic_4.8.5-040805.201610280434_amd64.deb

    This wget command will download the correct headers and image files for the 64bit 4.8.5 kernel into the working directory.

    WARNING Be absolutely certain there are no other .deb files in the current directory before this next step.

  4. Install the new kernel.
  5. sudo dpkg -i *.deb
  6. Reboot.

Installing Bumblebee

Did not test this section with 18.04 LTS installation.

Bumblebee is a program that allows "on-the-fly" GPU switching similar to what Nvidia Optimus does on Windows. Unfortunately, Nvidia doesn't exactly support this on Linux. Without Bumblebee, we can only switch GPUs and then log out/back in to change it. This results in us using the power-hungry Nvidia GPU for all applications rather than just the game or program we need it for. And like I said, if we want to change, we have to initiate the change and then log out and back in. Annoying!

Bumblebee provides the convenience of switching the GPU for us just for the given application and then powers down the beefy GPU when we're not using it. Oh, and we don't have to log out then back in. Awesome, right?

  1. Add the Bumblebee Testing repository.
  2. sudo add-apt-repository ppa:bumblebee/testing
    sudo apt update

    We use the Testing repository because the stable repository doesn't have packages for Xenial (16.04).

  3. Install bumblebee.
  4. sudo apt install bumblebee
  5. Open Bumblebee's configuration file ( /etc/bumblebee/bumblebee.conf) in your preferred text editor.
  6. sudo vim /etc/bumblebee/bumblebee.conf
  7. Edit the line in the [bumblebeed] section that looks like Driver= and change it to:
  8. Driver=nvidia
  9. Change every occurence of the word nvidia-current in this file to the Nvidia driver you selected. In my case, it's nvidia-367.
  10. If you're using vi or vim, you can just type :%s/nvidia-current/nvidia-367/g and hit enter to change all occurences of nvidia-current with nvidia-367.

  11. Edit the line in the [driver-nvidia] section to say:
  12. PMMethod=bbswitch
  13. Save your changes and close the file.
  14. Open /etc/modprobe.d/bumblebee.conf in your favorite text editor.
  15. Append blacklist entries to match the Nvidia driver you installed to the bottom of this file.
  16. blacklist nvidia-367
    blacklist nvidia-367-updates
    blacklist nvidia-experimental-367
  17. Reboot
  18. Verify you can use Bumblebee.
  19. optirun glxinfo | egrep -i 'nvidia|gtx'

    You should see some information about your discrete Nvidia GPU that's on the laptop.

    connor@connor-Inspiron-7559:~$ optirun glxinfo | egrep -i 'nvidia|gtx'
    server glx vendor string: NVIDIA Corporation
    OpenGL vendor string: NVIDIA Corporation
    OpenGL renderer string: GeForce GTX 960M/PCIe/SSE2
    OpenGL core profile version string: 4.5.0 NVIDIA 367.57
    OpenGL core profile shading language version string: 4.50 NVIDIA
    OpenGL version string: 4.5.0 NVIDIA 367.57
    OpenGL shading language version string: 4.50 NVIDIA
  20. Verify that the discrete card is now off since we aren't actively running a program with optirun.
  21. cat /proc/acpi/bbswitch

    We should get an output like:

    0000:02:00.0 OFF
  22. OPTIONAL Download and install the VirtualGL tools to benchmark your system and make sure optirun uses the correct video card. I like using glxspheres64

Installing Power-Management Utilities

Battery life isn't too bad when your brightness is a bit lower. I usually install TLP to squeeze some more time out of my Linux battery life. After you install it and verify that it's running, it's pretty hands-off from there and it'll take care of itself from then on.

You won't have the same amount of time on battery as a Macbook does, but depending on the screen brightness, I can usually make it a full day on campus with my laptop doing web browsing, word processing, or programming.

  1. Install tlp and tlp-row.
  2. sudo apt install tlp tlp-rdw
  3. Make sure TLP is running in battery mode.
  4. sudo tlp bat

Running games and applications with the proper GPU

Did not test this section with 18.04 LTS installation.

Running Steam games

  1. Right click on the game in your Steam library and click Properties.
  2. Click Set Launch Options.
  3. Enter primusrun %command%.
  4. If you already have launch options in this box, make sure that you put primusrun at the very beginning and put %command% at the very end and everything should work fine.

  5. Play your game normally by launching it through the Steam client!

Running applications from the command line

Prefix the command with optirun. We did this earlier when we ran glxinfo.

Example:

optirun firefox

Running Wine games

Similar to running command line programs, you can just do:

optirun wine gamenamehere

(Optional) Installing the Intel Graphics Driver and Firmware

Did not test this section with 18.04 LTS installation.

This step is optional just because I followed it to quiet down some "warnings" given saying that some i915 firmware is missing or whatever. It only fixes one or two of the warnings but the other one remains even after installing it. I haven't investigated this too much to see if there's an actual benefit, but as far as I know, you won't harm anything by skipping this.

  1. Download the Intel Graphics Driver Installer.
  2. Install the .deb we just downloaded.
  3. sudo dpkg -i .deb
  4. Run the Intel Graphics Installer for Linux program (you may need to open your dash/search for the application, it has a GUI).
  5. Reboot.
  6. Download the Skylake DMC and GuC graphics firmwares from Intel.
  7. Extract the contents of the archives.
  8. tar -xf name_of_downloaded_file_here

    You'll need to perform that command for both archives.

  9. Go into the extracted folders one at a time and install the firmwares.
  10. sudo bash ./install.sh --install
  11. Reboot

Known Issues

The Brightness Function keys don't work

As already mentioned above, acpi_backlight=vendor setting in GRUB works well with 18.04 LTS installation and hence the brightness function keys do work.

(Possible fix!) Changing the GRUB configuration from acpi_backlight=native to acpi_backlight=vendor may fix this issue. A kind visitor to the guide mentioned that *buntu 16.10, the latest kernel, and those GRUB settings restored brightness function key functionality.

I suspect this has something to do with some weird quirk of the ACPI controls after installing the Nvidia driver. The workaround is described in the Nvidia driver setup section where we modify Grub's boot parameters. This does not regain use of the function keys, but it does allow for controlling the brightness via settings, brightness applet, or some other brightness controller application.

Bumblebee service status says it failed to load module "mouse"

Not entirely sure what this means, but it hasn't really interfered with anything.