# 3D acceleration not working correctly under FreeBSD-CURRENT [nVidia 6800GT PCI-E]



## Zephyrus (Jun 3, 2009)

Hi,
first of all let me apologize for this being a repost from the nvnews.net forums. I posted there because that seemed to me the most logical place where I could find some help, since some nVidia employers dwell there and this seems to be an nvidia specific issue. However I couldn't get any input (see http://www.nvnews.net/vbulletin/showthread.php?t=133797). Therefore now I'm here a bit more desperate ;-).

I've recently moved from FreeBSD-STABLE to -CURRENT due to some issues with the old USB stack and an HP multifunction printer.
After the upgrade I noticed (well, this is not exactly true, in fact I'm pretty sure that I had the same issue with -STABLE but clearly I can't prove it anymore) that, while the nvidia driver seems to load correctly (at least this is what I deduced from Xorg.0.log and from the output of glxinfo), every 3D application simply doesn't work as expected: performance is astonishingly low and CPU usage top to 100% in about one second from the start up of the program. Even the simple demo glxgears has this same behavior, with a reported FPS of 

```
glxgears                                                                                                                                                                                                                                                        
Running synchronized to the vertical refresh.  The framerate should be
approximately 1/39486 the monitor refresh rate.
6 frames in 5.7 seconds =  1.052 FPS
```
I know that by the default FreeBSD-CURRENT has some debug options turned on but I'm pretty sure that I've already disabled them (at least with the kernel I'm using for these tests and malloc.conf is already set to 'aj'). 
To provide more information I attached the 'nvidia-bug-report.log' to the post.

Thanks in advance.
Best regards.


----------



## ale (Jun 3, 2009)

glxgears isn't a benchmark.

From what I can see from your log, _dri_ is getting loaded even if it seems commented in your xorg.conf, while according to nvidia docs it shouldn't . It seems that, I can remember with which version, some modules get loaded by default even if they are not specified.

Try disabling it explicitly adding _Disable "dri"_.
I would also try the same with dri2.

Let me know if this helps, in the meanwhile I'll try looking for something else.


----------



## Zephyrus (Jun 3, 2009)

Hi,
I've added the Disable directive as you suggested. Even though the messages in Xorg.0.log are a bit confusing it seems that in fact these two modules are not loaded anymore. However the problem is still present.


```
(WW) "dri" will not be loaded unless you've specified it to be loaded elsewhere.
(WW) "dri2" will not be loaded unless you've specified it to be loaded elsewhere.
(II) "extmod" will be loaded by default.
(II) "dbe" will be loaded. This was enabled by default and also specified in the config file.
(II) "glx" will be loaded. This was enabled by default and also specified in the config file.
(II) "record" will be loaded by default.
(II) "dri" will be loaded even though the default is to disable it.
(II) "dri2" will be loaded even though the default is to disable it.
```

Thanks.
Best regards.


----------



## ale (Jun 3, 2009)

Yes, but the line #215 in previous log:
_Loading /usr/local/lib/xorg/modules/extensions//libdri.so_
should be missing now.
Did you noticed any improvement?


----------



## Zephyrus (Jun 3, 2009)

Yes, those lines are missing but I can't see any improvement.


----------



## ale (Jun 3, 2009)

Can you attach your new xorg.conf?


----------



## Zephyrus (Jun 3, 2009)

Here it is.


----------



## ale (Jun 3, 2009)

I've tried merging your devices into my xorg.conf, I hope I've done it correctly. This may not be the best, but I don't have any problems and I get quite high fps on various games and also use compiz if I'd want.
Would you like to test it?

You may need to add some fonts again from you xorg.conf, anyway look in the log for errors.

Sorry but I'm lacking other ideas at the moment as I'm falling asleep.


----------



## Zephyrus (Jun 4, 2009)

Apart from a small typo your xorg.conf is loaded without a glitch but my problem still persists.
I'm going to test compiz (or any software you suggest) as soon as I can.


----------



## DrJ (Jun 4, 2009)

Did you update xorg after you installed the nVidia driver?  If so, reinstall nVidia.  xorg overwrites some libraries that nVidia installs, which can lead to pretty dreadful performance.


----------



## ale (Jun 5, 2009)

@DrJ
maybe you are right, but I don't think that's the cause, because Xorg.0.log shows that the glx module being loaded is the nvidia one

Zephyrus, can you try _glxinfo | grep vendor_ (that should always display ...NVIDIA Corporation) and _glxinfo | grep rendering_?
As suggested by DrJ, can you try reinstalling the driver? BTW are which version are you using and from ports or website?


----------



## Maxamoto (Jun 5, 2009)

*For what it's worth...*

I have an Nvidia 8600M GT, and had this exact same issue when installing the Nvidia drivers from http://www.nvidia.com over the Nvidia driver in ports. Not saying this happened, but from my experience the ports driver has never really worked that great for me, and I've always had consistent performance with the current driver from their website. Anyway, here is my xorg.conf, if it helps:


```
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 1.0  (buildmeister@builder65)  Thu Apr 16 19:28:41 PDT 2009


Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
    FontPath        "/usr/local/lib/X11/fonts/misc/:unscaled"
    FontPath        "/usr/local/lib/X11/fonts/100dpi/:unscaled"
    FontPath        "/usr/local/lib/X11/fonts/75dpi/:unscaled"
    FontPath        "/usr/local/lib/X11/fonts/misc/"
    FontPath        "/usr/local/lib/X11/fonts/Type1/"
    FontPath        "/usr/local/lib/X11/fonts/100dpi/"
    FontPath        "/usr/local/lib/X11/fonts/75dpi/"
    FontPath        "/usr/local/lib/X11/fonts/cyrillic/"
    FontPath        "/usr/local/lib/X11/fonts/TTF/"
EndSection

Section "Module"
    Load           "dbe"
    Load           "extmod"
    Load           "type1"
    Load           "freetype"
    Load           "glx"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/sysmouse"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "keyboard"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    VideoRam	   256000
    Option         "RenderAccel"           "True"
    Option         "UseFBDev"              "True"
    Option         "AllowGLXWithComposite" "True"
    Option         "AddARGBGLXVisuals"     "True"
# I added these
    Option 	   "AccelMethod" 	   "EXA"
    Option         "MigrationHeuristic"    "greedy"

    Option "NoRenderExtension"             "False"
    Option "NoFlip"                        "False"
    Option "UseEdid"                       "True"
    Option "NvAGP"                         "1"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "AddARGBGLXVisuals"     "True" # Added
    SubSection     "Display"
    Depth       24
    EndSubSection
EndSection


# I added this
Section "Extensions"
    Option         "Composite" "Enable"
EndSection
```

Like some of the others here, I can run compiz if I want (heh... it's actually faster than on Ubuntu), and really don't have any complaints that a renice can't fix. Hope this helps...


----------



## tangram (Jun 5, 2009)

Stick to the port if you want to install NVIDIA's binary drivers. 

HOWTO: Install and configure NVIDIA drivers


----------



## Zephyrus (Jun 5, 2009)

@Ale,DrJ,tangram
Just to be sure I reinstalled the driver, which I'd like to stress _is_ the one from ports tree, but the problem still persists.

@Ale
You will find the glxinfo output attached. 

Just a side note: I'm unable to completely compile the mesa-demos port due to compilation error but, according to some posts I read on this same forum, it seems a common issue when the nvidia drivers are installed. Is this correct or there's something wrong with my OpenGL subsystem?

@Maxamoto
I've tried by adding your options to my xorg.conf but, again, no sign of improvement.

Thanks to all for the support.
Best regards.


----------



## tangram (Jun 5, 2009)

In you Xorg.0.log there are some warnings on a few modules such as type1 and freetype.

In my xorg.conf Modules section I only have extmod, record, dbe, glx and dri.

I was puzzled by the Disable "dri" and "dri2" in you xorg.conf. Try to remove them.

Also if you want to benchmark better install a FPS like Quake 3, Enemy Territory, RTCW, etc. All these are very easy to benchmark with a demo. Quake 3 and RTCW have in-built demos and for ET I can give you demo that I use for myself benchmark needs.


----------



## Zephyrus (Jun 5, 2009)

tangram,
I've tried by adding the record module which seems it was the only one missing from my configuration and I've also tried with dri/dri2 both enabled or disabled (see my previous discussion with ale) but the situation is the same.

With regard to the demos, at the moment I don't own any of those games. However I tried starting warsow and it has the same behavior of all 3D applications: it just locks the X server and the CPU usage skyrockets to 100% until I kill it.


----------



## tangram (Jun 5, 2009)

Can you start warsow from the command line and collect the messages?


----------



## Zephyrus (Jun 5, 2009)

Here they are.


----------



## tangram (Jun 5, 2009)

No clue on the log. I was hoping that a GL error would appear.


----------



## DrJ (Jun 5, 2009)

What version of the nVidia driver are you using?  Your card is old enough that you may need the legacy driver (173.14.18).  I need that one for my FX5xxx card.


----------



## Zephyrus (Jun 5, 2009)

Actually, according to the nVidia documentation, it seems that my card (a GeForce6) is supported trough the standard driver. 
However, just to leave nothing unattempted, I'm going to try the legacy drivers. I'll let you know as soon as possible.


----------



## Zephyrus (Jun 5, 2009)

Incredible! The old 173-xx driver works like a charm!
I'd like to stress again that according to the nVidia documentation I could/should use the most recent driver, that is the 180-xx one.  
This is the relevant excerpt from the README:

```
For the most complete and accurate listing of supported GPUs, please see the
Supported Products List, available from the NVIDIA FreeBSD x86 Graphics Driver
download page. Please go to http://www.nvidia.com/object/unix.html, follow the
Archive link under the FreeBSD x86 heading, follow the link for the 180.44
driver, and then go to the Supported Products List.


E1. NVIDIA GEFORCE GPUS


    NVIDIA GPU product                                        Device PCI ID
    ------------------------------------------------------    ---------------
    GeForce 6800 Ultra                                        0x0040
    GeForce 6800                                              0x0041
    GeForce 6800 LE                                           0x0042
    GeForce 6800 XE                                           0x0043
    GeForce 6800 XT                                           0x0044
    GeForce 6800 GT                                           0x0045
    GeForce 6800 GT                                           0x0046
    GeForce 6800 GS                                           0x0047
    GeForce 6800 XT                                           0x0048
```

The only thing I could deduce is that somewhere between these two versions a bug/regression was introduced.


----------



## adamk (Jun 5, 2009)

You should update your post on the nvnews forum to let folks there know that the older drivers work fine.


----------



## DrJ (Jun 5, 2009)

Zephyrus said:
			
		

> Incredible! The old 173-xx driver works like a charm!
> I'd like to stress again that according to the nVidia documentation I could/should use the most recent driver, that is the 180-xx one.



That happened to me when my FX2000 (like an FX5700) was getting old (it still is old).  It was listed as being OK with the mainstream driver, but I had all sorts of issues until I went with the legacy one.

Congrats!


----------



## Zephyrus (Jun 5, 2009)

@adamk,DrJ
I'm certainly going to update my post on nvnews.

Another note: I'm wondering that this seems to be nVidia/FreeBSD related issue since the 180-xx actually works on Linux.

In the end I'd like to thank for their support all those who have posted in this thread.
Best regards.


----------

