# /proc/mtrr says uncachable; no bios setting available

## eruvaer_ohta

Hi,

I'm running a 32-bit Gentoo on a Dell XPS 1530 laptop with 4gb ram. My kernel is configured with 64-bit memory support, and "free -m" shows the full 4gb ram, so it seems that the system can use them.

But after reading this one

 *Quote:*   

> Getting 2D to work on machines with 4Gb or more memory 
> 
> If you are having troubles with the nVidia 2D acceleration it is likely that you are unable to set up a write-combining range with MTRR. To verify, check the contents of /proc/mtrr: 
> 
> Code Listing 4.1: Checking if you have write-combining enabled 
> ...

 

I check the output of /proc/mtrr and it looks like this:

```
cat /proc/mtrr 

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

reg01: base=0x80000000 (2048MB), size=1024MB: write-back, count=1

reg02: base=0xc0000000 (3072MB), size= 512MB: write-back, count=1

reg03: base=0x100000000 (4096MB), size=4096MB: write-back, count=1

reg04: base=0xdff00000 (3583MB), size=   1MB: uncachable, count=1

```

The problem is that my bios has no option to control anything related to memory or ram. And since I do experience slow behaviour of compiz concerning 2D acceleration, but 3D works without probs, I think that the output is no false alert.

My question is: Can I change the mtrr setting on the software side, e.g. with an script on bootup or as kernel option? Dell has a bios update available, but that should be the last option.

----------

## BradN

Hmm, the only uncacheable region is 1MB in size, which, unless you're on a 10 year old machine, is unlikely to be the video RAM.

I think the video memory actually isn't being shown at all in the list, because if it were, it should show up as write-combining.

For example, my output:

brad@p100 ~ $ cat /proc/mtrr

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

reg01: base=0xe0000000 (3584MB), size= 256MB: write-combining, count=1

the first range is the system RAM, the 2nd is the video memory.

You might consider trying 64 bit gentoo - maybe this would help it work better with 4GB of RAM.  Otherwise, try using mem=3G as a kernel boot parameter and see if an mtrr for the video RAM shows up then.

----------

## eruvaer_ohta

Okay, thanks BradN, I will give it a try.

By the way, my graphic card is a nvidia 8600m gt with 512mb video ram.

----------

## eruvaer_ohta

Just tried it with kernel option mem=3G, but it didn't help. 'free -m' shows only 3G ram as expected, but the output of /proc/mtrr didn't change.

Here is the relevant output of lspci -v:

```
01:00.0 VGA compatible controller: nVidia Corporation Unknown device 0407 (rev a1) (prog-if 00 [VGA controller])

   Subsystem: Dell Unknown device 022e

   Flags: bus master, fast devsel, latency 0, IRQ 16

   Memory at fd000000 (32-bit, non-prefetchable) [size=16M]

   Memory at e0000000 (64-bit, prefetchable) [size=256M]

   Memory at fa000000 (64-bit, non-prefetchable) [size=32M]

   I/O ports at df00 [size=128]

   Capabilities: [60] Power Management version 2

   Capabilities: [68] Message Signalled Interrupts: Mask- 64bit+ Queue=0/0 Enable-

   Capabilities: [78] Express Endpoint, MSI 00

   Capabilities: [100] Virtual Channel <?>

   Capabilities: [128] Power Budgeting <?>

   Capabilities: [600] Vendor Specific Information <?>

   Kernel driver in use: nvidia

   Kernel modules: nvidia
```

Is it possible to configure the /proc/mtrr by hand (use of echo ... > /proc/mtrr) according to this output or can it only be set through the BIOS?

Thanks for your help.

PS: Although the NVIDIA X Server Settings tell me I have 512mb ram, I re-checked it and found out that I only have 256mb video ram.

----------

## energyman76b

Hi,

don't touch the mtrr. There is nothing to worry about. You have a wb mtrr that is big enough to cover your video ram size, so you don't need to worry.

The stuff in the uc area is most likely bios&pci&related stuff. So just don't touch it.

----------

## eruvaer_ohta

Hmm, the bios update didn't help anyway, no new option concerning mtrr. Seems like I have to stick to this.

If the wb mtrr is really big enough, that's good, but shouldn't I have a write-combining area for the video ram?

Thx, Eruvaer

----------

## energyman76b

AFAIK wb or wc does not matter (much).

----------

## eruvaer_ohta

Okay, then I'll leave it to this. Thanks for your advise   :Smile: 

----------

## BradN

The reason write combining is liked more than write-back or write-through is because the video memory is hardly ever read back from the video card, so you don't want writes to the video memory evicting other things from your cache.  

But, you do want, say if the video driver writes to two 16 bit chunks in the same 32 bit word, those should be combined into a single 32 bit write, etc...  This probably applies to 16 bit video modes more than anything, since higher modes should have a single pixel filling a 32 bit word anyway (at least it seems to me...).

----------

