Macbook Pro backlight control not working on Ubuntu 16.04

Solution 1:

  1. In the Terminal application enter:
sudo nano /usr/share/X11/xorg.conf.d/10-nvidia-brightness.conf
  1. Paste:
Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "[GPU]"
    Option         "RegistryDwords" "EnableBrightnessControl=1"
EndSection
  1. In a new terminal tab (Control + T) or window enter:

lspci | grep -i --color 'vga\|3d\|2d'

  1. In the first terminal substitude the word [GPU] for the name between brackets shown in the second terminal, leaving out the brackets.

  2. Save the document in the first terminal (Control + O), and reboot the computer.

Solution 2:

For me, adding the setpci command to /etc/rc.local worked, but only after I also added the shebang #!/bin/sh and made the file executable. This could be the reason why that solution doesn't work for people in whose systems rc.local didn't already exist.