Saturday, April 30, 2016

AMD open-source (Radeon) graphics driver on Ubuntu 16.04


First step will be identifying your graphics chip :
lspci -nn | grep VGA

In Ubuntu 16.04 LTS the open-source driver AMDGPU is enabled by default for the latest cards (https://help.ubuntu.com/community/RadeonDriver).

The next step will be adding the oibaf ppa and doing a system upgrade (ctrl+alt+t) :

sudo add-apt-repository ppa:oibaf/graphics-drivers (https://launchpad.net/~oibaf/+archive/ubuntu/graphics-drivers)
sudo apt install mesa-vdpau-drivers
sudo apt update

sudo apt upgrade 
sudo apt dist-upgrade 

AMD Radeon 9500 and newer GPUs are supported by the mesa-vdpau package.

For better results we will use "dpm" method to improve GPU power management.


For the most recent ATI/AMD graphic cards supported by the Radeon driver, DPM (Dynamic Power Management) should work automatically without additional steps.
Instead if you notice overheating problems and/or you have an old Radeon HD graphic card, you can enable DPM by adding a boot parameter. This should greatly help power consumption, especially when idle. To do so, edit /etc/default/grub and add the 'radeon.dpm=1' to the GRUB_CMDLINE_LINUX_DEFAULT line, so it would look something like:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash radeon.dpm=1"
After you save/quit the text editor, update grub:

sudo update-grub

You can use 3 profiles for DPM :
  • battery
  • balanced
  • performance
Balanced is the most useful one . To enable it type the following in a terminal :

sudo gedit /etc/rc.local

add the following lines in this file (above the line that says "exit 0")


echo balanced > /sys/class/drm/card0/device/power_dpm_state

Save the file and reboot your pc .

The GPU power management can also be configured using TLP which  brings you the benefits of advanced power management for Linux without the need to understand every technical detail. TLP comes with a default configuration already optimized for battery life, so you may just install and forget it. Nevertheless TLP is highly customizable to fulfill your specific requirements. These tweaks will also help with overheating issues!

To avoid any conflicts make sure laptop-mode-tools or cpufrequtils are not installed :


sudo apt remove laptop-mode-tools
sudo apt remove cpufrequtils
Reboot your PC.

To install it open a terminal and type in the following commands (ctrl+alt+t) :

sudo apt install tlp tlp-rdw

To edit tlp configuration type the following command into the terminal :

sudo gedit /etc/default/tlp

TLP comes preconfigured for battery saving , however I have added a more aggressive  power saving configuration, this will work very well on systems with multicore CPU's . Ubuntu is optimized to spread the load on all cores . Make sure to uncomment (remove "#" before editing a line to enable it)










Save and close the file and start tlp :

sudo tlp start

To set tlp in Battery Mode type in sudo tlp batt , for AC Mode we can use the command sudo tlp ac .