Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Jan 2005 13:31:50 -0500
From:      Louis LeBlanc <FreeBSD@keyslapper.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: AGP not working on nForce3
Message-ID:  <20050109183150.GE20686@keyslapper.org>
In-Reply-To: <41E16DAA.8000807@dd.chalmers.se>
References:  <41E16DAA.8000807@dd.chalmers.se>

next in thread | previous in thread | raw e-mail | index | archive | help
On 01/09/05 06:45 PM, Mats Kristoffersen sat at the `puter and typed:
> I have trouble with AGP using the nVidia drivers from ports.
> 
> I have a MSI K8N neo2 motherboard (nForce3 Ultra), an Athlon64 3000+ CPU 
> and a GeForce FX 5200. I'm running FreeBSD 5.3-STABLE in i386 mode.

Exactly the card I'm using, but I'm not using an Athlon.

> When I load the nvidia drivers, it says:
> 
> agp0: <NVIDIA Generic AGP Controller> mem 0xe8000000-0xefffffff at 
> device 0.0 on pci0
> agp0: Unable to find NVIDIA Memory Controller 1.

That's the kernel agp.  You might want to pull it out of the kernel
and use the Nvidia agp.

> device_attach: agp0 attach returned 19
> nvidia0: <GeForce FX 5200> mem 
> 0xf0000000-0xf3ffffff,0xf4000000-0xf4ffffff irq 16 at device 0.0 on pci1
> nvidia0: [GIANT-LOCKED]

Looks like a 64M card?  Mines 128M, but that shouldn't matter here.

> When I startx, it says
> 
> NVRM: AGP cannot be enabled on this combination of the AMD CPU and OS kernel
> NVRM: kernel upgrade recommended.

You need to pick an AGP driver.  This is done in /etc/X11/xorg.conf
with the NvAGP setting.  I use
        Option "NvAGP" "1" # Use Nvidia agp
Of course, I had to remove the agp device from my kernel.  It may also
be necessary for you to build a custom kernel that makes use of some
Athlon specific features - I'm using a Pentium myself, but there are
plenty of folks on the list that can recommend options and devices to
look at.

> There is no /dev/agp or similar. Having agp enabled or disabled in the 
> kernel or loading agp.ko dynamically makes no difference.

The absence of a /dev/agp is not important.  agp.ko is the FreeBSD agp
driver, you might be better with the nvidia agp.

> Nvidia-related sysctl variables:
> hw.nvidia.agp.card.rates: 8x 4x
> hw.nvidia.agp.card.fw: supported
> hw.nvidia.agp.card.sba: supported
> hw.nvidia.agp.card.registers: 0x1f000e1b:0x00000000
> hw.nvidia.version: NVIDIA FreeBSD x86 NVIDIA Kernel Module  1.0-6113 Mon Aug  2 16:08:32 PDT 2004
> hw.nvidia.registry.EnableVia4x: 0
> hw.nvidia.registry.EnableALiAGP: 0
> hw.nvidia.registry.NvAGP: 3
                      ^
Setting this to 3 tells the driver to try the native AGP first.  I had
trouble with this, and had to compile the agp device out of my kernel
to get it to work right.  Notice below that I set NvAGP to 1.

> hw.nvidia.registry.EnableAGPSBA: 0
> hw.nvidia.registry.EnableAGPFW: 0
> hw.nvidia.registry.SoftEDIDs: 1
> hw.nvidia.registry.Mobile: 4294967295
> hw.nvidia.registry.ResmanDebugLevel: 4294967295
> hw.nvidia.registry.FlatPanelMode: 0
> hw.nvidia.cards.0.model: GeForce FX 5200
> hw.nvidia.cards.0.irq: 16
> hw.nvidia.cards.0.vbios: 04.34.20.56.00
> hw.nvidia.cards.0.type: AGP
> dev.nvidia.0.%desc: GeForce FX 5200
> dev.nvidia.0.%driver: nvidia
> dev.nvidia.0.%location: slot=0 function=0 handle=\_SB_.PCI0.AGPB.VGAG
> dev.nvidia.0.%pnpinfo: vendor=0x10de device=0x0322 subvendor=0x0000 
> subdevice=0x0000 class=0x030000
> dev.nvidia.0.%parent: pci1

I'm not seeing your hw.nvidia.agp.status.rate sysctl there, which
suggests the NVidia AGP isn't being loaded.  It may be having trouble
with the native AGP driver, but the failover isn't working because
there's a conflict - I had the same problem until I removed the native
agp device.

How did you compile the drivers?  My pkgtools.conf uses the following:
       'WITHOUT_LINUX=yes',
       'WITH_ACPI=yes',
This makes upgrades a little smoother.

My kernel config has the agp device removed, so the hw.nvidia sysctls
show the nvidia agp status:
# sysctl hw.nvidia.agp
hw.nvidia.agp.host-bridge.rates: 8x 4x 
hw.nvidia.agp.host-bridge.fw: supported
hw.nvidia.agp.host-bridge.sba: supported
hw.nvidia.agp.host-bridge.registers: 0x1f004a1b:0x00000b02
hw.nvidia.agp.card.rates: 8x 4x 
hw.nvidia.agp.card.fw: supported
hw.nvidia.agp.card.sba: supported
hw.nvidia.agp.card.registers: 0x1f000e1b:0x1f004302
hw.nvidia.agp.status.status: enabled
hw.nvidia.agp.status.driver: nvidia
hw.nvidia.agp.status.rate: 8x
hw.nvidia.agp.status.fw: disabled
hw.nvidia.agp.status.sba: enabled

I don't know the exact nature of the fw (fast writes) sysctl, but it
doesn't seem to be supported in the FX5200.  The key you'll be looking
for is the hw.nvidia.agp.status.status sysctl, and it should say
enabled.  The hw.nvidia.agp.card.rates var should give you the
acceleration rates you are getting.

You might give that a try.  Just comment out the agp in your kernel,
don't delete it yet - just in case the nvidia agp doesn't like the
athlon for some reason.

Also, you'll want to make sure your xorg.conf has a good config.  I'm
using the TwinView feature, so my graphics device section won't
necessarily apply fully.  Just in case it will help, this is what I
use:

Section "Device"
        Identifier "NV AGP TwinView"
        VendorName  "nVidia Corporation"
        Driver "nvidia"
        # update this with the PCI id of your card.  Consult the output
        # of the 'lspci' command. The  BusID is usually optional when
        # only using one graphics card.
        BusID       "PCI:1:0:0"
        BoardName   "NV34 [GeForce FX 5200]"

        # These are extras that may need removal
        Option "NoLogo" "True"
        Option "RenderAccel" "True"
        Option "NvAGP" "1" # Use NVIDIAs agp
        Option "HWCursor" "True"
        # Option "CursorShadow" "True"
        # Option "EnableAGPFW" "1"  # Use Fast Writes

        # twinview setup
        Option "TwinView"
        Option "SecondMonitorHorizSync" "31-80"
        Option "SecondMonitorVertRefresh"       "56-75"
        Option "TwinViewOrientation"    "RightOf"
        Option "MetaModes" "1280x1024,1280x1024; 1024x768,1024x768"
        Option "ConnectedMonitor"       "crt,crt"
EndSection

The last block, the twinview setup won't apply unless you're using two
monitors, and even then it will likely need modification to work with
your monitors.  The rest of it may need tweakig to apply for you as
well.

Also, you should check out the readmes in
/usr/X11R6/share/doc/NVIDIA_GLX-1.0/
They explain the agp issue a little better - particularly
README.Linux.

HTH
Lou
-- 
Louis LeBlanc               FreeBSD@keyslapper.org
Fully Funded Hobbyist, KeySlapper Extrordinaire :)
http://www.keyslapper.org                     ԿԬ

Griffin's Thought:
  When you starve with a tiger, the tiger starves last.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050109183150.GE20686>