John Smith's Blog

Ramblings (mostly) about technical stuff

nVidia Linux v302 drivers and dual-head/rotated monitor setups

Posted by John Smith on

I recently upgraded to the 302.17 nVidia Linux drivers, which broke my dual head setup somewhat, and required a bit of manual reconfiguration to get things working properly again. Although all the information is available online, I thought it worthwhile writing a quick post in the event someone else has a similar issue.

Firstly, a quick overview of my setup. I have a GeForce GTS450, although up until a month ago I was using a GeForce 315 with the same config, so I imagine the particular model of nVidia card is largely irrelevant. Out of this card I have two LCD monitors connected via DVI and HDMI:

  • on the left, an HP2045w rotated 90 degrees, so that the screen area is 1050 pixels across by 1680 pixels deep
  • on the right, a Dell S2209W, resolution is 1920x1080
I find this quite a nice configuration, generally Firefox fills the portrait screen, and various terminals or other apps are on the right landscape screen. Most webpages still run on 960 pixel grids, so I rarely lose anything in my browsing - other than ads ;-) - and if I need to use Firebug or similar dev tools, there's plenty of space to see both the page content and the tool.

In Linux/X11, the screens are set up separately, so I can switch between workspaces on just one screen, which I find very useful. The only downside is that it's not possible (AFAIK?) to drag a window from one screen to the other, but this is a hardship I've learnt to live with. (NB: When this machine dual-boots into Windows, I have a more standard "one big desktop", but as I rarely use Windows for "real work", I've never bothered to investigate what other options are available.)

Anyway, after upgrading the drivers, and letting the nVidia installer update my xorg.conf - I was disappointed to find that my portrait monitor was showing Xfce at a 90 degree angle, and on the "wrong side" of the displays. (I don't normally let the nVidia installer alter my xorg.conf, but as this version of the drivers apparently fixes/improves RandR support, I thought it best to let the installer do its own thing.

Now, these issues wouldn't be the end of the world, but it seems that nvidia-settings hasn't been upgraded to align with how this latest driver works. As such, it came down to a bit of manual editing of xorg.conf...

Firstly, fixing the relative positioning of the screens was a fairly straightforward edit to the ServerLayout section: Section "ServerLayout" Identifier "Layout0" Screen 0 "Screen0" 1680 0 Screen 1 "Screen1" LeftOf "Screen0" InputDevice "Keyboard0" "CoreKeyboard" InputDevice "Mouse0" "CorePointer" Option "Xinerama" "0" EndSection Looking at some older versions of the config, I reckon this broke because the enumerations of the two monitors got swapped around. Not quite sure how/why that happened, or how the card/driver is supposed to work out which is screen 0 and which is screen 1, but as it's a simple fix, it's not worth wasting much thought on.

More troublesome was getting my portrait screen displaying correctly. Firstly I verified that portrait display was still possible, via xrandr from the shell prompt: xrandr -d :0.1 -o left (BTW, one minor thing to be wary of when doing this, was that using the configuration I had at the time, it created a "dead space" between the two screens such that it was not possible to move the mouse from one screen to the other.)

With this proven, it was time to work out why my old configuration wasn't working. Previously I'd had this for my portrait screen: Section "Screen" ... Option "RandRRotation" "on" Option "Rotate" "CCW" ... EndSection A look at the Xorg log in /var/log/ gave an indicator as to why this was no longer working: [ 135.480] (WW) NVIDIA(0): Option "RandRRotation" is not used This change in functionality is also mentioned in the release notes, albeit buried a long way down:

Removed the "RandRRotation" X configuration option. This enabled configurability of X screen rotation via RandR 1.1. Its functionality is replaced by the "Rotation" MetaMode attribute and RandR 1.2 rotation support. See the README for details.
I never actually came across that README file, but I managed to Google some online documentation, that I imagine is probably identical content-wise. This led me to altering xorg.conf as follows: # Screen 1 = HP Section "Screen" ... Option "metamodes" "DFP-0: nvidia-auto-select { Rotation=left} +0+0" ... EndSection A quick Ctrl-Alt-Backspace later, and I had my portrait monitor viewable without having to hold my head at a funny angle :-)

Unfortunately, this wasn't the end of the story, as a lot of the text on the portrait display was appearing much smaller than it should have. This appeared to be due to a confusion over the DPI and physical size of the monitor screen: Screengrab of nvidia-settings window, showing two radically different values for vertical and horizontal DPI, and a width/height that doesn't make sense for a portrait display xdpyinfo showed similarly incorrect information for this screen: [john@hamburg X11]$ xdpyinfo | more ... screen #1: dimensions: 1050x1680 pixels (430x270 millimeters) resolution: 62x158 dots per inch ... Now, I'd previously put in a hacked DisplaySize value in the relevant Monitor section, as a means to make a bitmap font appear the way I wanted, but after fiddling with this value, it seems to no longer have any effect.

In the end, I found a reference to a DPI setting in the xorg.conf man page, and adding this to the Screen section fixed things nicely: # Screen 1 = HP Section "Screen" ... Option "DPI" "100 x 100" ... EndSection And now I have things back working as they were before!

Unfortunately, none of the positive changes I'd hoped for have occurred - I'm still getting nasty tearing, even though V-sync appears to be enabled everywhere it can be. Maybe one day I'll get that resolved...

About this blog

This blog (mostly) covers technology and software development.

Note: I've recently ported the content from my old blog hosted on Google App Engine using some custom code I wrote, to a static site built using Pelican. I've put in place various URL manipulation rules in the webserver config to try to support the old URLs, but it's likely that I've missed some (probably meta ones related to pagination or tagging), so apologies for any 404 errors that you get served.

RSS icon, courtesy of RSS feed for this blog

About the author

I'm a software developer who's worked with a variety of platforms and technologies over the past couple of decades, but for the past 7 or so years I've focussed on web development. Whilst I've always nominally been a "full-stack" developer, I feel more attachment to the back-end side of things.

I'm a web developer for a London-based equities exchange. I've worked at organizations such as News Corporation and Google and BATS Global Markets. Projects I've been involved in have been covered in outlets such as The Guardian, The Telegraph, the Financial Times, The Register and TechCrunch.

Twitter | LinkedIn | GitHub | My CV | Mail

Popular tags

Other sites I've built or been involved with


Most of these have changed quite a bit since my involvement in them...