my desktop
Share on facebook
Share on twitter
Share on linkedin

Ubuntu and Multiple Monitors – AMD Edition

Terry Cox
Terry Cox

There are several ways to end up with a satisfactory experience on the desktop with Ubuntu despite their recent confusion of the user interface. We will discuss some of those another day (KDE vs. Gnome vs. Cinammon vs. Unity). Today we are going to talk about setting up your desktop environment for multiple monitors. This article assumes you are running Ubuntu 12.04 LTS or 12.10, however, the process should work equally well back to version 10.04 LTS unless otherwise noted.Assuming you have installed Ubuntu and are successfully sitting at the desktop (the window manager at this point is irrelevant), a couple of questions will now come to mind. What am I going to be using my linux desktop environment for? If you are going to be running office applications, email, basic web browsing and the occassional movie, you might be done. The default (read: Open Source) binary video drivers for both AMD (radeon) and Nvidia (nouveaux) are perfectly acceptable for all of those things. In fact, recently, they both have picked up some compositing support (so you can run the nifty 3D window effects in Compiz or KWin) as well as support for gaming. However, that support is spotty and performance still leaves a lot to be desired.We will address NVidia in another posting, today we will talk about AMD and their proprietary binary driver (fglrx) and its administration tool. Specifically, post installation, how to set up multi-monitor support. I realize not everyone uses multiple monitors for their desktop, however, many of us do. Some of us (me) use multiple video cards and multiple monitors to meet our needs (2×20″ 1600×1200 Displays for one desktop, 3×24″ 1200×1920 Display in Portrait for another). We will quickly walk through the setup and some of the pitfalls and how to prepare for information you may need after installation.Tricks of the TradeSince we have a fully working desktop using the default ‘radeon’ AMD display driver currently, let’s take advantage and gather some information we may need to refer to later (Note: if you only have a single monitor, you can skip this section and go to ‘Installing the Binary Drivers’).The first thing you will want to know is what card(s) are in your system and what Bus ID do they reside in. This is important for several reasons: the first reason is because AMD has diminishing driver support for their models prior to the HD6xxx/7xxx series in Linux (in Windows too, but less obvious), the second reason is because as of Ubuntu 11.04 and the associated switch to XOrg, there is no default ‘xorg.conf’ file to be found on the system. As you may know, that was the configuration file that defined the myriad of video options (driver, monitor parameters, font server, etc) for your XWindows desktop session. However, if you have more than one monitor, you are likely going to need to edit or create an ‘xorg.conf’ file for anything out of the ordinary (in my case, I have multiple video cards spanning multiple desktops, one portrait and one landscape). The easiest way to find the information to note, is the following command:lspci | grep VGAThis will list the video cards installed in your system and the Bus ID (the slot) they are installed in, you will see something like this:In this case, there is a single AMD HD Series 6450 video card in the first slot (01:00.0). Now, each video card support (generally) more than one monitor (as many as six in some AMD HD series 6xxx/7xxx cards) and each connector (HDMI, Display Port, VGA, DVI, etc) has an internal reference and when constructing our configuration manually, we would need to know which monitors are connected to which and the internal reference name of each. You can view what is connected where (and what the designated connection is referred to as) by issuing the following command:xrandrYou will see something like this:This tells us we have a monitor designation ‘DFP1’ at a resolution and position of 1600×1200 x0y0 (meaning it is the first monitor in the desktop since it starts at ‘x’ and ‘y’ coordinate ‘0’). Additionally, we have internal connection references of DFP2, DFP3, DFP4, and DFP5 which are disconnected. Finally, at ‘CRT1’ we have another monitor at a resolution and position of 1600×1200 x1600y0. We get some other information about the supported resolutions and refresh rates of each monitor. As a point of interest, anything connection to a designation ‘DFP’ is a digital connection whereas any reference to ‘CRT’ is analog (VGA). Armed with this information, we can move on.Installing the Binary DriversAs of the date of this article, the latest binary drivers available from AMD are the 13.1 Catalyst Drivers dated 1/17/2013. For Ubuntu users prior to 12.04, you will need the 12.10 Catalyst Drivers on the archive page, the 13.1 Driver will not compile correctly for your kernel.Once downloaded, put them somewhere you can find, unzip them and ‘chmod 755’ the resulting binary. Execute the following command:sudo ./amd-driver-installer-catalyst-13.1-linux-x86.x86_64.runand you will be greeted with the following:Do NOT elect to create a distribution specific package as that goes beyond the scope of this article and can cause issues depending on the branch of the 3.5.x kernel you may be on. Rather than clutter the article with a number of screen prints you may not need to see, here are links to the various screens during the installation:

Finally, although logging out and back into the desktop (effectively restarting the x-session) will activate your new settings, a reboot is a good idea. If there are any kernel module messages or incompatibilities, we will find out during that process. If all goes well, you should be able to reboot and sign back into your desktop. In fact, if you have multiple monitors, odds are they will be picked up and some form of desktop extension will likely be displayed on them, or they may be mirrored (same desktop image on all of them). AMD seems to change the default behavior version to version. Next, we are going to try to configure our desktop ‘the easy way’ with the Catalyst Control Center.Controlling the Control CenterOnce we are logged back in, we will want to start up the AMD Catalyst Control Center to get a handle on our layout and configuration. You can choose it from the menu (make sure to choose the one labelled ‘AMD Catalyst Control Center (Admistrative)’ since we will be making changes to our layout and saving them which will require elevated (sudo) privileges. If you so choose, you can accomplish the same thing at the command line like so:sudo amdcccleTo see the following:So, we see two monitors connected to our card. The tab underneath is what we are most interested in, this is where we set the type of multimonitor system that we want. We can set it to ‘mirrored’ (to be honest, the only practical use for that is for presentations), ‘Single Display Desktop’ (which means we will have as many independent desktops as we have monitors) or ‘Mult-display desktop with display(s) 1’ (which is what we want, one desktop spanning multiple monitors).Once you make your choice, you can choose ‘Apply’ for all the good it will do. Unlike in Windows, you won’t see the results of your choice until you log out and log back in to your session. Something that AMD says they are working on but has been that way since the beginning of time for their binary driver (and in all fairness, NVidia’s binary driver is no better in this regard, which we will see in our next article on this subject). After logging out and back in and restarting this Control Center, you should have a single desktop spanning multiple displays. What you also have for the first time, is a detailed ‘xorg.conf’ file. You can find a copy of the ‘xorg.conf’ file for this configuration here if you would like to see what it looks like.If you review that file, you will see that each monitor is referenced both by the type of connection we noted in the ‘xrandr’ command as well as the Bus ID noted by the ‘lspci’ command. There are a large number of options you can edit in this file that are not directly editable from within the AMD Catalyst Control Center GUI, but that is beyond the scope of this article as it pertains to your Xorg configuration in general and can affect many other aspects of your session beyond just the video card and monitor layout.Here is where you can also (finally) set the orientation of one or more of your displays. Clicking the arrow next to the display number in the diagram allows you to ‘flip’ or ‘rotate’ one or more of the displays and customize your multimonitor setup even more, like so:What this leaves us with is one monitor in portrait mode while the second is in landscape (so one is at 1200×1600 resolution and the other is 1600×1200). The advantages of one or more displays in portrait mode is it makes for reading PDFs and web pages easier since you get closer to 100% view of a full page. I find that writing code, editing articles and viewing documentation works well on a portrait display while watching movies, playing games and editing pictures lends itself better to landscape.Final NotesSomething to note about this configuration: compositing support is ‘limited’. Compiz, as of the date of this article, does not support a desktop with a mix of portrait and landscape displays. Meaning that the ‘desktop cube’ and the various window animations will fail to work. However, in KDE 4, the KWin display manager compositor does not seem to mind at all and happily displays all the effects that are available with it. I have to imagine at some point Compiz will fix this problem but your mileage may vary.Note: Earlier, I noted that if you receive a notice during installation that you need to remove the old AMD driver first, you can simply open a command prompt and type:sudo ./ --removeYou can do this from the directory you downloaded and extracted the binary from. You will simply see a message indicating that the kernel module was removed and the default (open source ‘radeon’ driver) was restored. Make sure you type ‘–remove’ rather than ‘–uninstall’ as listed in some of their documentation.What we have been leading up to with this routine is you can have a very customized desktop environment with many monitors across multiple video cards. I have found that AMD’s binary display driver has a bit more flexibility that the one available from NVidia (again, we will tackle their driver in a future article) but the performance of the NVidia driver seems to be better when comparing like powered video cards.If anyone has any questions not only about the driver installation or configuration, but about the ‘xorg.conf’ file itself, leave a comment and I will do my best to assist. It took me quite a long time to put together all the pieces of how this file needs to be laid out.Here is a picture of the system I am running at home. I am using an AMD HD7850 with three displays and an AMD HD6450 with two displays. I do have two independent sessions, but running on one computer.Finally, here is my customized ‘xorg.conf’ file for this system.Section "ServerLayout"Identifier "amdcccle Layout"Screen 0 "amdcccle-Screen[1]-0" 0 0Screen "amdcccle-Screen[3]-0" 0 1920EndSectionSection “Module”Load “glx”EndSectionSection “Monitor”Identifier “0-DFP5″Option “VendorName” “ATI Proprietary Driver”Option “ModelName” “Generic Autodetecting Monitor”Option “DPMS” “true”Option “PreferredMode” “1920×1200″Option “TargetRefresh” “60”Option “Position” “1200 0″Option “Rotate” “right”Option “Disable” “false”EndSectionSection “Monitor”Identifier “0-DFP10″Option “VendorName” “ATI Proprietary Driver”Option “ModelName” “Generic Autodetecting Monitor”Option “DPMS” “true”Option “PreferredMode” “1920×1200″Option “TargetRefresh” “60”Option “Position” “0 0″Option “Rotate” “right”Option “Disable” “false”EndSectionSection “Monitor”Identifier “0-DFP9″Option “VendorName” “ATI Proprietary Driver”Option “ModelName” “Generic Autodetecting Monitor”Option “DPMS” “true”Option “PreferredMode” “1920×1200″Option “TargetRefresh” “60”Option “Position” “2400 0″Option “Rotate” “right”Option “Disable” “false”EndSectionSection “Monitor”Identifier “1-Default monitor”Option “VendorName” “ATI Proprietary Driver”Option “ModelName” “Generic Autodetecting Monitor”Option “DPMS” “true”Option “PreferredMode” “640×480″Option “TargetRefresh” “60”Option “Position” “0 0″Option “Rotate” “normal”Option “Disable” “false”EndSectionSection “Monitor”Identifier “1-DFP2″Option “VendorName” “ATI Proprietary Driver”Option “ModelName” “Generic Autodetecting Monitor”Option “DPMS” “true”Option “PreferredMode” “1600×1200″Option “TargetRefresh” “60”Option “Position” “1600 0″Option “Rotate” “normal”Option “Disable” “false”EndSectionSection “Monitor”Identifier “1-CRT1″Option “VendorName” “ATI Proprietary Driver”Option “ModelName” “Generic Autodetecting Monitor”Option “DPMS” “true”Option “PreferredMode” “1280×1024″Option “TargetRefresh” “60”Option “Position” “0 0″Option “Rotate” “normal”Option “Disable” “false”EndSectionSection “Device”Identifier “amdcccle-Device[1]-0″Driver “fglrx”Option “Monitor-DFP5” “0-DFP5″Option “Monitor-DFP10” “0-DFP10″Option “Monitor-DFP9” “0-DFP9″BusID “PCI:1:0:0″EndSectionSection “Device”Identifier “amdcccle-Device[3]-0″Driver “fglrx”Option “Monitor-CRT1” “1-CRT1″BusID “PCI:3:0:0″EndSectionSection “Screen”Identifier “Default Screen”DefaultDepth 24EndSectionSection “Screen”Identifier “amdcccle-Screen[1]-0″Device “amdcccle-Device[1]-0″DefaultDepth 24SubSection “Display”Viewport 0 0Virtual 3600 1920Depth 24EndSubSectionEndSectionSection “Screen”Identifier “amdcccle-Screen[3]-0″Device “amdcccle-Device[3]-0″DefaultDepth 24SubSection “Display”Viewport 0 0Depth 24EndSubSectionEndSection


Get more insights, news, and assorted awesomeness around all things cloud learning.

Get Started
Who’s going to be learning?
Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!