HOWTO: Rotate the screen in Linux using Nvidia

Posted by Bob Hazard On Monday, 23 November 2009 6 comments

When you open the normal display options in Ubuntu the choice to rotate your display in landscape or portrait mode is disabled if you are using proprietary NVIDIA drivers.


It turns out that NVIDIA disabled it for performance reasons and if you edit the xorg.conf file you can rotate the screen using xrandr.

TIP: If you are uncomfortable editing the system files make a backup of xorg.conf first because you might loose the desktop if you make a mistake. Copying the file back will restore the previous settings.


Open the /etc/X11/xorg.conf file in a text editor as root such as
gksu gedit /etc/X11/xorg.conf

Then look for the device section which should have the name of your graphics card, and add an option at the end which I have highlighted in bold:

Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce 8800 GTS"
Option "RandRRotation" "true"
EndSection

If you are using twinview with two monitors then you may have a second device1 add this line to that section as well


Save the file and log out so that the xserver will restart and apply the changes.


Now you can rotate the screen using the xrandr command (x rotate & resize) such as:
xrandr -o left

To restore the rotation use
xrandr -o normal
There are many options which you can see using xrandr --help or a quick google search

6 comments:

jwill said...

Works, but I get some performance issues (massive tearing on window movement). Probably something to do with optimizations for wide, fat resolutions. My resolution is 1080x1920, which is pretty ridiculous (but nice for coding).

Or Nvidia just doesn't like xrandr that much. On Windows, there's a rotation util included in the nvidia software...

Bob Hazard said...

If you are using compiz try enabling vsync. Tearing usually occurs when it draws faster than you monitor's refresh rate, such as 60hz

Martin Ankerl said...

awesome, thanks! this is great for reading stuff.

RedBaron said...

Awesome. Thanks for the helpful tip. Now I have to figure out how to get my tablet pointer orientated to the new -o right orientation, make a script for simple setting and I'm done. :) Must not be many folks using Linux with tablet PC's. :(

cyrux said...

Yeah, thanks
How do you guys come up with this stuff.

Kakemphaton said...
This comment has been removed by the author.