nVidia

Summary

  • You can now use the Debian packages on both 2.4 and 2.6 kernels -- however, you cannot afaik run the nVidia driver from 2.4 and 2.6 at the same time.
  • On 2.4 systems, you can also run the nvidia-installer scripts --
    • nvidia-installer --latest
    • nvidia-installer --update
  • Works fine on spello and cyberspace too
Software and guides

Commands

  • nvidia-settings (shadow cursor, gamma adjustment, etc.)
  • cat /proc/version  -- compiler version used for running kernel
  • gcc -v  -- default compiler version
  • cat /proc/driver/nvidia/version
  • cat /proc/driver/nvidia/agp/card
  • cat /proc/driver/nvidia/agp/status

Hotkey switching between laptop and projector

This may mean that the Fn+F3 key can work:

Besides TwinView, mobile NVIDIA chips also have the capacity to react to an LCD/CRT hotkey event, toggling between each of the connected display devices and each possible combination of the connected display devices (from nVidia's readme). 

This functionality is not compatible with TwinView -- if you enable TwinView in your X config file, then the NVIDIA X driver will ignore LCD/CRT hotkey events.

Another important aspect of hotkey functionality is that you can dynamically connect and remove display devices to/from your laptop andhotkey to them without restarting X.

Now, that would be a bonus. See the nVidia's readme for details.  A possible complication:
The video overlay only works on the first display device on which you started X.  For example, if you start X on the internal LCD, run a video application that uses the video overlay (uses the "Video Overlay" adaptor advertised through the XV extension), and then hotkey switch to add a second display device, the video will not appear on the second display device.  To work around this, you can either configure the video application to use the "Video Blitter" adaptor advertised through the XV extension (this is always available), or hotkey switch to the display device on which you want to use the video overlay before starting X.
Also try defining two independent screens (xinerama style) -- see app-r of nVidia's readme.

Which AGP?

On kernel 2.6.12, xorg 6.8.2.dfsg.1-5, and nvidia-kernel-source 1.0.7174-4, I added

Option "NvAgp" "1"
to /etc/X11/xorg.conf (xorg.conf.nvidia), and got this in /var/log/Xorg.0.log,

Use of NVIDIA internal AGP requested

When I run glxgears I get 1289.800 FPS -- as good as using the Linux ali-agp module, which won't unload and likely won't suspend.

The values mean the following:
Option "NvAgp" "0"  ... disables AGP support
Option "NvAgp" "1"  ... use NVAGP, if possible
Option "NvAgp" "2"  ... use AGPGART, if possible
Option "NvAGP" "3"  ... try AGPGART; if that fails, try NVAGP
I've generally been loading ali-agp on boot, in which case it is used instead of nVidia's nvAgp. I used to get this in /var/log/XFree86.0.log:
(**) NVIDIA(0): Use of AGPGART requested
When I ran glxgears I get excellent results:
63 frames in 5.0 seconds = 12.600 FPS
50 frames in 5.0 seconds = 10.000 FPS
Using nvAgp used to result in glxgears values around 1,175 FPS -- ten times less (not thoroughly tested).

It may be that on my ALi1541 chipset, NVIDIA drivers used to disable AGP, but that they no longer do, or that I simply didn't test correctly.  Anyway, the internal AGP is working fine now.

In fact, the nvidia kernel now suspends! I get "FATAL: Module nvidia is in use", but suspend and resume work without problems.

Specs

GeForce4 420 Go      

Fill Rate:                     760 million texels/sec.
GPU Core Clock:         190 MHz
Memory Clock:            200 MHz
Memory Bandwidth:    3.2GB/sec.

Installation history

10 April 2004

Discovered that I can use the Debian packages for the nVidia drivers now, starting with 5328:

just install nvidia-kernel-source nvidia-kernel-common
This installs /usr/src/nvidia-kernel-source.tar.gz which untars to /usr/src/modules. When compiling the kernel, issue
make-kpkg clean kernel_image modules_image
to include the modules in /usr/src/modules -- that simple! Or compile the modules on their own against the current kernel tree. This will generate a deb for each module; install it.

Finally,
just install nvidia-glx
just reconfigure nvidia-glx
This last step connects the glx driver to the kernel driver just installed. The instructions recommend,
Create a "video" group, and add to it any users who you want to be able to
use the display. You can do this by manually editing /etc/group, or by

                addgrp --system video
                adduser $USER video
I didn't do this but the procedure may be useful to know.

If you get complaints from some software (old games?) about missing libGL.so, issue
just install nvidia-glx-dev
You get a bit of a delay by using the Debian packages, but at this point that may not matter.

AGP

You can use the AGP driver in the kernel or nVidia's own.  In the 1.0-5336 ReadMe, the ALi Corporation M1671 Super P4 Northbridge [AGP4X,PCI and SDR/DDR] is listed as supported, but in the tests below I didn't find it to be any better than the Linux AGPGART, in fact slightly slower. Howerver, there may be instances where nVidia's driver has a preferred performance.

A. Using the AGP in the kernel

Select these in the kernel:
CONFIG_AGP=m
CONFIG_AGP_ALI=m
Comment out this in the X11 configuration file:
# Option "NvAGP" "4"
You will now use the kernel AGP. 

The X11 log file will say,
(II) NVIDIA(0): AGP 4X successfully initialized
I get 1034 FPS on glxgears.

B. Using nVidia's AGP

Leave the two options above from the kernel, or don't insert the modules (you'll have to leave them out of /etc/modules.conf).

Unomment this in the X11 configuration file:
# Option "NvAGP" "4"
The X11 log file will say,
(**) NVIDIA(0): Option "NvAGP" "4"
(**) NVIDIA(0): Use of NVIDIA internal AGP requested
(II) NVIDIA(0): AGP 4X successfully initialized
I get 1034 FPS on glxgears -- same value. However, 3D games like tuxracer appear half in the upper screen and half in the lower.

Finding: the kernel's AGP is better.

29 December 2003

Since I ran into a problem with thread-local storage (TLS) on Sigillo, I upgraded to 5328, which so far runs perfectly.

The upgrade was simplicity itself: download and run the patch. It took 30 seconds (you need to exit x-windows).

The TLS problem was triggered by mplayer-mozilla in conjunction with mozilla; the patched nVidia driver uses TLS and the three did not play well together. I uninstalled mplayer-mozilla.

26 December 2003

There are now two new drivers, and you can get pre-patched run versions here. Early reports on the 5328 are mixed. Since I'm having zero problems with the current driver, 4363, there's no reason to upgrade. I might do it when I upgrade the kernel (still running 2.6.0-test9).

See also this new Debian/nVidia/2.6 recipe.

28 October 2003

After compiling the new 2.6.0-test9 kernel (leaving out ipx, which causes an oops in natsemi), I went to http://www.minion.de to get the latest nvidia patches. I got the latest driver directly by ftp from ftp://download.nvidia.com. I then followed the instructions in http://www.minion.de/files/NVIDIA_kernel-1.0-4496.README
 -- note that you have to build the driver from scratch, not for a system that already has the driver installed, since your 2.4 kernel does not have the current driver. (It might be a good idea to upgrade the 2.4 kernel first, but you have a new gcc since you built it.) So the simple solution is to patch nVidia's driver, make a new installer, and run the installer (for the last two, see below).

The main page says, "Debian GNU/Linux's make-kpkg translates a custom suffix appended to the kernel version via --append-to-version into an extended EXTRAVERSION passed on the command line. The same EXTRAVERSION needs to be set when the NVIDIA kernel module is built." I used kernel-image-2.6.0-test9_sigillo.1_i386.deb this time -- how do I pass _sigillo.1 on? No idea.

Maybe

make --append-to-version sigillo.1 install
Skirting this issue, I proceeded to build a modified installer:

/vc/software/binary/nVidia/NVIDIA-4496# sh NVIDIA-Linux-x86-1.0-4496-pkg0/usr/bin/makeself.sh --target-os Linux --target-arch x86 NVIDIA-Linux-x86-1.0-4496-pkg0 NVIDIA-Linux-x86-1.0-4496-pkg0.run "NVIDIA Accelerated Graphics Driver for Linux-x86 1.0-4496" ./nvidia-installer

That worked.  I then ran the installer with this command:
sh NVIDIA-Linux-x86-1.0-4496-pkg0.run --kernel-name=2.6.0-test9
This built flawlessly and is the way to go. I was now able to boot into 2.6.0-test9 and get X11.

However, the 4496 driver didn't return me to a console after exiting, so I reverted to 4363, which is working fine (still as of end December 2003):
root@sigillo:~#  cat /proc/driver/nvidia/agp/status
Status:          Enabled
Driver:          NVIDIA
AGP Rate:        4x
Fast Writes:     Disabled
SBA:             Disabled
root@sigillo:~#  cat /proc/driver/nvidia/agp/card
Fast Writes:     Not Supported
SBA:             Not Supported
AGP Rates:       4x 2x 1x
Registers:       0x1f000007:0x08000104

24 October 2003

To check what version of gcc was used to compile your kernel, you can examine the output of:

cat /proc/version

To check what version of gcc is currently in your $PATH, you can examine the output of:

gcc -v

[From the nVidia README.txt for 1.0-4496.]

Please note that NVIDIA's internal AGP support cannot work if AGPGART is either statically compiled into your kernel or is built as a module, but loaded into your kernel.

[From the nVidia README.txt for 1.0-4496.]

Use startx -- -logverbose 5 for better log files.

8 July 2003

Going to /vc/software/binary/nVidia, I ran NVIDIA-Linux-x86-1.0-4349.run to install a new driver on Spello. However, the script exited on finding that the current gcc was different from the compiler used to build the kernel. I tried export CC=/usr/bin/gcc-3.2 and export CC=/usr/bin/gcc-2.95, and even export CC=gcc-3.2 and export CC=gcc-2.95, but got nowhere. Problem: I don't know how to find out the compiler used for my current kernel. I asked on the nVidia site if anyone knew. Later I realized this is clearly spelled out in dmesg -- at any rate, I rebuilt the kernel with 2.4.21-ac2 and then installed the new nVidia driver on Spello; it's working fine.

20 May 2003

For nVidia patches to the 2.5 kernels, see http://linuxespana.scripterz.org and http://www.minion.de (I used the latter). For the 2.5.69, I just had to patch the Makefile. I got the original makefile from nVidia's ftp site -- specifically, you need NVIDIA_kernel-1.0-4363.tar.gz for the 4363 driver patch and NVIDIA_GLX-1.0-4363.tar.gz for glx. Untar the kernel driver; you'll see the Makefile in the resulting directory. To patch, issue:

root@sigillo:/vc/software/binary/nVidia# patch -p0 < NVIDIA_kernel-1.0-4363-2.5.diff

"After patching the NVIDIA driver, you will need to choose one of the two provided Makefiles by creating a symbolic link from the Makefile of your choice, Makefile.kbuild or Makefile.nvidia, to Makefile."

        ln -sf Makefile.nvidia Makefile

Before you can "make", get the latest module-init-tools:

        just install module-init-tools

Then just issue make. You should get "nvidia.o installed successfully." Issue lsmod to verify, and add "nvidia" to /etc/modules:

cp /vc/software/binary/nVidia/NVIDIA_kernel-1.0-4363/nvidia.o /lib/modules/2.5.69/kernel/drivers/video

Then untar the glx driver, enter the directory and issue make -- the installation should be automatic and worked fine when I did it.

Issue depmod-a -- and make sure you remove any current nvidia.o before you try to insmod the new one.

Tested: it works! So I have both screens working in 2.5.69. Wow.

19 May 2003

It took me a few days to realize that ctrl-alt-+/- was no longer working in TwinView under the 1.0-4349 driver; this was fixed in the 1.0-4363 release. I used the nvidia-installer to get this at first, and GLX wouldn't load. Then I downloaded the NVIDIA-Linux-x86-1.0-4363.run package (see /vc/software/binary/nVidia) and ran that, and everything's been working. This was all for the 2.4 kernel of course.

17 May 2003:

To update the nVidia driver, issue

nvidia-installer -a --update

After the update, issue "insmod nvidia" -- otherwise X-windows will "fail to initialize the nvidia driver."

XFree86 4.3.0 works great, as long as you avoid xlibs, xlibs-dev, and xbase-clients (these screw up international keyboards). I was initially unable to switch between display modes in 4.3 -- this was a problem with the nVidia driver that was fixed with the 4363 update.

30 March 2003

The 1.0-4349 may still be a bit buggy, according to reports at
http://www.nvnews.net/vbulletin/forumdisplay.php?s=&forumid=14

For instructions, see ftp://download.nvidia.com/XFree86/Linux-x86/1.0-4349/README.txt

I downloaded it on 30 March 03 and installed it, letting it rebuild the kernel headers (or
something like that).

The log files are identical apart from the version information. I don't notice any performance
difference (2D was supposed to be faster), but then it's been fine already.

The installer worked great, and you can use it to install an update -- instructions at
ftp://download.nvidia.com/XFree86/Linux-x86/1.0-4349/README.txt and possibly on the harddrive.

22 Feb 2003

Switched to the Dell monitor for the external display for Sigillo.

Option "MetaModes" "1600x1200 , 1280x854 +0+1200"

This gave me splash and the icons in the large screen above The menu bar at the bottom in the small screen (where it should be) The passage between the two screens was correct (0 on top of 1) Raising screen1 has the effect of placing the icons above The rest looks great and the passage is correct

Option "MetaModes" "1600x1200 , 1280x854 +0+854"

Splash top
Icons top left
Menu bottom
Passage top
Partial overlap on top

Option "MetaModes" "1600x1200 , 1280x854 +0+0"

Two splash screens
Icons normal AND top left
Menu top only
Passage bottom
Full overlap

Option "MetaModes" "1600x1200 +0+500, 1280x854"

Two splash screens
Icons normal and top left
Menu top only
Passage top
Partial overlap

Option "MetaModes" "1600x1200 +0+853, 1280x854"

Menu bar on top screen
Logically, screen0 is at 0,0 with sceen1
Raising 0 leaves 1 where it used to be

No -- precisely not.

Logically, raising screen0 situates screen1 above it
Raising 0 pushes 1 to the top
The icons are located in screen0
What you need to do is subtract?
Raising 0 pushes 1 to the top
You need to lower

Option "MetaModes" "1600x1200, 1280x854 -0-1200"
Virtual 1600 2054

Weird -- and not useful

Option "MetaModes" "1600x1200, 1280x854 -1200-0"
Virtual 1600 2054

Same effect as
Option "MetaModes" "1600x1200 , 1280x854 +0+1200"

Problem: icons on top, otherwise fine

Option "MetaModes" "1600x1200 -854-0 , 1280x854"

Same effect as
Option "MetaModes" "1600x1200 +0+854 , 1280x854"

What you want to do is to raise screen0 -- which means what?
Raising 0 really means to move the icons down, with screen1

Option "MetaModes" "1600x1200 +0+0, 1280x854 -10-10"

The menu bar got squeezed down below the bottom of 1 to appear in 0

"1600x1200 -1200+0, 1280x854 +0+854"

Weird gray area -- not coherent


December 2002

AGP

In the nVidia driver guide it said that nVidia can't use its own agp software if XFree86's is already loaded -- and it looks like it is:

Linux agpgart interface v0.99 (c) Jeff Hartmann
agpgart: Maximum main memory to use for agp memory: 438M
agpgart: Detected Ali M1671 chipset
agpgart: AGP aperture is 128M @ 0xf0000000

So this may need to be removed from the kernel -- I wonder if I always had it in? You also need to check if agp is deactivated for this chipset -- that's to say the Ali M1671. The 128M is the video memory I take it.

The nVidia guide says that nVidia disables agp for Ali 1541 and 1647, but does not mention 1671. However, on page 46 (51) it says that "the nVidia internal AGP support cannot work if AGPART is either statistically compiled into your kernel or is built as a module and loaded into your kernel" -- and this is clearly happening. So remove it from the kernel?

In /etc/modutils/aliases I commented out "alias char-major-10-175 agpgart" and issued update-modules -- let's reboot and see if we get a difference -- well it didn't because it's in the kernel and Linux finds it anyway on booting. So I removed it from the kernel and indeed it is now gone -- but I see no difference in the nVidia / XFree bootlog -- in both cases it says AGP 4X was successfully initialized. So maybe it didn't matter. On the other hand, I don't believe I needed the kernel-land agp, so it's good to leave it out. The kernel did get a bit smaller.

XV

Current X11 problem: no video overlay

I killed X11 from the console bit by bit, which is perhaps a bad idea -- and ever since I've had problems. The video overlay problem is consistent for steen and root and kde and icewm.

So that's my best guess -- some of these files got corrupted when I killed X in that messy manner. It's less likely it's the nVidia driver, since I've already installed it and it appears from the log file to run great. It's bad of course that there are no error messages -- no realization that something is profoundly awry.

However, when I came to work it all disappeared on its own; the system is working fine. Does it now demand having a second monitor? I'll boot with a single one.

This got me the problem back again, and I discovered nVidia provides XV in two ways -- through the NV17 Video Overlay and the NV05 Video Blitter. The blitter works, the overlay doesn't -- specifically, it doesn't since I set up twinview, even when the x-configuration file no longer mentions twinview.

just reinstall xfree86-common xserver-common xserver-xfree86 xutils xterm xbase-clients
just reinstall xlibmesa3 xlibmesa3-gl xlibmesa3-glu

This made no difference.

There is a collective psychosis in America that is called "the American dream". Of course dreams are unreal, but in this case the dream has become sacred. So you need a clear understanding of the sacred, so that it can be coherently contrasted with a psychosis.

nVidia has two XVideo drivers, the NV17 Video Overlay and the NV05 Video Blitter (type xvinfo under X11 on Sigillo for details). After installing TwinView, which relies on the Blitter driver, the Video Overlay driver ceased to work. That means that when I run Sigillo without an external attached monitor, I no longer have XVideo.

The weird thing is that there are no error messages -- the system doesn't realize that something has gone wrong.

Try startx -- -verbose 5 -logverbose 5

To the nVidia board (user and pw moksha):

Overlay and blitter

I've been running the 1.0-4191 driver on a Debian sid laptop for a few weeks with excellent results, on the 2.4.20 kernel and XFree86 4.2.1.1.

I would run with just the built-in monitor or with an external one dynamically detected, in clone mode, without defining anything in XF86Config-4 other than a modeline for each of the two monitors.

Then I discovered TwinView and set up spanning mode, which is also working great (though I have a minor question, see below).

Then an odd thing happened: I lost Xvideo in single mode. That is, I can still play and edit movies with xv when I'm using two monitors, but it fails when I'm just using the laptop built-in screen.

The failure doesn't appear in the /var/log/XFree86 logs and there are no error messages. I just don't have xv. There's a black screen that reveals a blue background when moved in the place where the video footage should be. x11 still works.

When I run xvinfo with an external monitor attached, whether in the default clone mode or in twinview, I get this:

X-Video Extension version 2.2
screen #0
Adaptor #0: "NV05 Video Blitter"
number of ports: 32
port base: 103
operations supported: PutImage

- and so on, all nice and tidy, and everything is working -- xine will tell me I'm using the Blitter.

Then I power down the laptop, unplug the external monitor, and restart. I use an XF86Config-4 file that used to give me great XV in single-view as well as clone mode. When I run xvinfo I get this:

X-Video Extension version 2.2
screen #0
Adaptor #0: "NV17 Video Overlay"
number of ports: 1
port base: 103
operations supported: PutImage

and then further down:

Adaptor #1: "NV05 Video Blitter"
number of ports: 32
port base: 104
operations supported: PutImage

-- looks good, but NV17 Video Overlay is not in fact working, and NV05 Video Blitter is not being accessed.

Is this a known bug, and is there a workaround? I've reinstalled XFree86 and the driver itself to no effect.

This is a vpr matrix 200a5 with a GeForce4 420 Go M32 chipset and ALi Corporation M1671 Super P4 Northbridge [AGP4X,PCI and SDR/DDR]. In the XFree86 log I get

AGP 4X successfully initialized
Using the NVIDIA 2D acceleration architecture

When I run glxinfo, I get "direct rendering: Yes."

Now bear in mind that the weird thing is that I'm running x-windows with exactly the same configuration file and driver as before, but the Video Overlay no longer works. Could this be a hardware problem?

Here are my questions:

1. How can I get Video Overlay / xv to work again?
2. How can I submit bug reports to nVidia?

Finally, I have a question about twinview. I have the external monitor located above my laptop screen. If I say "Above", the main part of the window with all the icons ends up in the external monitor. If I say "Below", the icons stay below, but the external monitor is mapped below the laptop. If I say "LeftOf", the screens look right, but the external monitor is mapped to the right of the laptop. How can I map the external monitor above the laptop, but keep the icons on the laptop screen?

Appreciate your help with this.

Cheers,
...

After spending days troubleshooting this, I discovered that the problem went away if I deleted the .xmms configuration file. At some point I must have set a value that triggered this failure. Lesson: it's very hard to track the relevant variable, so be careful before you make claims. This likely had nothing to do with TwinView -- although it's still a nVidia driver bug. The way it works is this: you change a setting in .xine which destroys xv; xv is then destroyed for all programs and users until you reboot.

I figured this out by using the spare partition to install a different version of Linux that I could mess around with freely.

Two monitors

It turns out that adding this line to /etc/X11/XF86Config-4 makes it work great for both the onboard display and the external display:

ModeLine "1024x768" 60 1024 1072 1168 1376 768 769 772 808 +hsync +vsync

The effect is interesting: the external display has a real resolution of 1024x768, but a virtual size of 1280x854. This means that the onboard display is full size, and the external display spills over the screen. That effect is actually fine -- and I don't get my desktop messed up. It actually looks like you get the full refresh rate on the onboard monitor -- 85MHz -- at the same time as you get 60MHz on the external monitor. So this shows that the nVidia is indeed capable of driving two monitors at two different resolutions and sizes at the same time!

Double wow: it turns out that adding this line solves the problem with the display on exiting X-windows -- which has annoyed me from the beginning!! Basically, when X exits, the terminal mode doesn't get a correct definition. It spills over the screen, trying to effect a 1280 height, but apparently not fully succeeding, and in the process messing up the fonts. When I now exit from X, I see it switching to a new mode -- namely the 1024x768 -- which is what I need in terminal mode, or console mode, or the terminal console. I hadn't noticed that this happens when I exit the .class configuration, though it likely did. Anyway, now it's doing a beautiful job and I have a perfect console.

Initial installation

Initially I just went with a smaller screen definition, as the X configuration utility didn't provide the option of a 1280x854 I needed. Later, I sorted this out as follows.

The nVidia driver was initially a big disappointment -- it would only give me 800x600, and for some reason fonts looked terrible in Opera.

The size of the monitor is the same as the Titanium G4. I booted to XP and saw the refresh rate was 60Hz -- it turned out I didn't need to know. At http://www.geocrawler.com I found an example of a TiBook configuration and copied these parts over to /etc/X11/XF86Config-4, modifying only the device name and the Identifier as "Default Screen":

Section "Monitor"
Identifier "LCD"
Option "DPMS"
HorizSync 40 - 100
VertRefresh 40 - 120

Mode "1280x854"
DotClock 79.816
HTimings 1280 1296 1408 1536
VTimings 854 855 858 866
Flags "-HSync" "-VSync"
EndMode
EndSection

Section "Screen"
Identifier "Default Screen"
Device "nVidia Corporation NV17 [GeForce4 420 Go 32M]"
Monitor "LCD"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1280x854"
EndSubSection
EndSection

I rebooted -- and it worked! I must admit I was pretty amazed -- essentially, the Mac screen is identical.

The graphics card is nVidia GeForce 420 Go. Note that the XF86 driver gives you GLX [not] and XVideo -- there is no neeed to install the binary nVidia driver -- in fact, I tested it and it wouldn't do better than 800x600. The default is crisp and fast.


 

 

top