# Need help with MTRR

## yak4771

I installed Gentoo on my Dell Vostro 1510 laptop, cat /proc/mtrr shows this:

reg00: base=0x000000000 (    0MB), size= 2048MB, count=1: write-back

reg01: base=0x07ff00000 ( 2047MB), size=    1MB, count=1: uncachable

According to Gentoo nvidia guide, "Every line should contain "write-back" or "write-combining". If you see a line with "uncachable" in it you will need to change a BIOS setting to fix this.".  So I guess the mtrr stuff has some problem, and I kind of feel that the performance of the graphic card is sluggish.

Here is all the information:

I cannot find any mtrr settings in bios.

CPU is Intel(R) Core(TM)2 Duo CPU T8100 @ 2.10GHz

GPU is nVidia Corporation G86 [GeForce 8400M GS] (rev a1)

MemTotal:        2059796 kB

MTRR related stuff I enabled in kernel config:

[*] MTRR (Memory Type Range Register) support

  [*]   MTRR cleanup support 

  (1)   MTRR cleanup enable value (0-1)

  (1)   MTRR cleanup spare reg num (0-7)

X86_PAT is also enabled, I have confirmed in .config.

So is there any problem with the mtrr?  If so, how to fix it?

And how to test my GPU performance to find out if mtrr is working fine or not?

Thanks in advance.

Yak

----------

## PaulBredbury

You want NVreg_UsePageAttributeTable=1

E.g. in my /etc/modprobe.d/personal.conf

```
options nvidia NVreg_DeviceFileMode=0660 NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=25 NVreg_ModifyDeviceFiles=1 NVreg_EnableMSI=1 NVreg_UsePageAttributeTable=1 NVreg_UseVBios=1 NVreg_RMEdgeIntrCheck=1
```

So nvidia uses PAT instead of MTRR. It should be doing this automatically anyway, these days.

Edit: Added Nvidia URL.Last edited by PaulBredbury on Tue Dec 21, 2010 5:51 am; edited 1 time in total

----------

## yak4771

 *PaulBredbury wrote:*   

> You want NVreg_UsePageAttributeTable=1
> 
> E.g. in my /etc/modprobe.d/personal.conf
> 
> ```
> ...

 

Thank you for your reply.

In my /proc/driver/nvidia/registry: UsePageAttributeTable: 4294967295

After adding NVreg_UsePageAttributeTable=1 into /etc/modprobe.d/nvidia.conf, it changed to: UsePageAttributeTable: 1

And my /proc/mtrr is still the same.

Is this right?  Are there any ways I can confirm that the gpu is functioning well?

Now my /etc/modprobe.d/nvidia.conf is this:

options nvidia NVreg_DeviceFileMode=432 NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=27 NVreg_ModifyDeviceFiles=1 NVreg_UsePageAttributeTable=1

The full information is here: http://paste.pocoo.org/show/218745/

Regards,

Yak

----------

## energyman76b

just ignore your mtrr. They are fine. That uncachable mb? Bios stuff. Besides, a complete dmesg is much more usefull.

----------

## yak4771

 *energyman76b wrote:*   

> just ignore your mtrr. They are fine. That uncachable mb? Bios stuff. Besides, a complete dmesg is much more usefull.

 

Thank you for your reply!  Below is mtrr and PAT related information from dmesg, does it mean that my nVidia gpu is fully functional and optimized?

DMI present.

No AGP bridge found

last_pfn = 0x7fed0 max_arch_pfn = 0x400000000

MTRR default type: uncachable

MTRR fixed ranges enabled:

  00000-9FFFF write-back

  A0000-BFFFF uncachable

  C0000-FFFFF write-protect

MTRR variable ranges enabled:

  0 base 000000000 mask F80000000 write-back

  1 base 07FF00000 mask FFFF00000 uncachable

  2 disabled

  3 disabled

  4 disabled

  5 disabled

  6 disabled

  7 disabled

x86 PAT enabled: cpu 0, old 0x7040600070406, new 0x7010600070106

original variable MTRRs

reg 0, base: 0GB, range: 2GB, type WB

reg 1, base: 2047MB, range: 1MB, type UC

total RAM covered: 2047M

Found optimal setting for mtrr clean up

 gran_size: 64K         chunk_size: 2M  num_reg: 2      lose cover RAM: 0G

New variable MTRRs

reg 0, base: 0GB, range: 2GB, type WB

reg 1, base: 2047MB, range: 1MB, type UC

initial memory mapped : 0 - 20000000

init_memory_mapping: 0000000000000000-000000007fed0000

 0000000000 - 007fe00000 page 2M

 007fe00000 - 007fed0000 page 4k

----------

## energyman76b

pat are enabled, pat are used, you can completely ignore the mtrr  :Wink: 

----------

## yak4771

 *energyman76b wrote:*   

> pat are enabled, pat are used, you can completely ignore the mtrr 

 

Thanks!  :Smile: 

----------

## Joseph K.

Hmmm, interesting stuff.  I only just realised that MTRR cleanup was disabled because that enable value defaults to zero.  How is one meant to know what the right value for "spare reg" is?  Someone has attempted to explain it on the Gentoo Wiki, but it is not clear.

energyman76b, could you make that wiki article clearer if you have the time and inclination?  Thanks, cheers.

----------

## fbcyborg

Hi, 

can somebody help me to understand why I have this:

```
Binary: ""
```

----------

