How to setup AMD/Intel Hybrid graphics cards in Linux (Ubuntu)

Introduction

In this tutorial, I will list the steps I take to setup AMD catalyst driver under Ubuntu Linux. I hope someone finds it useful.

I will not say, it works for all hybrid graphics setup. So here is my computer’s specification.

Operating System : 64-bit Ubuntu 12.04
Processor : Intel sandy bridge (2nd generation), specifically Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz
Graphics Cards: Intel HD 3000 and AMD Radeon HD 6470M
RAM: 4 GB

Step 0 : Do you want longer battery life or faster graphics performance ?

One problem most users with dual graphics cards might notice just after installing Ubuntu, is that the fan continuously runs without slowing down. One even might get to the conclusion of, is Linux worth installing. If it can not handle the graphics cards, what worth it might be after installing. Most users don’t fall into this dual graphics category, if they have bought laptops without AMD cards.

Intel cards are better for longer battery life, and that might be good enough for many people. If they are willing to wait until both cards work seamlessly, it is better to shutdown the AMD card (see Step 1 below on how to that). AMD cards are better for gaming (that is what we are going to setup). If however, you want the dual graphics setup this link (http://ubuntuforums.org/showthread.php?p=11712781) might help.

Step 1: Shutdown that noisy AMD fan

To shutdown the noisy AMD fan you need to login as root and set “OFF” value to /sys/kernel/debug/vgaswitcheroo/switch file. You can do that by executing following commands.

$ sudo su -
# echo OFF > /sys/kernel/debug/vgaswitcheroo/switch

Note: After installing catalyst driver, you probably would not have do this. If you however, don’t want to install catalyst driver and just want to get the AMD card shutup, you can copy above text (echo OFF > /sys/kernel/debug/vgaswitcheroo/switch) to /etc/rc.local, before exit 0. Use sudo gedit /etc/rc.local command to open that file.

Step 2: Install catalyst driver

Follow these steps as listed in https://wiki.ubuntu.com/Valve

1. Enable the pre-released updates. You can enable this repository by opening Ubuntu Software Center, selecting Edit | Software sources… and then enabling the Pre-released updates option on the Updates tab.

2. Update your repository to the latest version in the Update Manager.

3. Remove the currently installed drivers.

4. In 12.04, launch the Additional Hardware Drivers dialog from System Settings. In 12.10, launch Software
Properties, then click on the Additional Drivers tab in the Software Sources menu.

5. Install the newest fglrx-experimental-X driver.

Screenshot from 2013-01-13 17:10:25

Note: If you have just installed Ubuntu and even if you followed numbers 1 and 2 of Step 2 and did not get fglrx-experimental-X driver. You could follow these steps, which might actually bring back that option.

1. Update Ubuntu. Before you start installing software in Ubuntu, it is good to have default packages to its latest version. Execute following command to update Ubuntu.

$ sudo apt-get dist-upgrade

This command will update all the software to their latest version.

2. Install ubuntu-x-swat/x-updates repository anyway. Follow these steps as listed in https://wiki.ubuntu.com/Valve

On the command line, run

sudo add-apt-repository ppa:ubuntu-x-swat/x-updates
sudo apt-get update
sudo apt-get dist-upgrade

Then log out and back in, or reboot.

Step 3: If it works (Go to Step 4 to find out), close this article and start killing some zombies. Else …

Dual graphics cards on some computers (like mine) might not start in default Ubuntu desktop (Unity Desktop). You may not like Unity anyways (I use Unity), but not being able to login into default desktop is a clear indication that our process of installing catalyst driver has not finished yet.

This section is sort of debugging section, so make sure you keep patience and be ready to explore different combinations, if it still does not work.

a. Check, if following command creates xorg.conf file for your card. If it does (Go to Step 4 to find out), no need to go further in this article. You are good to start killing some zombies that might still be left. Execute following command.

$ sudo aticonfig --initial -f

b. In my case, after I install catalyst driver, first thing I need to do is create a file (/etc/X11/xorg.conf) to get the AMD card to work. Above command worked in the past, but failed on multiple occasions. Content of that file are listed below, but before that, I want to talk about determining proper BusID for that card.

To find out the proper BusID for AMD card execute following command. I have also listed the output of the command along with the command.

$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
01:00.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI Seymour [Radeon HD 6400M Series]

As you can see, I have two cards, and AMD card is in BusID 1:0:0. With this BusID for AMD card, a /etc/X11/xorg.conf  file might look like in following text. You can create this file by executing following command and copy and paste the text below that. With correct BusID, offcourse.

$ sudo gedit /etc/X11/xorg.conf
Section "ServerLayout"
    Identifier     "aticonfig Layout"
    Screen      0  "aticonfig-Screen[0]-0" 0 0
EndSection

Section "Module"
EndSection

Section "Monitor"
    Identifier   "aticonfig-Monitor[0]-0"
    Option        "VendorName" "ATI Proprietary Driver"
    Option        "ModelName" "Generic Autodetecting Monitor"
    Option        "DPMS" "true"
EndSection

Section "Device"
    Identifier  "aticonfig-Device[0]-0"
    Driver      "fglrx"
    BusID       "PCI:1:0:0"
EndSection

Section "Screen"
    Identifier "aticonfig-Screen[0]-0"
    Device     "aticonfig-Device[0]-0"
    Monitor    "aticonfig-Monitor[0]-0"
    DefaultDepth     24
    SubSection "Display"
        Viewport   0 0
        Depth     24
    EndSubSection
EndSection

Note: Restart the computer after creating above file, and check if it worked

Step 4: Find out if it worked

First thing I do after installing catalyst driver, create xorg.conf file and restart is, execute following command to see if the driver has properly installed.

$ fgl_glxgears

Screenshot from 2013-01-13 17:11:42

A spinning cube should appear. If it did not, you have to check all the steps above. If you found any steps confusing, please let me know. If it did not work, even though you did all the steps correctly, make sure you discuss it. Someone with similar issue might get help. After trying all the steps above, if it still did not work, you can either let folks at http://devgurus.amd.com/community/steam-linux know about this or revert back to intel drivers.

Step 5: Return back to intel drivers.

If you could not install catalyst drivers, here are the steps that will set the computer to the stage it was before installing catalyst drivers. Execute following commands to completely remove catalyst drivers and reconfigure intel drivers.

$ sudo apt-get remove --purge fglrx fglrx_* fglrx-amdcccle* fglrx-dev*
$ sudo rm /etc/X11/xorg.conf
$ sudo apt-get install --reinstall xserver-xorg-core libgl1-mesa-glx libgl1-mesa-dri libgl1-mesa-glx:i386 libgl1-mesa-dri:i386
$ sudo dpkg-reconfigure xserver-xorg
$ sudo reboot

References:

1. https://wiki.ubuntu.com/Valve
2. http://ubuntuforums.org/showthread.php?p=11712781
3. http://wiki.cchtml.com/index.php/Ubuntu_Precise_Installation_Guide

About these ads

19 Comments

Filed under Uncategorized

19 responses to “How to setup AMD/Intel Hybrid graphics cards in Linux (Ubuntu)

  1. J4X

    Months struggling with this issue, yet you come along and solve my problems with just two command prompts. You have solved one of my major problems my friend.

  2. Crunch

    I have successfully followed you tutorial, now my computer is much quieter and cooler (I disabled the AMD card, running only on intel). Only problem is that the AMD/fan are always on when I return from sleep/hibernate/reboot so I must run dpkg-reconfigure xserver-xorg everytime. Any way I can shut it off permanently?

    • Did you add

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

      before

      exit 0

      in /etc/rc.local ?

      If this does not work, there is very less option than to keep on updating newer version of mesa or kernel.

  3. Pingback: AMD graphics cards, Linux basic power management | xpressrazor

  4. I tried out your steps and was successful with installing it. Thanks anyways, looking for your future updates!

  5. I have went through all described steps and using the same laptop type (HP Pavilion g7 1153er). But after generatio and edit xorg.conf I am making reboot and get error:
    Fatal server error:
    [ 15.669] atiddxProbe: fail to probe intel VGA device
    [ 15.669] (EE)

    After this I have selected use basic settings and after reboot everything works like before xorg.conf generation and this file is missed at /etc/X11/

    Please inform me if you have idea why it work so. I am trying to install ubuntu to my laptop 4th day …. little bit confused and tired.
    Thanks.

    • That looks bad. I have not see that error before, therefore you need to discuss this problem here.

      Before doing that, I suggest you might want to try installing 13.8 beta 2 catalyst driver manually. Also use latest intel drivers using xorg-edgers ppa. I have discussed about installing catalyst driver manually in this tutorial.

      I think the problem is in intel drivers. Catalyst drives usually don’t modify open source drivers. Also after catalyst driver installation, if above problem persists, switch to amd graphics card and see if that works using following command

      sudo aticonfig --px-dgpu

      Just to be sure, reboot after executing above command. Looking at above error, since intel drivers failed, may be AMD will work if you just switch to amd using above command.

      • Thanks for reply. This is one place when I have got some answer and suggestions. :) Post about this problem at few more forums including official Ubuntu forum.
        I will check your suggestion. And by the way I have tried to find solution few more times tried to find solution by my self using different instructions including one of yours http://xpressrazor.wordpress.com/2013/07/22/install-catalyst-driver-in-ubuntu-12-04-2/ for Ubuntu 12.04 and Ubuntu 13.04 as well.
        I have seen some statistic. Each time when I am generating xorg.conf after radeon drivers preparation I get graphic error about Intel adapter. And when I completely remove xorg.conf or choose back to default setting (make the same: remove xorg.conf) then everything works again without any changes like before. All this time I am using nomodeset for Ubuntu start up, without it getting black screen.

        Thanks for advice.

      • Your computer looks like a ubuntu supported hardware. You definitely need to go to couple of forums (including hp’s own and this) and ask for help.

        My suggestion is, unless your hardware starts to work properly, always go with the latest drivers and kernel versions.

  6. Thanks for reply. I have checked all this info but this havent helped me. On one forum I have get reply with suggestion try to use acpi_backlight=vendor option for grub and this helped a lot. With using acpi_backlight=vendor option without nomodest I have seen right graphics for ubuntu 12.04 but havent set hybrid graphics there right.

    Than I have tried to do the same with Ubuntu 13.04. And with:
    1) “acpi_backlight=vendor” option for installation
    2) installed intel driver(https://01.org/linuxgraphics/downloads)
    3) checked grub configuration and removed “nomodeset” from there
    4) installed ati catalyst according to http://wiki.cchtml.com/index.php/Ubuntu_Raring_Installation_Guide#Installing_Proprietary_Drivers_a.k.a._Catalyst.2Ffglrx
    And after this I have got all my problems solved.
    Thanksfor your blog :) this pushed me in right way.

  7. Thank you for your post! I’m finally able to start experimenting with Linux.

    I know it’s been a year but maybe you can still help. I went down with Step 1 as far as I’m not much of a PC gamer and I use dualboot, but an interesting fact I’ve noticed.
    The installation went smoothly, I’ve edited the rc.local file and the first reboot was just fine. However, it’s been weird since I’ ve customized GRUB(with grub-customizer). See, when my laptop(HP G62) starts it runs the fan at maximum speed for some time(about 40-50 sec). And the thing is that elementary OS only boots properly after some time has passed and the fan noise is down. Otherwise, it just gives me some kind of an error screen with what seems to be a dump file or smth. It says about general protection fault and has [radeon] related info in the Call Trace section.

    I know it sounds weird, but it’s like the eOS won’t boot untill GPU related harware is still in use. Maybe you’ve dealt with that kind of problem?
    Here’s a photo(I know it’s lame) of what I see:
    [IMG]http://i59.tinypic.com/15f2g6p.png[/IMG]

    • You said you went with step 1. If you remove that line from rc.local it should be back to normal (loud fan if you haven’t installed catalyst (fglrx) driver). If you have installed the driver, that line does not affect anything at all.

      As ubuntu (effectively eos) has gone through version changes (currently 12.4.4), some of the drivers does not work as usual. In that case you might have to look into the manual installation process in eos.

      • Thanks for reply.
        I haven’t install any GPU drivers, but unfortunately going back to powering both cards is not an option. I’ve just replaced the battery so I don’t want it to die in 6 months)
        I guess I’ll just stick with a little longer boot time then.

      • rc.local gets executed very late. Therefore the loud fan is obvious until very late in the boot process. In my case with vgaswitcheroo shutdown, at the time the login screen comes up, AMD gpu gets shut down. Thus I get very good result and I can play with both AMD and Intel with open source or closed source options. Since you are not getting very good results at boot, I recommend you to go with latest drivers as much as possible. For that going with some current distro would be a better idea. With latest drivers, you might as well get the option of playing with open source radeon drivers.

  8. Does it have to be a new distro or maybe updating the kernel will do?

    • Kernel and graphics drivers both. Ubuntu (effectively eos) in case of LTS do very little major updates in LTS. Canonical does point releases, may be that might help. One way to be sure to get new drivers is xorg-edgers, but that might make the system little unstable (one of the reasons to stick with LTS is to avoid such instability).

      • Hmm, actually I’m starting to think it has something to do with GRUB or at least it’s customization. Cause I just tried to boot to Win7 and it went blackscreen at first(almost like eOS) and then, after restart it said that the Boot manager is missing however no changes have been made. So I repaired boot record. Will see if it leads somewhere.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s