Drive:Activated logo
hi there!

I see you've stumbled on to my humble home on the net, Drive:Activated. My name's Sam, I'm an ambitious and driven uni student, residing in Melbourne, Australia, wanting to make my mark on our world. This is my site, which is mainly just my blog and some other bits. There's no definite theme to my blog, just anything that interests me, and currently that's web trends, startups, ideas and cool stuff. Check it out, leave me a comment, click on 'Who is this?' to find out more about me, or drop me a line by clicking on 'Let's Talk'. Hope you enjoy it!

My signature

Content sign

Troubleshooting Linux screen resolutions

   Filed under: , , , ,    
Well, after getting my Vista installation dual-booting with XP again, I needed a new challenge, so I decided to try my hand at Linux. Past experience told me this would be a rough ride, and it was. I used OpenSuSE 10.2, as it was the only major distribution to use the 2.6.18 kernel version so it would work with my new Intel 965 chipset computer.

Installation went relatively smoothly, but once it tried to boot, problems started occurring. I seem to have a history with Linux and its video system, and this was no exception. On first boot, the screen went black and I got the "Out of Range" message from my monitor. After a bit of digging and luck, the solution is:
  • While the screen is black and the monitor is in 'out of range' mode, press Ctrl-Alt-F1 to get to the terminal.
  • Press Ctrl-C to kill off the failed GUI loading attempt.
  • Log in using the credentials you made during setup.
  • Now, try using SaX2 to configure your monitor (this didn't work for me, but its worth a try). Do this by typing (pressing Enter after each line):
    • su
    • enter your root (admin) password
    • init 3
    • sax2
    • Fiddle with the settings here, in particularly the monitor settings. Test, save, exit.
    • reboot
  • If that doesn't work, repeat the first 3 steps again to get to the terminal.
  • Now instead of using SaX2, we'll try using the display configuration file used for the setup process. Type the following (pressing Enter after each line):
    • su
    • enter your root (admin) password
    • init 3
    • cd \etc\X11
    • mv xorg.conf xorg.conf.faulty
    • cp xorg.conf.install xorg.conf
    • reboot
  • That should get you into the Linux GUI (which ever you chose).
Ok, now that I have the display running, I wanted to get xgl working (one of the funky special effects engines on Linux). I knew it wouldn't be easy - turns out the default drivers I had for my NVidia GeForce 7300 GT did not have the 3D acceleration stuff in them (they were the open-source nv ones, not the proprietary nvidia ones - geez, when will the linux people realise we don't give a damn about license conflicts as long as it works Angry). To install the 3D accelerated ones, follow the instructions at http://www.suse.de/%7Esndirsch/nvidia-installer-HOWTO.html#1. Note that from my experience, the pre-built packages downloadable and installed through YaST don't work, so I did it the 'long way', being the following (repeated and commented from the link above):
  • In SuSE, opened the Control Center, scrolled to the bottom to YaST, then clicked on Software Management.
  • Searched for the packages kernel-sources, make and gcc and ticked the box.
  • Clicked accept.
  • Waited for the download and installation...
  • Closed the software management, YaST and Control Center windows.
  • Opened up Firefox and navigated to the NVidia site to download the latest linux driver (http://www.nvidia.com/object/unix.html). Note that IA32 = x86 = your standard computer unless you're running a 64-bit one. Remember where you save the .run file - I saved it in /home/sam/Desktop.
  • When the download's done, close Firefox. Press Ctrl-Alt-F1 to return to the terminal. Press Ctrl-C to kill off the GUI.
  • Type the following to start the installation:
    • su
    • enter your root (admin) password
    • init 3
    • cd /home/sam/desktop (replace with the path where you saved the NVidia download)
    • dir
    • record the name of the file you downloaded, starting with NVIDIA-Linux.
    • sh (name of the downloaded file), e.g. sh NVIDIA-Linux-x86-1.0-9631-pkg1.run
    • Follow the instructions, and it should install successfully.
    • sax2 -m 0=nvidia
    • Check your display configuration again - note that it is now using the NVidia driver now, instead of the nv driver. Test, save, exit.
      • Tip: Press the Options button next to where it displays the name of your video card, and click the nologo option in the list - this gets rid of the huge and annoying NVidia logo every time it is used.
    • reboot
Ok, I thought I was done now, but I wasn't. I was stuck with a resolution of 800x600 on my Viewsonic VG500 LCD monitor. After fiddling around for a while, I discovered a neat troubleshooting trick for these problems (which I've had on almost every linux installation I've done).
  • If you are currently in the GUI, press Ctrl-Alt-F1 to return to the terminal and then Ctrl-C to kill off the GUI.
  • Now reload the GUI, however, this time, type startx -- -verbose 6 -logverbose 6
  • Once in the GUI, open up the file browser and navigate to /var/log. Open up the Xorg.0.log file in your favourite text editor (if its vi, then by all means, damn weird linux nerds).
  • Most of the stuff isn't that important - locate the section in the file that contains a heap of lines starting with (**) NVIDIA(0) - the asterisks could be two other characters to indicate the meaning of each line.
  • Find something resembling this:

    (--) NVIDIA(0): --- EDID for @@@ (CRT-0) ---
    (--) NVIDIA(0): Maximum Image Size           : 65535mm x 65535mm
    (--) NVIDIA(0): Valid HSync Range            : 4294967 kHz - 0 kHz
    (--) NVIDIA(0): Valid VRefresh Range         : -1 Hz - 0 Hz
    (--) NVIDIA(0): EDID maximum pixel clock     : 0.0 MHz

    If your section (there's one for each monitor you have connected) is anything like mine, it means its old-ish and isn't quite as smart as Linux thinks. It is not providing Linux with the figures needed (called EDID data) for it to work out how to talk to your monitor.
  • A bit further on after that you'll start seeing these lines repeat over and over again for the various display resolutions.

    (II) NVIDIA(0): --- Building ModePool for @@@ (CRT-0) ---
    (II) NVIDIA(0):   Validating Mode "1024x768":
    (II) NVIDIA(0):     1024 x 768 @ 60 Hz
    (II) NVIDIA(0):     Mode Source: X Configuration file ModeLine
    (II) NVIDIA(0):       Pixel Clock      : 65.00 MHz
    (II) NVIDIA(0):       HRes, HSyncStart : 1024, 1048
    (II) NVIDIA(0):       HSyncEnd, HTotal : 1184, 1344
    (II) NVIDIA(0):       VRes, VSyncStart :  768,  771
    (II) NVIDIA(0):       VSyncEnd, VTotal :  777,  806
    (II) NVIDIA(0):       H/V Polarity     : -/-
    (WW) NVIDIA(0):     Mode is rejected: HorizSync (48.4 kHz) out of range
    (WW) NVIDIA(0):     (4294967.000-0.000 kHz).

    The last two lines may be slightly different, but nonetheless, it will say 'Mode is rejected'. The reason it is rejected in my case is because the EDID data from the monitor doesn't exist but the computer hasn't worked that out and its using the dummy figures returned as valid values. Therefore all the modes get rejected because of silly conditions, like the one above, where it says the Horizontal Sync rate has to be below 0 kHz.
  • As my monitor was not providing the data but the computer did not know this, follow the following steps to tell the computer.
  • Open up the Terminal (in GNOME, go to Computer -> More Applications -> search for Terminal).
  • Type in su, press Enter then enter your password followed by Enter again.
  • Type in gedit /etc/X11/xorg.conf (replace gedit with your favourite text editor)
  • Locate the line:

    Section "Device"

    And put in the following line before the following EndSection line,

    Option       "UseEDID" "FALSE"
  • Save the file, close all other windows, press Ctrl-Alt-Backspace to restart the GUI, and with any luck, you should be able to use the resolution you selected in SaX2 earlier, and choose alternative resolutions using the Control Center.

If the above trick doesn't work for you, check out Xorg.0.log again and see what's going wrong - it is a very useful file for tracking down screen resolution problems. Note that if your EDID data is not empty, do not add in the above lines to xorg.conf - your monitor is providing data and this is a good thing.

For more information about what's actually going on behind the scenes in the section explored above in the log file, check out http://us.download.nvidia.com/XFree86/Linux-x86/1.0-9631/README/appendix-j.html. For various settings that could help fix your screen resolution problem, see http://us.download.nvidia.com/XFree86/Linux-x86/1.0-9631/README/appendix-d.html. For anything else related to the NVidia drivers, check out the other bits in the readme file at http://us.download.nvidia.com/XFree86/Linux-x86/1.0-9631/README/index.html.

Windows with all its issues doesn't come close to making a graphics card work this difficult. All you have to do is turn your computer on and the display works (with the inbuilt drivers or you can just download and install the newer drivers from NVidia)... Linux clearly still has a fair way to go before being a real challenger to Windows in terms of user-friendliness for those of us who aren't experts but enjoy experimenting and poking at it - I shouldn't have to touch config files, or the terminal at all.

P.S. For those who are wondering why I'm not using Ubuntu Edgy, its because its kernel version is old, and Fiesty isn't out intil April 2007. For the record, Ubuntu Dapper wasn't much better. It refused to boot until I manually installed the NVidia drivers using the terminal.

P.P.S. If your video card doesn't appear to be recognised in the Desktop Effects dialog in Control Center, and you're sure that 3D acceleration is enabled (check SaX2 - checkbox in near the bottom), you can enable it anyway by firstly holding SHIFT and clicking on the warning triangle and/or the word disabled against 3D acceleration until it changes to enabled. Then just click the Enable Desktop Effects button, and restart.

Trackbacks sign
No Trackbacks
Trackback URL
No trackbacks yet - link to me people!
Comments sign
No Comments
Comments RSS RSS icon
Come on, be the first to unleash those thoughts from within.
Post comment sign
Leave a Comment
I know you want to!
(required)  
(optional)
(required)  

Want to keep stay in the loop with the comments here? Leave your email address below and you'll be informed when a new comment is added to this blog post.

(optional):  

Submit