# AGP fails to initialize and MTRR is having kittens [solved]

## davidmanning

This is a new installation I've been trying to get working for the last two weeks. If anyone can help me resolve this problem I'll seriously consider naming one of my children after you.

The Problem:

As stated AGP fails to initialize and MTRR is giving lots of messages/errors at boot:

Kernel version is 2.6.13-r3 from gentoo-sources, but I had the same problem with 2.6.12.

The follow occurs when vesafb-tng starts (I believe):

```

Linux agpgart interface v0.101 (c) Dave Jones

agpgart: Detected an Intel 865 Chipset.

agpgart: AGP aperture is 64M @ 0xf8000000

[drm] Initialized drm 1.0.0 20040925

vesafb: NVIDIA Corporation, NV34 Board - p162-1n , Chip Rev    (OEM: NVIDIA)

vesafb: VBE version: 3.0

vesafb: protected mode interface info at c000:dfe0

vesafb: pmi: set display start = c00ce016, set palette = c00ce080

vesafb: pmi: ports = 3b4 3b5 3ba 3c0 3c1 3c4 3c5 3c6 3c7 3c8 3c9 3cc 3ce 3cf 3d0 3d1 3d2 3d3 3d4 3d5 3da

vesafb: hardware supports DDC2 transfers

vesafb: monitor limits: vf = 160 Hz, hf = 72 kHz, clk = 110 MHz

vesafb: scrolling: ywrap using protected mode interface, yres_virtual=6144

mtrr: type mismatch for e8000000,8000000 old: write-back new: write-combining

mtrr: type mismatch for e8000000,4000000 old: write-back new: write-combining

mtrr: type mismatch for e8000000,2000000 old: write-back new: write-combining

mtrr: type mismatch for e8000000,1000000 old: write-back new: write-combining

mtrr: type mismatch for e8000000,800000 old: write-back new: write-combining

mtrr: type mismatch for e8000000,400000 old: write-back new: write-combining

mtrr: type mismatch for e8000000,200000 old: write-back new: write-combining

mtrr: type mismatch for e8000000,100000 old: write-back new: write-combining

mtrr: type mismatch for e8000000,80000 old: write-back new: write-combining

mtrr: type mismatch for e8000000,40000 old: write-back new: write-combining

mtrr: type mismatch for e8000000,20000 old: write-back new: write-combining

mtrr: type mismatch for e8000000,10000 old: write-back new: write-combining

mtrr: type mismatch for e8000000,8000 old: write-back new: write-combining

mtrr: type mismatch for e8000000,4000 old: write-back new: write-combining

mtrr: type mismatch for e8000000,2000 old: write-back new: write-combining

mtrr: type mismatch for e8000000,1000 old: write-back new: write-combining

mtrr: size and base must be multiples of 4 kiB

mtrr: size: 0x800  base: 0xe8000000

 [<c010df2a>] mtrr_check+0x4a/0x60

 [<c010df70>] mtrr_add+0x30/0x80

 [<c052b348>] vesafb_probe+0x338/0x5f0

 [<c019ecec>] sysfs_make_dirent+0x2c/0xa0

 [<c02d212b>] driver_probe_device+0x3b/0xb0

 [<c02d21a0>] __device_attach+0x0/0x10

 [<c02d1819>] bus_for_each_drv+0x69/0x80

 [<c02d2217>] device_attach+0x67/0x70

 [<c02d21a0>] __device_attach+0x0/0x10

 [<c02d1985>] bus_add_device+0x35/0xc0

 [<c02d569c>] device_pm_add+0x5c/0xa0

 [<c02d0960>] device_add+0xe0/0x160

 [<c02d3a32>] platform_device_register+0xc2/0x170

 [<c052b660>] vesafb_init+0x60/0x74

 [<c0512a3b>] do_initcalls+0x2b/0xc0

 [<c01003a4>] init+0x84/0x1b0

 [<c0100320>] init+0x0/0x1b0

 [<c0101215>] kernel_thread_helper+0x5/0x10

```

The mtrr report occurs about 12 times identically.

Then when X starts up we get:

```

mtrr: type mismatch for f8000000,4000000 old: write-back new: write-combining

NVRM: AGPGART: unable to set MTRR write-combining

NVRM: not using NVAGP, an AGPGART backend is loaded!

mtrr: type mismatch for e8000000,8000000 old: write-back new: write-combining

mtrr: type mismatch for f8000000,4000000 old: write-back new: write-combining

NVRM: AGPGART: unable to set MTRR write-combining

NVRM: not using NVAGP, an AGPGART backend is loaded!

mtrr: type mismatch for e8000000,8000000 old: write-back new: write-combining

mtrr: type mismatch for e8000000,8000000 old: write-back new: write-combining

mtrr: type mismatch for e8000000,8000000 old: write-back new: write-combining

mtrr: type mismatch for e8000000,8000000 old: write-back new: write-combining

```

X starts and everything "works," but cat /proc/driver/nvidia/agp/* shows this:

```

Fast Writes:     Supported

SBA:             Supported

AGP Rates:       8x 4x

Registers:       0x1f000e1b:0x00000000

Host Bridge:     Intel Corporation 82865G/PE/P DRAM Controller/Host-Hub Interface

Fast Writes:     Supported

SBA:             Supported

AGP Rates:       8x 4x

Registers:       0x1f004a1b:0x00000a00

Status:          Disabled

AGP initialization failed, please check the ouput

of the 'dmesg' command and/or your system log file

for additional information on this problem.

```

cat /proc/mtrr shows this:

```

reg00: base=0x00000000 (   0MB), size=984064MB: write-back, count=1

```

Like I said, X "works," but things are slower than they ought to be. I can see windows redrawing and glxgears is giving me 692 FPS. That probably has something to do with AGP being disabled

The Hardware:

My computer is a Pentium 4 Prescott 3 Ghz with an ASUS P4P800-E motherboard and 1 gig of RAM. The video card is an nvidia GeForce FX 5200 w/t 128 megs. Here's the output of lspci:

```

0000:00:00.0 Host bridge: Intel Corporation 82865G/PE/P DRAM Controller/Host-Hub Interface (rev 02)

0000:00:01.0 PCI bridge: Intel Corporation 82865G/PE/P PCI to AGP Controller (rev 02)

0000:00:1d.0 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #1 (rev 02)

0000:00:1d.1 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #2 (rev 02)

0000:00:1d.2 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #3 (rev 02)

0000:00:1d.3 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #4 (rev 02)

0000:00:1d.7 USB Controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB2 EHCI Controller (rev 02)

0000:00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev c2)

0000:00:1f.0 ISA bridge: Intel Corporation 82801EB/ER (ICH5/ICH5R) LPC Interface Bridge (rev 02)

0000:00:1f.1 IDE interface: Intel Corporation 82801EB/ER (ICH5/ICH5R) IDE Controller (rev 02)

0000:00:1f.2 IDE interface: Intel Corporation 82801EB (ICH5) SATA Controller (rev 02)

0000:00:1f.3 SMBus: Intel Corporation 82801EB/ER (ICH5/ICH5R) SMBus Controller (rev 02)

0000:00:1f.5 Multimedia audio controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller (rev 02)

0000:01:00.0 VGA compatible controller: nVidia Corporation NV34 [GeForce FX 5200] (rev a1)

0000:02:03.0 FireWire (IEEE 1394): VIA Technologies, Inc. IEEE 1394 Host Controller (rev 80)

0000:02:04.0 RAID bus controller: Promise Technology, Inc. PDC20378 (FastTrak 378/SATA 378) (rev 02)

0000:02:05.0 Ethernet controller: Marvell Technology Group Ltd. 88E8001 Gigabit Ethernet Controller (rev 13)

0000:02:0a.0 Communication controller: Conexant HSF 56k HSFi Modem (rev 01)

0000:02:0d.0 Network controller: RaLink Ralink RT2500 802.11 Cardbus Reference Card (rev 01)

```

Here's the output of lsmod:

```

Module                  Size  Used by

snd_seq                52240  0

snd_seq_device          7948  1 snd_seq

snd_pcm_oss            49568  0

snd_mixer_oss          18432  2 snd_pcm_oss

sk98lin               175968  0

nvidiafb               52508  0

i2c_algo_bit            9992  1 nvidiafb

i2c_core               18688  2 nvidiafb,i2c_algo_bit

snd_intel8x0           30656  1

snd_ac97_codec         84348  1 snd_intel8x0

snd_pcm                83972  3 snd_pcm_oss,snd_intel8x0,snd_ac97_codec

snd_timer              22660  2 snd_seq,snd_pcm

snd                    47844  8 snd_seq,snd_seq_device,snd_pcm_oss,snd_mixer_oss,snd_intel8x0,snd_ac97_codec,snd_pcm,snd_timer

soundcore               8544  2 snd

snd_page_alloc          9608  2 snd_intel8x0,snd_pcm

ndiswrapper           168340  0

nvidia               3466460  24

```

I'm using nVidia's proprietary drivers version 1.0.6629-r4

The Config files:

Here are what I believe to be the relevant kernel config options:

Processor Type and Feature-->

[*] Symmetric multi-processing support

[*]   SMT (Hyperthreading) scheduler support

[*] MTRR (Memory Type Range Register) support

Device Drivers-->Character Devices-->

<*> /dev/agpgart (AGP Support)

│<*>   Intel 440LX/BX/GX, I8xx and E7x05 chipset support

<*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)

<M>   Intel 830M, 845G, 852GM, 855GM, 865G <- Coldplug didn't load this one anyway but I thought I'd try...

Device Drivers-->Graphics support-->

<*> Support for frame buffer devices 

<*>   VESA VGA graphics support 

            VESA driver type (vesafb-tng)  --->     

    (1024x768-32@85) VESA default mode

    <M> nVidia Framebuffer Support  

    [*]   Enable DDC Support

   [*] Support for the framebuffer splash 

Here's /etc/modules.autoload.d/kernel-2.6 (not very exciting)

```
nvidia

ndiswrapper
```

Here's my xorg.conf file:

```
Section "ServerLayout"

        Identifier     "X.org Configured"

        Screen      0  "Screen0" 0 0

        InputDevice    "Mouse0" "CorePointer"

        InputDevice    "Keyboard0" "CoreKeyboard"

EndSection

Section "Files"

        RgbPath      "/usr/lib/X11/rgb"

        ModulePath   "/usr/lib/modules"

        FontPath     "/usr/share/fonts/misc/"

        FontPath     "/usr/share/fonts/TTF/"

        FontPath     "/usr/share/fonts/Type1/"

        FontPath     "/usr/share/fonts/CID/"

        FontPath     "/usr/share/fonts/75dpi/"

        FontPath     "/usr/share/fonts/100dpi/"

EndSection

Section "Module"

        Load  "glx"

        Load  "record"

        Load  "extmod"

        Load  "dbe"

# Load  "dri"

        Load  "xtrap"

        Load  "freetype"

        Load  "type1"

EndSection

Section "InputDevice"

        Identifier  "Keyboard0"

        Driver      "kbd"

EndSection

Section "InputDevice"

        Identifier  "Mouse0"

        Driver      "mouse"

        Option      "Protocol" "IMPS/2"

        Option      "Device" "/dev/psaux"

        Option      "ZAxisMapping" "4 5"

EndSection

Section "Monitor"

        Identifier   "Monitor0"

        VendorName   "Monitor Vendor"

        ModelName    "Monitor Model"

EndSection

Section "Device"

        Identifier  "Card0"

        Driver      "nvidia"

        VendorName  "nVidia Corporation"

        BoardName   "NV34 [GeForce FX 5200]"

        BusID       "PCI:1:0:0"

EndSection

Section "Screen"

        Identifier "Screen0"

        Device     "Card0"

        Monitor    "Monitor0"

        DefaultDepth 24

        SubSection "Display"

                Viewport   0 0

                Depth     24

        EndSubSection

        SubSection "Display"

                Viewport   0 0

                Depth     16

        EndSubSection

EndSection

```

I'm not sure what other information might be useful, but if you need it let me know. Please help if you can... for the sake of my marriage (been spending a little too much time on the computer for the last couple weeks.)   :Smile:  [/code]

cheersLast edited by davidmanning on Wed Oct 12, 2005 3:45 pm; edited 1 time in total

----------

## davidmanning

little update:

/usr/src/linux/Documentation/fb/vesafb.txt says:

 *Quote:*   

> mtrr:n	setup memory type range registers for the vesafb framebuffer
> 
> 	where n:
> 
> 	      0 - disabled (equivalent to nomtrr)
> ...

 

I changed my grub.conf line to:

        kernel (hd0,0)/bzImage root=/dev/hda3 video=vesafb:ywrap,1024x768-32@85,mtrr:2 splash=silent,fadein,theme:livecd-2005.1 quiet CONSOLE=/dev/tty1

but I only get this from dmesg as vesafb starts:

vesafb: unrecognized option mtrr:2

Does anyone know how to correctly pass this setting to mtrr?

Setting nomtrr stops the error messages as vesafb starts, but I still get a message from NVIDIA about an mtrr type mismatch when X starts.

*sigh*

----------

## davidmanning

Another little addendum:

The same errors occur when I boot straight from the universal install disk (2005.1)

Oddly enough mtrr seems to work perfectly when I boot from a KNOPPIX live-cd (kernel 2.6.11)

----------

## davidmanning

Seems this was a bug in linux kernels >2.6.12. The bug causes MTRR's not to be set correctly on certain steppings of Intel Pentium 4's and Xeon's. Found a patch on the kernel mailing list. Here's a link in case anyone else has this problem.

http://lkml.org/lkml/diff/2005/9/28/323/1

or do a search for something like:

 [PATCH]CPUID workaround for intel CPU - Re: [PROBLEM] mtrr's not set, 2.6.13

cheers

----------

## tarpman

Don't know if it'll have any effect or not, but since you're using the proprietary driver, remove DRM support, and compile AGPGART as a module (load it on boot in modules.autoload.d).

----------

