Wednesday, January 11, 2012

Tri-head display on linux Thinkpad W520 (Graphics Adventures)

Note: while all the stuff in this post is still accurate and it is a useful reference, I think that most people will find the solution presented here more useful.

                                                                                                               

Since I got my Thinkpad W520 back in October, I have been in for an adventure in learning about the graphics. One of the reason's that I chose the W520 (and this is only one of many - it is an awesome machine) is that it was advertised to support two external monitors for a total of three including the Thinkpad display (now I know that some T-series can support four with the dock though). Earlier this week, I finally had two monitors in the same place to play with and had amassed the knowledge needed to get it all working right on Linux. I am a Linux noob, so this was a long journey that taught me a great deal about graphics hardware, the open-source world, and the insides of my beloved W520.



Here's what I know in hopes that it will help some other W520 users (and maybe some people using other similar systems):

The W520 uses a system called nvidia Optimus. You can find out more about it here, but basically it means that the Thinkpad Display is always controlled by the intel integrated card. When Windows 7 runs a program with demanding graphics, the nvidia card does the rendering and dumps the output to the intel card to display on the screen.

I am pretty happy with the Lenovo engineers because they give the user the option to disable nvidia Optimus in favor of either the nvidia discrete or intel integrated graphics. In the BIOS (Access by holding F12 when the "Thinkpad" splash screen is displaying at startup), there are three options for the display configuration (note: the OS detection option appears to make the setting go to "nvidia optimus" when linux is running. This is usually not the desired behavior, so I recommend disabling OS detection).

Here are descriptions of the three options:

Integrated - Runs only the intel integrated graphics chip. Here the integrated intel chip controls only the Thinkpad display on the W520. (It seems that on the T420 and T520, the integrated card is also connected to the VGA output, but I have no way of verifying this)

                             __________________
                            | ---------------- |
                            ||                ||
                            ||    Thinkpad    ||
                            ||    Display     ||
                            ||                ||
                            ||________________||
                            --------------------
                                      \____________
                                                   \
                                  -----------       \
                                 \  NVIDIA    \      \
                                  \ Card (off) \      \
      Display Port                   -----------       \
                                                        \
                                          _______________\
                                          \            
                                       ----------        
      VGA Output                      \  Intel    \     
                                       \ Card      \   
                                         ----------- 


Discrete - Runs only the nvidia discrete graphics chip. The nvidia chip is connected to all three outputs, but sadly :,( it can only run two at a time (hence the '2/3' connection markings).

                             __________________
                            | ---------------- |
                            ||                ||
                            ||    Thinkpad    ||
                            ||    Display     ||
                            ||                ||
                            ||________________||
                            --------------------
                                      \            
                                      2/3          
                                        \          
                                  -----------       
                                 \  NVIDIA    \      
                                  \ Card       \       
      Display Port --2/3---          -----------        
                           \                \           
                            \________________\            
                             \                           
                              \        ----------       
      VGA Output ----2/3-------       \  Intel    \    
                                       \ Card (off)\  
                                         ----------- 


Nvidia Optimus - In this mode, both graphics cards are running. The Nvidia chip is connected directly to the external display connections and the intel chip is connected to the Thinkpad Display. In Windows 7, there is native support for the cards to communicate over the motherboard, so everything works out of the box. In linux, the support must come from extenal tools (there may be native support in the future). Bumblebee can be used to render things on the Nvidia card and display them through the intel card, and a program called screenclone (see instructions here and here) can be used to display a desktop rendered on the Intel card through the Nvidia card to the external monitors.

 
                             __________________
                            | ---------------- |
                            ||                ||
                            ||    Thinkpad    ||
                            ||    Display     ||
                            ||                ||
                            ||________________||
                            --------------------
                                      \           
                                       \__________           
                                                  \
                                  -----------      \
                               __\  NVIDIA    \     \
                               \  \ Card       \     \ 
      Display Port --------     \    -----------      \ 
                           \     \        \            \
                            \_____\    Motherboard      \
                             \              \            \
                              \        ----------         \
      VGA Output --------------       \  Intel    \________\
                                       \ Card      \  
                                         ----------- 


So, how do you use this information? Well, here are my recommendations for 3 different types of users:

1. "I want the best battery life!" (and I don't use a projector often)
Use the "Integrated" BIOS display setting. This will only ever run the Intel graphics card. As far as I can tell, you will have to go into the BIOS and change the setting if you want to connect to a projector, but it is definitely possible to get decent graphics performance (compiz, 3d acceleration, etc) off of just the intel card.

2. "I just want everything to look nice and work!"
Use the "Discrete" BIOS display setting. Get the Nvidia proprietary drivers:

$ sudo apt-get install nvidia-current
$ jockey-text -e xorg:nvidia_current

or download from http://www.nvidia.com/object/unix.html and run the file

and have fun with awesome performance! I have never had any problems with these settings, and using disper in conjunction with nvidia-settings to control external displays is a dream! I just feel happy when I think about this configuration! Battery life is honestly not that bad either - the nvidia drivers automatically underclock the card when usage is low.

[tip: to adjust the display brightness when using the nvidia drivers, press Ctrl-Alt-F1 to jump to a tty screen, adjust the brightness, then return to graphical mode using Ctrl-Alt-F7 or add the line
Option  "RegistryDwords" "EnableBrightnessControl=1"
to the device section of xorg.conf] 

3. "I want to be able to use up to 3 displays and turn off the nvidia card when running on battery!" (and I don't mind some extra configuration work)
Ok, so you want to unleash the full power and flexibility of your machine - you're ready to get serious. You definitely must use the "Nvidia Optimus" BIOS mode, which starts both graphics cards. The only way that I have figured out to run all three displays is to use Xinerama to create a single X session with the two external monitors running on the Nvidia card and the Thinkpad display running on the intel card. Using info from these two sites (site 1, site 2), I was able to piece together an xorg.conf file to make it happen. You can download the file here:


To use it, you have to completely exit your gnome/unity/kde/xfce session, including the login screen, and type

startx -- -config xorg.conf.triple.txt

or, if you want to start it automatically every time you start your computer (not recommended), rename it xorg.conf and put it in the correct place (/etc/X11 in my setup). In this configuration (since xrandr is disabled by Xinerama), the only way to change the number of screens is to completely log out of X and use different xorg.conf files for whatever number of screens you have. With this configuration, you can only get 3D hardware acceleration on the external screens running on the nvidia card, and I don't think that it is possible to get desktop effects such as those that are part of compiz running.

In the "Nvidia Optimus" BIOS mode, you can also save power by turning off the nvidia card when you are not using it. This can be accomplished using the bbswitch utility which is part of the Bumblebee project. If you are using ubuntu, you can get bbswitch from the bumblebee repository at https://launchpad.net/~bumblebee/+archive/stable . Instructions for using bbswitch can be found here.

I hope that this post has helped you to understand your computer better, and I hope that you are enjoying your W520 as much as I am!


Notes about my current configuration:
OS: kubuntu 12.04 64 bit
Driver for Intel card: "intel" (DRI (hardware acceleration) is disabled on this (I think because I have the nvidia proprietary driver installed))
Driver for Nvidia card: "nvidia" (proprietary driver 280.13)
Thinkpad model number: W520 4270CTO (with Nvidia Quadro 1000M)
BIOS Display Setting: Nvidia Optimus

65 comments:

  1. This is terrific. Love the ASCII/Unicode graphics.

    ReplyDelete
  2. Thanks for the Post! I will try that as soon as I have the time!
    By the way, do you use 64Bit or 32Bit?

    Johannes

    ReplyDelete
  3. 64 bit - if you have more than 4 GB of ram (I think most W520 users do), you need to use 64 bit to use all of it.

    ReplyDelete
    Replies
    1. That's actually not accurate.. you just need to install the linux-pae module for your kernel if you want your 32bit O/S to have access to 4+GB ram. This supports up to 64GB of ram.

      Delete
    2. I wasn't aware of that... thanks for the correction!

      Delete
    3. It's only partial support.
      A single thread can still only address 4 GB of memory.

      Delete
  4. Thank you very much for you post.
    Let me start by saying I am a n00b!!!!
    I have W520 with Quadro 2000m and I just can't get it to work.
    My problem is that I need the nvidia capabilities. I need GLX support.
    When I choose discrete, X starts up looking strange and in tty it say that Display is not set. When I select optimus, X starts fine but nvidia-settings say I'm not using my nvidia drivers. If I then run nvidia-xconfig, X doesn't start at all; it just hangs.
    I am using the latest 290.10 driver from nvidia.

    any suggestions?

    Kobi.

    ReplyDelete
  5. Kobi,

    If you are going to be using GLX, I think your best bet is to always run in Discrete bios mode to get the best performance. (In optimus mode, only the integrated graphics card is connected to the thinkpad display - hence nvidia-setting's statement that you are not using nvidia).

    Here's what I would try first (I'm assuming that you're using ubuntu):

    1. get rid of any xorg.conf that you might have (the OS should autodetect the correct settings):

    $ sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.backup

    2. reboot into discrete mode with OS detection disabled (I just figured out that OS detection actually does do something)

    If that doesn't work, I can think of a few things that could be wrong:

    1. The nvidia kernel module is not getting loaded. run

    $ lsmod | grep nvidia

    in discrete mode from a tty. The output should be a line with nvidia and a few numbers. If nothing shows up, it means that the kernel module is not loaded.

    2. Ubuntu has decided to not use the proprietary driver for some reason. Use jockey (either jockey-text or jockey- to see if you can get it to wok). For me

    $ jockey-text -l

    returns

    xorg:nvidia_current - NVIDIA accelerated graphics driver (Proprietary, Enabled, In use)

    (and some other stuff about other drivers)

    3. You have Bumblebee/Ironhide installed. (Bumblebee will probably mess some stuff up if you are not booting in "nvidia optimus"). If you have it installed, I recommend uninstalling it, reinstalling the nvidia drivers, and then using jockey to make sure they're being used.

    Good Luck! Let me know how it goes.

    ReplyDelete
    Replies
    1. Zachary,

      Thank you so much for your quick reply.
      I've done what you said and here are the results:
      lsmod | grep nvidia -> nvidia 12123947 43

      jockey-text -l
      kmod:nvidia_current - NVIDIA binary Xorg driver, kernel module and VDPAU library (Proprietary, Disabled, Not in use)
      kmod:nvidia_current_updates - NVIDIA binary Xorg driver, kernel module and VDPAU library (Proprietary, Disabled, Not in use)

      As for Bumblebee/Ironhide - I don't know if I have it or how to check if I do, but I didn't install it.
      locate bumblebee and locate ironhide returns nothing.

      How can I enable the drivers?

      Thank you for your help,

      Kobi.

      Delete
    2. Update:
      I went back to optimus (to be able to use X) and went to system settings->Additional drivers. It shows 2 nvidia drivers that are disabled. I installed them and rebooted. Now both are active but not in use.
      If I run nvidia-xconfig, X hangs and doesn't work.
      Should I purge nvidia* and install the 290.10 again?

      Anyway, deleting xorg.conf again and using optimus lets me log to X but GLX doesn't work.

      If I run glxinfo it returns:
      Xlib: extension "GLX" missing on display ":0".
      Xlib: extension "GLX" missing on display ":0".
      Xlib: extension "GLX" missing on display ":0".
      Xlib: extension "GLX" missing on display ":0".
      Xlib: extension "GLX" missing on display ":0".
      Error: couldn't find RGB GLX visual or fbconfig

      Xlib: extension "GLX" missing on display ":0".
      Xlib: extension "GLX" missing on display ":0".
      Xlib: extension "GLX" missing on display ":0".
      Xlib: extension "GLX" missing on display ":0".
      Xlib: extension "GLX" missing on display ":0".
      Xlib: extension "GLX" missing on display ":0".
      Xlib: extension "GLX" missing on display ":0".

      How do I proceed?

      Thank you,

      Kobi.

      Delete
    3. You shouldn't need an xorg.conf - ubuntu should autodetect everything for you, so I don't think that you need to run nvidia-xconfig

      I've learned the hard way that usually getting more information about a problem is the best way solve it rather than just trying a bunch of stuff, so do this:

      1. Delete your xorg.conf (don't run nvidia-xconfig)
      2. Reboot into Discrete, OS Detection Off
      3. If X does not come up right, go to a TTY by pressing Ctrl-Alt-F1, and check out your Xorg log at /var/log/Xorg.0.log . Use

      $ cat /var/log/Xorg.0.log | grep \(EE\)

      to show all the errors (replace \(EE\) with \(WW\) to see warnings).

      Google Whatever comes up or post it here

      Delete
  6. The only error in the log is:
    Failed to load module "nv" (module does not exist, 0)

    Nvidia say to put: driver "nvidia" in xorg.conf to solve this. When I do that, X hangs.

    ReplyDelete
    Replies
    1. Hmm... well I am pretty much a noob myself, so I'm not really sure what's going on to be honest. You could try sending the whole log to me (post it on dropbox or something) or post the warnings. What errors does the log give if you put nvidia in the xorg.conf?

      (I'm not sure I'll be able to give you any more help, sorry)

      Delete
    2. by the way, if you're messing around with your xorg.conf, it is way, WAY more convenient to exit completely out of your login screen (there should be some option like "exit to console"), go to a tty, and use startx to start X, rather than restarting every time

      Delete
    3. Update for troubles coming back from uninstalling Bumblebee:

      I had to go through this again recently when I tried to use Bumblebee again. After uninstalling Bumblebee, I could not figure out how to get the nvidia driver working again using my package manager. I ended up downloading the driver directly from nvidia and running their install script. That seemed to work well. For it to work correctly at startup, you also need to make sure you blacklist the nouveau kernel module somewhere in /etc/modprobe.d

      Delete
  7. This is great information that I look forward to trying out on mt T520. One thing that worries me is that I connect/disconnect from the external monitor daily and I'd like to be able to do so without losing my session. I can do this now with an extended desktop using the Integrated BIOS setting and an external monitor (at reduced resolution) connected to VGA.

    ReplyDelete
    Replies
    1. Unfortunately in Optimus mode, I have not found a way to change the number of monitors without completely logging out of the graphical session because xrandr does not support multiple graphics cards as far as I can tell (If you figure out a way to do this, please do share).

      If you want to use your Display port output and connect and disconnect your external monitor on the fly, you need to use the Discrete BIOS setting (this all assumes that on T series the Thinkpad display is in fact connected to the discrete card in discrete mode). Really this is not a bad solution at all if you only want two monitors at any given time. The battery life on the discrete card will be reduced, but not horribly.

      Delete
  8. Same problem with my T520. The DisplayPort in Ubuntu 11.10 does not work. When 'Discrete Graphics' is enabled, the system does not detect the card and this prevents the installation of Nvidia drivers. I wish I could help if I had more time.. Using Win7 for now :(

    ReplyDelete
    Replies
    1. If the system is saying that there is no available device when you are trying to insert the nvidia kernel module, then it is possible that you are inadvertently using the nouveau driver.

      If

      $ lsmod | grep nouveau

      comes up with anything, you can unload the nouveau kernel module with

      $ sudo rmmod nouveau

      and then insert the nvidia module

      Delete
  9. I have had the problem with the booting with Discrete Graphics. It hangs after selection of kernel (Ubuntu 11.10, 64-bit, no Nvidia-drivers yet).

    I found this bug:

    http://forums.lenovo.com/t5/Linux-Discussion/64-bit-Linux-W520-amp-nVidia/td-p/577789

    Turning of VT-d allowed me to boot successfully. Now I'm finally running with at least two screens.

    ReplyDelete
  10. Zach, this post was very helpful to me. However, I could not get the stuff to work. I've posted my problem here. (http://ubuntuforums.org/showthread.php?p=11941227#post11941227)

    Any thoughts?

    cd

    ReplyDelete
    Replies
    1. I put my thoughts on the forum post. That's all I can offer - I can't really help too much with T-series laptops because I don't have one.

      Delete
    2. I appreciate your feedback. From a graphics standpoint, I think W and T series are virtually identical.

      Any special ideas on getting the nvidia-settings to recognize the fact that I'm using the nvidia driver and preventing,... "You do not appear to be using the NVIDIA X driver. Please edit your X configuration file (just run `nvidia-xconfig` as root), and restart the X server." message.

      Also, I've had some issues with 3d ubuntu unity working with Discrete. Could that also be because bumblebee was interfering..

      Going to try it today around 5 ET. I'll let you know what happens.

      Thanks again.

      Delete
    3. The reason nvidia-settings wasn't working is probably because you are actually using nouveau. Use $ lsmod | grep nouveau to see if nouveau is loading. To prevent it from loading at startup, you can either blacklist it in /etc/modprobe.d or just uninstall nouveau. The driver install script from the nvidia website will ruthlessly blacklist it for you I believe, which is why that script works so well. Alternatively, I think if you install nvidia-current with apt-get, using jockey to enable nvidia might blacklist nouveau. The recommended ubuntu methods (apt-get and jockey) are careful, so they don't always work in weird cases like ours; the install script from the nvidia website is more of a brute force approach, but sometimes that is what you need when you have a weird system like ours.

      Delete
    4. I don't see it running now. I'll give an update after I try your suggestion tonight.

      Thanks again for the quick feedback.

      Regards,

      Delete
    5. nouveau is probably not loaded now because of bumblebee

      Delete
    6. Working well now. Using the nvidia driver in discrete mode. Thanks for your help.

      cd

      Delete
  11. Is there a way to do this for Windows 7 users?

    I have one of these: https://www.google.ca/search?q=lenovo+w701ds
    They came with discrete nVidia Quadro cards. The motherboard has on-board Intel graphics which is disabled if a discrete card is present.

    My "problem" is that only 2 monitors can be active at any given time: the notebook's main monitor (which is constantly on) plus EITHER the slide out monitor (connected through an internal VGA port) OR 1 external monitor (connected to any of the video ports - VGA, DisplayPort, HDMI). The slide-out takes precedence. So for example, if you have the main notebook monitor and an external monitor on, then suddenly open the slide-out monitor, the external monitor is disabled. The desktop re-organizes to use the slide-out. If you retract the slide-out monitor, the external monitor resumes. I'd like to have the 3 monitors active, the main notebook, the slideout and external monitor.

    Thanks.

    ReplyDelete
    Replies
    1. It's likely that the discrete nvidia card can only support a maximum of two screens by itself (that is the case for the nvidia card on the W520). So, in order to have three screens, you would have to run the nvidia and intel cards at the same time. I have no idea how to do this in Windows, or if it is even possible in Windows or Linux on the W701. It may be that there is a hardware switch that slaves all the screens to the nvidia card and cannot be overridden by software.

      Sorry I can't be of more help.

      Delete
    2. I would think if was successfully performed on another Lenovo with discrete and on-board graphics built around the same time period, it may work on my machine as well. Of course, the big difference is Linux vs Windows.

      Delete
    3. Even though the computers are in the same series and from around the same time period, they could be significantly different because of Optimus technology. I don't believe the 701 has optimus, and since optimus represents a fundamentally different approach to integrated and discrete graphics, it would not surprise me (although it does disappoint me) if the W701 only supports only two screens even though Thinkpads with Optimus support 3 or more.

      Delete
  12. Hello.
    I need your help. I have to connect another monitor to my w520, I can connect one using thikdisp, but I can not use three and I would like to know in more detail how you do it. I am not very expert user in this, so I need a little help. I'm using bumblebee to get use another monitor. Thank you.

    ReplyDelete
    Replies
    1. Hi Paul,

      Sorry it took me a while to get back to you. Just to make sure, you want to use the thinkpad built-in display and two others, correct? (using three external displays is impossible as far as I can tell)

      Using three displays is completely different from using two as you have been. You will not be able to use screenclone and thinkdisp to do this. Right now the virtual display patch for the intel driver that goes along with screenclone only supports one additional screen, so unless you can convince the author of that to enhance it, it is impossible to have three displays on a W520 with screenclone.

      Instead, to get three displays running, you have to start a special X-session using an older technology called Xinerama which uses both graphics cards together. There are some downsides to this - when you are running three displays, you will not be able to have fancy desktop effects, 3D acceleration will only be available on the two external screens*, and, most importantly, you have to logout of your graphical X session to change the number or size of displays.

      I do not have bumblebee installed, and I suspect that bumblebee will make it more difficult to get three screens up and running. So if you really want to do this, I would recommend creating a new small partition on your hard drive and creating a clean install of linux for testing (if you like the result on your test partition, you can do the same thing on your main one). You don't want to go messing up what you have now until you are sure you want three screens.

      So, to get it working, the basic steps are to:
      1. Make sure the nvidia drivers are installed
      2. Create a xorg.conf file that includes three screens and xinerama (see the example in case 3 above)
      3. Completely log out of X until you are in a terminal with no gui
      4. start X (probably using the startx script) with the xorg.conf that you created

      If you decide you want to pursue this and need more detailed instructions on a step, let me know. And, if you get it working and want to know how I automate and use it day-to-day, I can describe that to you.

      * I think it might be possible to fix this, but I haven't taken the time to figure it out

      Delete
  13. Curious if you know why jockey-text -l returns nothing. if I try -e xorg:nvidia_current it says unknown driver..

    ReplyDelete
    Replies
    1. jockey is still a bit of a mystery to me, haha. I believe that it only works correctly when you use only official ubuntu packages for everything, and even then sometimes it appears to not correctly find everything. Which method have you used to install the nvidia drivers? Did you use the installer on nvidia's website or the ubuntu packages? Right now, I have all of the nvidia stuff installed and working, and when I run jockey-text -l, I also get nothing.

      If you are having trouble installing nvidia drivers, I would recommend using the installer from nvidia's website. It doesn't jive very well with package managers, but it is a good brute force way of getting it working. Unfortunately I'm really no expert on how all of these things work together, and I don't have enough time to try out all the different combinations of configurations/settings, so I can't be of too much help.

      Delete
    2. aptitude even says that nvidia-current is installed, but jockey-text -l returns nothing... I would say that it must be broken.

      Delete
    3. ... or I just don't exactly understand what jockey is supposed to be doing.

      Delete
  14. For some w520 with virtualization enabled in the bios, you will have problems booting ubuntu 12.04, 12.10 and lubuntu 12.10.

    ReplyDelete
  15. Very nice post!

    As i understand, the 2 external displays are directly connected to the nvidia card, and the internal laptop monitor to the intel card. Therefore nvidia 3D graphics are (obviously) only available to the external screens.

    I was wondering if this is a linux/xorg limitation only.
    So basically, is, when using windows 7, the Nvidia 3D acceleration available on the laptop screen (via optimus) while running a total of 3 independent displays?

    Thanx in advance if you would be able to answer this one!

    ReplyDelete
    Replies
    1. Dennis, that's correct. When you're using Windows 7, the OS seemlessly determines what programs require the nvidia acceleration. If a graphically intensive program is used on the Thinkpad display, the nvidia card does all the rendering, and then loads the framebuffer to the intel card so it can be displayed on the Thinkpad display.

      So, yes, in short, you get to have perfect seemless integration and accelerated 3D graphics on all three independent displays on Windows without having to do any work.

      Delete
    2. Thank you for your prompt response Zachary!

      I should be able to get my hands on a similar laptop, so thats why i asked ;)

      (running windows as primary OS, linux secondary)


      Delete
  16. Zach, the other day (maybe a week ago tops), I noticed that after an xorg X-server ubuntu update that something had changed with the handling of graphics. Formerly, I would have to reinstall the nvidia driver after each xorg version change because it would break the current configuration. This time, I noticed that there was support for controlling displays using xrandr and the native Ubuntu 'Displays' applet. This is much better than it was originally.

    Have you seen this change as well? And/or has anything changed in terms of support for Tri-Head display using the 'Displays' applet.

    Thanks for the help.

    ReplyDelete
    Replies
    1. George,

      Hmm... that sounds interesting. I am still on Kubuntu 12.04 with an old version of the X-server, so I have not experienced this update. Since a great deal of new laptops have nvidia optimus, I would not be too surprised if they are trying to integrate bumblebee or some other solution into ubuntu (however I know nvidia hasn't been getting along with the Kernel people too well lately, so I doubt that the good proprietary nvidia drivers will support things). My configuration has been static lately, because I need something that works, and don't have too much time for messing around.

      Do you have a W520 or a T520? The T520 has always supported an additional VGA display configurable with xrandr without use of the nvidia card.

      Even if bumblebee has been integrated into ubuntu, it seems likely to me that it will only support two displays for the W520 as it has in the past, and xinerama will still be needed for tri-head.

      If you find out anything else, I'd appreciate hearing about it. Thanks

      Delete
  17. GOAL: GLX working on any nvidia driver with at least a 1920 x 1080 X window display size.

    STARTING WITH:

    Lenovo Thinkpad W520
    ubuntu 12.04 LTS 64 bit
    http://us.download.nvidia.com/XFree86/Linux-x86/319.23/README/installdriver.html
    http://us.download.nvidia.com/XFree86/Linux-x86_64/295.53/NVIDIA-Linux-x86_64-295.53.run
    working X on 1920 x 1080 (16:9) laptop display (no nvidia or GLX)
    ACTIONS:

    CTRL-ALT-F1
    login:passwd
    cd Downloads
    sudo su
    service lightdm stop
    init 3
    pushd /etc
    mkdir X11.backup; cd X11; tar cf - .|(cd ../X11.backup;tar xf -) # Make a safe copy
    popd
    chmod +x NVIDIA.*run
    ./NVIDIA.*run
    service lightdm start
    PROBLEM 1: X screen is 640x480 with no possibility of adjustment (System Settings>Displays) offers no size changes. Small screen makes using X impossible.

    CTRL-ALT-T
    nvidia-xconfig
    PROBLEM 2: rewritten /etc/X11/xorg.conf doesn't work any better.

    RECOVERY:

    CTRL-ALT-F1
    login:passwd # if you logged out before
    sudo su
    cd /etc
    mv X11 X11.nvidia
    mkdir X11
    cd X11.backup
    tar cf - .|(cd ../X11; tar xf -)
    service lightdm start
    Now I am back to my beloved 1920 x 1080 X-windows, with no nvidia and no GLX.

    I've been experimenting with making nvidia work on this laptop for years without success. Bumblebee, and every other thing I have tried leads to the same lack of nvidia or screen size control. I have tried numerous changes to BIOS (optimus etc...)

    Please offer advice on reaching my GOAL. The more detailed the command sequence, the better. Explanation is of secondary importance, and the less there is, the easier it is to run the commands.

    I will return the favor by posting a precise sequence of actions that leads to successful installation as it actually is done on my machine. It may help other thinkpad owners who I have seen struggling with this.

    ReplyDelete
    Replies
    1. Hey jlettvin,

      I think I might be able to help you out if you answer a couple questions first. 1) Do you want an external display with 1920x1080, or the original thinkpad display? 2) Are you willing to do a clean install of ubuntu, or do you need to keep your current install? (nvidia related things seem to work better on 13.04)

      Delete
    2. Sorry for the delay (moved to a new city). I use this machine as a portable system, so having a 2nd display is unreliable but possible. I will do a clean install to achieve GLX support.

      Delete
    3. Ok, these instructions are what will work for the W520 - I think they should work for yours, but might not be exactly the same.

      1. Make a fresh install of ubuntu (create a new partition for testing or back up your data and reinstall)

      2. $ sudo apt-get install nvidia-current nvidia-settings

      3. reboot
      when the thinkpad splash screen comes up on boot, hold F12 until beep - this will get you into the bios config
      press tab to select Application Menu
      press Enter to select Setup
      right arrow to Config tab
      down arrow to Display
      press Enter to see Display properties
      press down arrow to select Graphics Device
      press enter, up and enter again to select Discrete Graphics
      press F10 to save and exit
      Let the device reboot (things should look a little different since you are using nvidia graphics now)

      3. Log into ubuntu and run nvidia-settings to see if it worked

      This setup will get you all the graphics acceleration you could ever want, but battery life will be significantly reduced. Let me know if you want to try something more complicated to get better battery life.

      Delete
  18. Hey Zach it's Jason from your AERO 401/402 group,

    Pretty crazy that I randomly found this while looking to fix some of my external monitor troubles. I have a W530 running Xubuntu 13.10 64-bit driving two external monitors via docking station. In the past I've successfully used bumblebee on the W530 without external monitors but ended up switching to discrete graphics only to get the external monitors working. I'm definitely going to try your tips on getting external displays to work with bbswitch/bumblebee.

    I was actually trying to find a solution to a different problem though. Currently I am very happy with my dual-head setup (I keep the laptop on the docking station closed), my only complaint is that the xfce login prompt is not displayed on one of my two external monitors. Do you have any advice on how to fix this? It is almost like my monitor settings are for the local user and I have to login before they take effect.

    Thanks,
    Jason

    ReplyDelete
    Replies
    1. Hey man! haha, it's funny that you ran into this. Beware that alot of the specifics in this blog might be out of date though. The general ideas still apply, but I don't really have the resources to be retesting stuff and keeping it up to date.

      I don't think xfce actually handles the login prompt. On most Ubuntu systems, it's a program called lightdm, and it's run by root, so I guess it wouldn't use any user settings. There may be a way to tell it to use some specific xorg.conf, but I'm not sure. I got rid of lightdm a long time ago - I just log in on a tty and start X myself (gotta get more hacker cred, haha ;) ).

      So is that KeyCpp project something that you did? That's pretty cool - Looks like it might be handy for engineers transitioning to cpp.

      - Zach

      Delete
    2. Thanks for the help! There is a configuration file called /etc/lightdm/lightdm.conf. Adding a slightly modified version of this script and telling lightdm to run it through lightdm.conf fixed my problem.

      I had a lot of my research code written in Matlab but it didn't take very long before it was too slow for my needs. I started the KeyCpp project to try to make it easier to port my Matlab code to C++. It's mostly a Matlab-like wrapper around other numerical libraries.

      Are you still at A&M? I'm pretty isolated out here by the airport.

      -Jason

      Delete
    3. Actually I'm not at A&M any more. I'm out at Stanford now. If you're ever out here for anything let me know though. I hope your research is going well. Are you thinking of graduating soon, or do you have a long ways still?

      Delete
    4. Stanford...very nice! Hopefully they'll have an AIAA conference out there sometime soon. I have probably another 1.5 years or so before graduating.

      Delete
    5. Jason,

      Did the tri-head configuration worked for you on W520?. I have been trying to configure this for long and haven't been able to successfully configured Tri Head on my W520

      Cheers,
      Buddy

      Delete
  19. Hello .
    I recently installed Ubuntu on Thinkpad T520 with only integrated graphics. Nowhere but I can not find a driver that I installed ubuntu when it is not supported. Thanks a lot - Im beginner :)

    ReplyDelete
  20. Hmm, I can't get this plan to work. I am using Ubuntu 12.04, and as far as I can tell, the nvidia driver is loaded, and nouveau isn't. (in the kernel) - i.e. lsmod | grep nouveau returns nothing. But Xorg.0.log says that X is loading the nouveau module anyway. Is that a different nouveau module? (An X11 module as opposed to a kernel module?) Could that be confusing my system? It sure is confusing me.

    Basically when I try to run the startx -- -config xorg.conf.triple.txt (btw is this supposed to run as user level or root level?), it does not give me a login screen, just a series of "no protocol configured" errors, and "cannot connect to X server", then it times out and gives up.

    I notice that you have a couple of specific monitors listed in your xorg.conf.triple.txt, which don't exactly match mine. Do I need to rewrite that xorg.conf file with the details of my monitors?

    Also after I experimented with this, I could no longer log in with "sudo service lightdm start" either. (having used "sudo service lightdm stop" to go to a shell in the first place.) It would give me a login screen, but then when I entered my credentials, it would fail to log in and then just go back to the login screen. I had to switch to gdm, log in that way, and then after that I could switch back to lightdm.

    Also after I stop my existing login via "service lightdm stop", I can't just use "startx" to get a login screen with my previous configuration either. So I think the triple-head thing is not the problem, it is something else.

    I am trying to get the triple-head display to work with Nvidia Optimus. I don't care too much about graphics acceleration, I just want three independent screens.

    Any ideas?

    ReplyDelete
    Replies
    1. Hey Steve,

      1. Yeah, it is kind of confusing. I'm not even sure I'm really clear on it all. I think that X uses a 'device driver' which IS (?) a linux kernel module. It could be that you have the nvidia kernel module loaded, but X is trying to use the nouveau device driver for some reason

      2. startx should be able to run as a normal, non root user

      3. The monitor vendor, model number, etc. in the xorg.conf shouldn't matter - I use the same file with a bunch of different models and different resolutions.

      4. I'm not sure why the lightdm service isn't working

      Hopefully that eliminates some variables. Sorry that wasn't much help. I can't think of anything that would cause this to happen. You are in the nvidia-optimus mode in the bios, right?

      Delete
  21. I've got a docking station for w520, w530, t520, t530 etc.
    If I put my t520 into the docking station, nothing happen.
    The two screens which are connected via hdmi (screen) to dvi (docking station) do not receive a signal. (In Window 8.1 no problem...)

    I've taken your tirple-config, but I get only a blank screen (desktop background, no launcher) and the two external screens are still dark...

    ReplyDelete
    Replies
    1. I would recommend not starting with the triple config. Try just changing the bios to "discrete" graphics mode, installing the nvidia drivers and nvidia-settings, and seeing if you can get it to work by messing with nvidia-settings. Then, once you prove that that works, you can move on to using a custom xorg.conf file

      Delete
  22. thx for this post, i finally have 3 displays running, BUT one issue is left:

    (running the same xorg.conf like you)

    the internal display and the vga-display shot the same picture (cloned).

    why is that?

    PS: having a T530!!!

    ReplyDelete
    Replies
    1. Hmm... That is strange. I would expect it to not work at all if there is something wrong. I believe that on the T420 the VGA output was connected to the intel card instead of the nvidia card, so the xorg.conf for the W520 did not work correctly. Perhaps that is the case for the T530 as well. You may be able to change it by changing the device field in the VGA Screen section to tell it that the intel card is connected to the VGA screen, but I have no idea if that will actually work. Sorry I can't give more detailed help.

      Delete
    2. thank you Zachary,

      there is probably a difference between W520 and T530 regarding this. i cant live with "only" 2 screens, its just not easy to accept if this works with stupid win7 and not with debian ;)

      Maybe it works with bumblebee, but i tried that with no success. Bumblee seems to be kind of hard to set up. Its not very attractive to me since hard to set up and i`ve read that it is buggy/rather experimental.

      My next try will be: Extending an additional screen over LAN to another machines display with XDMX. that would be a good alternative.

      But if someone has an idea of making this (tripple head on T530) work i`d still be thankful for some hints. Please reply to this if thats the case.

      Cheers and thx

      Delete
    3. sorry missspelling:i cant live with "only" 2 screens. i mean "yes, i can" ;)

      Delete
  23. This blog post saved me a huge headache :) Thanks for the awesome work!

    ReplyDelete
  24. This comment has been removed by a blog administrator.

    ReplyDelete