NVIDIA GeForce4 420 Go on Ubuntu 8.04 (Hardy Heron)
April 26th, 2008Preamble
This is a guide to installing NVIDIA drivers for a GeForce4 420 Go graphics card on Ubuntu. This guide was tested on a Toshiba Satellite Pro 2100 running Ubuntu 8.04 but should work for other laptops with GeForce4 420 Go graphics cards and other versions of Ubuntu.
Introduction
On a laptop with a GeForce4 420 Go, Ubuntu will recognise there is an NVIDIA card and offer to install the restricted driver. Installing this driver will cause two problems.
- On rebooting the screen will be blank
- The correct resolution is not available once driver is working.
This is because the driver is causing the graphics card to output on the VGA port rather than to the laptop screen.
This is because the EDID data being supplied to the driver is not correct.
Requirements
- laptop with a GeForce4 420 Go graphics card.
- Ubuntu (assumed to be a clean install)
- the correct maximum resolution of your display (e.g. 1024×768)
Installation
The first stage is to check the correct repositories are enabled.
- Go to: “System -> Administration -> Software Sources”
- Under the “Ubuntu Software” tab ensure the first three boxes are ticked (main, universe and restricted).
Next the restricted NVIDIA driver must be enabled.
- Go to: “System -> Administration -> Hardware Drivers”
- Tick the box next to “NVIDIA accelerated graphics driver”.
- Close the window and confirm the changes.
You should be informed that a restart of the computer is required before the changes will take effect. Do this now. Do not be alarmed if the computer has a blank screen after the restart; this is expected.
Now we will change the “xorg.conf” file to tell the driver to output to the laptop screen rather than the VGA port.
- Press “Ctrl + Alt + F1″ to open a terminal.
- Login
- As root, open “/etc/X11/xorg.conf” for editing.
sudo vim /etc/X11/xorg.conf
(you can use the editor you are most comfortable with in place of “vim” e.g. nano) - Find the “Device” section (look for the line
Section "Device") and insert as the last line of that section (before theEndSection)
Option "UseDisplayDevice" "DFP-0" - Now save and close the file.
- Restart the X server by typing
$ sudo /etc/init.d/gdm restart
You should now see the login window but it will likely be at the wrong resolution. First check that the desired resolution really is not available. For example on the Toshiba Laptop the screen resolution should be 1024×768.
- Go to: “System -> Preferences -> Screen Resolution” and see if the correct resolution is available.
If the correct resolution is available then select it and everything should now be working. If the correct resolution is not available then you have encountered the EDID problem. This requires some additional packages to fix. First we must install “nvidia-settings, ghex and read-edid”
- Open a terminal “Applications -> Accessories -> Terminal”
- Run:
$ sudo apt-get install nvidia-settings ghex read-edid
We now need to obtain the EDID data.
- Go to: “System -> Administration -> NVIDIA X Server Setting”
- From the left hand list choose: “DFP-0 - (Nvidia Default Flat Panel)”
- Click the “Aquire EDID” button.
- Save “edid.bin” to the desktop. (click “Desktop” then click “OK”)
- Close “NVIDIA X Server Settings” window.
Now we need to check the EDID data.
- In the terminal change directory to the Desktop (or where the EDID data was saved to).
- Check the resolution mode in the EDID data.
$ cd ~/Desktop
$ parse-edid edid.bin | grep "Mode "
The output should look something like this:
parse-edid: parse-edid version 1.4.1
parse-edid: EDID checksum passed.
Mode "969x768" # vfreq 60.004Hz, hfreq 48.363kHz
Here you can see that the EDID data has an incorrect resolution of “969×768″. The resolution is stored in the EDID file as a hexadecimal value. We need to correct the value. To do this we have to edit “ebid.bin” with a hexadecimal editor. We will keep the terminal window open while we do this.
- Go to: “Applications -> Programming -> Hex Editor”
- Click: “File -> Open -> Desktop -> edid.bin -> Open”
You should now be looking at the “ebid.bin” in hexadecimal format. The data is represented as pairs of hexadecimal characters. Each pair correspodes to one byte. Notice that there are 17 bytes in a row. The bytes are indexed from zero so the last byte on the first line is the sixteenth byte.
We need to change the horizontal resolution. This is slightly confusingly split across two bytes. When converted to a hexadecimal value, the first digit of the value is stored in the first charater of the 58th byte and the last two digits of the value are stored in the 56th byte. In our example the resolution in the EDID file is 969. We can use the calculator to convert this to hexadecimal.
- Go to: “Applications -> Accessories -> Calculator -> View -> Scientific”
- Click “Dec” to put the calculator into decimal mode.
- Then enter the number “969″
- Click “Hex” to convert the number to hexadecimal.
You should get the answer 3C9 (hex). The 56th and 58th bytes are show on the forth line of the hex editor. This is the forth line from my file with the releveant characters in bold:
“01 01 01 64 19 C9 77 31 00 26 30 4F 88 36 00 42 FF ”
Notice how the value is written with the last two digits then the first digit.
In my example the desired resolution is 1024. Converted to hexadecimal this is 400 (hex). Hence the 56th byte of my EDID file should be “00″ and the first character of the 58th byte should be “4″. The new line in the file is:
“01 01 01 64 19 00 77 41 00 26 30 4F 88 36 00 42 FF ”
Save the file and re-run parse-edid. (You can go to the terminal and press the up arrow and enter). The output should now look like this:
parse-edid: parse-edid version 1.4.1
parse-edid: EDID checksum failed - data is corrupt. Continuing anyway.
Mode "1024x768" # vfreq 57.645Hz, hfreq 46.462kHz
Don’t worry about the fact the checksum failed. This is not important. We now need to copy the “edid.bin” in to the X configuration directory and set it to override the real EDID data.
- Copy the “edid.bin” to /etc/X11/
- Edit “xorg.conf” to override EDID.
- In the “Screen” section, insert the line:
- Save the file and restart the computer.
$ sudo cp edid.bin /etc/X11/
$ vim /etc/X11/xorg.conf
Option "CustomEDID" "DFP-0:/etc/X11/edid.bin"
The computer should now start at the correct resolution with the NVIDIA driver enabled.
References
The following references were used when compiling this guide.