Introduction

If you buy a new laptop with Intel processors and AMD graphics cards, you by default run into this long running dual, hybrid graphics problem under Linux. This post is targeted towards new Linux users, who haven’t dealt with such kinds of problems before.

Problem

I have summarized queries, that is often asked by new Linux users, who use these hardware.

My laptop gets extremely hot while running X distribution

Laptop fan is constantly running, how do I calm or stop it

My laptop is very hot under Linux

Battery life under Linux is very low

Brightness resets everytime I restart the computer

Inspection

First, we have to determine, if you run the AMD-Intel hybrid graphics cards. Open up a terminal (Ctrl + Alt + T) and type following command

Here, first line is the command I typed, and the rest is its output. As you can see, it shows two graphics cards. The one, that is causing the computer to heat up is the second (AMD).

Temporary Solution

Run following commands in a terminal

sudo su
echo OFF > /sys/kernel/debug/vgaswitcheroo/switch

If you haven’t let your computer heat up for quite some time, above command should shutdown the AMD card. Note though, this command only works, if you haven’t installed catalyst driver. I suggest, you use this command every time you install a new Linux based operating system, even if you plan to install the catalyst driver later.

You can inspect the situation using following commands.

sudo su
cat /sys/kernel/debug/vgaswitcheroo/switch

This file is pretty explanatory (ON and OFF).

Permanent Solution

There are basically two ways to solve these problems

a. Installing propitiatory catalyst driver

I have already written two articles on this. However, you should know it is not as safe as running the open source drivers, that is already installed on your computer.

As you can see, we did not install anything. You just need to shutdown the AMD card. Intel cards are quite capable for everyday tasks. However, if you do serious gaming, going with the first option (catalyst driver) is the only option. Open source AMD drivers are getting serious attention these days, in terms of development. I am hopeful power management situation improves very soon.

Power Management

Even with Intel cards, you might still not get the desired battery life from your laptop. Here are couple of solutions to the battery problem.

a. Install laptop-mode-tools

There are other options too, specially tlp, but I still find laptop-mode-tools quite good. Use following command to install laptop-mode-tools

sudo apt-get install laptop-mode-tools

b. Kernel (Optional, advanced)

Note: You can escape this section, because it is not that significant, except for long battery hours and enabling brightness (save current settings or for tools like laptop-mode-tools). Also, if you play games, enabling deep sleep (rc6) can cause graphics card to slowdown and or freeze while playing games or using graphics intensive programs. Therefore, you may want to escape this section (use xbacklight instead for brightness as discussed below) or be vigilant about these issues.

I like to keep certain parameters active in the kernel. In /etc/default/grub make GRUB_CMDLINE_LINUX variable look like this.

To activate these options for next boot onwards, run following command

sudo update-grub

If your laptop constantly hangs, you can change i915.i915_enable_rc6=7 to i915.i915_enable_rc6=1 to lower the sleep level, but as I said above, you need to be aware of these changes, when your laptop goes haywire. See Kernel Command Line Parameters to get a sense of how you can change rc6 values.

Brightness

Above commands should help fix the laptop brightness issue (for dell laptops). If it does not, you have to rely upon yet another command to solve this problem.

However, let us first find out which file is working to set brightness in your computer. Go inside /sys/class/backlight directory. Open File Manager and click Computer drive and browse to that directory. There should be a directory say acpi_video0 or intel_backlight. Open the file brightness, and see its value. If you have more that one directory, you have to experiment with each one using different values. However, before setting any value, open up its brightness file, to get a sense of the range of brightness values it supports. E.g In some cases it is in thousands, and in some cases the range is just within 1 and 15. You can set the value using following commands.

Using the command line, check these values before setting them on this file. If you restart laptop-mode service, it should work immediately (or restart the computer for convenience).

sudo service laptop-mode restart

If this too does not set the brightness value, you can install a program called xbacklight. After installing try to set values, to see if it works.

sudo apt-get install xbacklight
xbacklight -set 30

It should set the brightness to 30 percentage of the maximum. Since this program works without root, you could do all kinds of magic with it, e.g writing a cron job to constantly write the brightness value to a file, and write another script that sets the brightness using xbacklight using the value from that file. However, if you are generally going to stick with a fixed brightness value, it is easier to set it as a startup script. You could copy one of the files inside /home/username/.config/autostart and change the Exec line to set the command or go the easy route by opening up Startup Applications and adding an entry.

Name: Xblack or whatever
Command: xbacklight -set 30

Conclusion

I haven’t covered everything, but these settings should be enough for you to get a decent battery life and fix AMD graphics issues on AMD-Intel hybrid graphics setup on a laptop.