Most modern laptops with intel processors after sandy bridge, comes with its own graphics card (or graphics memory). If you happen to purchase such laptop with discrete graphics card from AMD or Nvidia, your configuration becomes a hybrid graphics setup. Hybrid graphics cards have long and painful history under Linux. Therefore, if you don’t follow the usual channel (your operating system provided) of installing it, you might run into lots of problems because of inconsistencies between Xorg/mesa, graphics vendor drivers and the kernel. In this tutorial, I will talk about different approaches I take while installing the driver. This tutorial is valid for Elementary OS/Ubuntu and other ubuntu derivatives as well.
Before starting here is my hardware specs
Processor: Intel® Core™ i5-2410M CPU @ 2.30GHz × 4 Memory: 4 GiB Graphics: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09) Advanced Micro Devices [AMD] nee ATI Seymour [Radeon HD 6400M Series] (rev ff) Operating Systems: Ubuntu 13.04 / Elementary OS Luna
a. Installation using the official route.
b. Manually installing the driver downloaded from AMD’s website.
As an example, for this tutorial, I am going to use the 13.8 beta driver, because versions before that had incompatibility problems with mesa drivers in ubuntu 13.04. I have talked about how to install catalyst driver in ubuntu 13.04 and possibly deal with that error. If you are on ubuntu 13.04, you should follow that tutorial instead of this one. If you are on ubuntu 12.04 or Elementary OS, you don’t have to go there. Execute all the commands in this tutorial using a terminal (Ctrl + Alt + T).
Step 1: Enable repositories and update your OS
Go to Software Center -> Edit -> Software Sources and enable all the checkboxes in Ubuntu Software tab. In Other Software, enable Canonical Partners and in Updates check Unsupported updates (precise-backports).
Next, open Update Manager and press the Check button to update the repositories, and then press Install Updates to install all the updates.
Step 2: Install kernel headers, mesa drivers and necessary library.
sudo apt-get install ia32-libs lib32gcc1 libc6-i386 build-essential cdbs fakeroot dh-make debhelper debconf libstdc++6 dkms libqtgui4 wget execstack libelfg0 dh-modaliases linux-headers-generic xserver-xorg-core libgcc1
In the past, I used to suggest lts-raring backported kernel and mesa drivers. Since the last update, kernel and graphics drivers have been updated to newer versions. Therefore, those packages are not required anymore. Still, if you want to maximize the chances of getting more games work under intel graphics card, you can update your open source drivers using xorg-edgers ppa. Before proceeding, I want to say, this step is optional and is not required for catalyst driver to work. To install newer open source drives, using xorg-edgers execute following commands.
sudo add-apt-repository ppa:xorg-edgers/ppa sudo apt-get update sudo apt-get dist-upgrade
One of the common problems using xorg-edgers is, you often end up using kernel version and xserver that is not yet supported by catalyst driver. If using these packages conflicts with catalyst driver or does not improve gaming performance, you can always remove it using following command.
sudo ppa-purge xorg-edgers
Step 3: Install catalyst driver
Download catalyst driver from AMD’s website. For this tutorial, I am going to go with the beta driver, because it is compatible with above drivers and kernel version 3.8. In future, you should also always check what kernel and xorg versions are supported in the release notes found on the driver’s download site.
sudo sh ./amd-*.run --buildpkg Ubuntu/precise sudo dpkg -i fglrx*.deb sudo aticonfig --initial -f sudo reboot
If you have played with vgaswitcheroo switch command, second last command might not execute properly. In that case, you can always run the command in a terminal (Ctrl + Alt + F1), next time before you login. After executing above command, instead of login, it is better to reboot. Instead of throwing you to a terminal or login screen, if the computer locks up with black screen, boot using the recovery mode, execute above command and reboot.
You can switch between the graphics cards using following commands.
sudo aticonfig --px-igpu # for integrated intel card sudo aticonfig --px-dgpu # for discrete amd card aticonfig --pxl # list currently active card
After switching the graphics card, you have to logout and login to activate the driver. If during logout, you computer frequently freezes, you can also reboot the computer. If your computer completely locks, hold PrntScr + Alt keys and press R, E, I, S, U, B (opposite for busier) to reboot rather than pressing and holding the power button.
Step 4: Remove catalyst driver
If you know, how to install catalyst driver, you also need to know how to remove it.
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 xserver-xorg-video-intel libgl1-mesa-glx libgl1-mesa-dri libgl1-mesa-glx:i386 libgl1-mesa-dri:i386 sudo dpkg-reconfigure xserver-xorg sudo reboot
Step 5: Fix graphics errors
Graphics drivers have this recursive effect, where removal of a single package might remove lots of common system software. As a result, you might end up with a broken system. If you have login access, your first route of investigation should always be looking at /var/log/Xorg.0.log file
If there is some keyword like ati, intel your first defense mechanism should always be re-installation of xserver-xorg packages relating to that error. E.g If the message says problem loading intel module, I always install xserver-xorg-video-intel package. If there is an error on ati package, I install xserver-xorg-video-ati. In situations where you are not sure which packages to install, you can always use the tab completion feature of bash or install synaptic and install the related packages.
Next command to look for errors would definitely be dmesg
It is too verbose, but errors with keywords fglrx, intel, ati always stand out.
In most cases running following command will fix the operating system.
In elementary OS
sudo apt-get install elementary-desktop
sudo apt-get install ubuntu-desktop
These are meta packages that take care of lot of things. If it still does not fix the error, remove fglrx install libgl1-mesa-glx (or packages from remove section above) . Install libraries from Step 2, and finally re-install these meta packages to complete the installation.
If you don’t have login access, you can boot using a liveusb (your installation media), or your dual boot Linux (if you have that) and chroot to your elementary or ubuntu installation using following commands. For this example let us assume the OS you want to fix is at /dev/sda4. Use sudo blkid or sudo fdisk -l commands to find the drives and mount /dev/sdaX /media/Somedir to mount them, if you are not sure about the installation drive.
mkdir -p /media/Elementary mount /dev/sda4 /media/Elementary mount -t proc none /media/Elementary/proc mount --rbind /sys /media/Elementary/sys mount --rbind /dev /media/Elementary/dev chroot /media/Elementary
If you cannot use the internet in chroot environment, you might have to copy /etc/resolv.conf to /media/Elementary/etc/resolv.conf before running the chroot command
Step 6: Some tips
Above commands are not always sequential. You might have to jump from one section to another in order to fix things. If your programs lag, games fail to start, have awful texts and images, chances are there is a fault in open source driver installation. Before you install the propitiatory driver, you need to fix the open source drivers first, because if you don’t, those problems will persist even after installation.
One of the common cause of these problems is the breakage of ia32-libs and its dependency ia32-libs-multiarch:i386 packages. To get both of these installed properly, you have to do a little trick as discussed in this tutorial. See Install ia32-libs section to fix the error. Original source of that fix can be found in askubuntu.com
I hope this tutorial has provided you with enough information to play with catalyst driver. If you have some more information, if there is some error in this post or if there is a better way to approach these problems, you are more than welcome.