mtrr: no more MTRRs available

Bug #23806 reported by Nick Harvey
4
Affects Status Importance Assigned to Milestone
linux-restricted-modules-2.6.15 (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

While attempting to get the fglrx dri working on my system, I found this in
Xorg.0.log:

(EE) fglrx(0): [agp] unable to acquire AGP, error "xf86_ENOSPC"
(EE) fglrx(0): cannot init AGP
(II) fglrx(0): [drm] removed 1 reserved context for kernel
(II) fglrx(0): [drm] unmapping 8192 bytes of SAREA 0xf8e02000 at 0xb7b70000
(WW) fglrx(0): ***********************************************
(WW) fglrx(0): * DRI initialization failed! *
(WW) fglrx(0): * (maybe driver kernel module missing or bad) *
(WW) fglrx(0): * 2D acceleraton available (MMIO) *
(WW) fglrx(0): * no 3D acceleration available *
(WW) fglrx(0): ********************************************* *

Checked my kern.log and found this:

Oct 12 10:28:09 localhost kernel: [4294788.066000] [fglrx] Maximum main memory
to use for locked dma buffers: 929 MBytes.
Oct 12 10:28:09 localhost kernel: [4294788.066000] ACPI: PCI Interrupt Link
[LNKE] enabled at IRQ 11
Oct 12 10:28:09 localhost kernel: [4294788.066000] ACPI: PCI Interrupt
0000:01:00.0[A] -> Link [LNKE] -> GSI 11 (level, low) -> IRQ 11
Oct 12 10:28:09 localhost kernel: [4294788.066000] [fglrx] module loaded - fglrx
8.16.20 [Aug 16 2005] on minor 0
Oct 12 10:28:09 localhost kernel: [4294788.076000] [fglrx] Kernel AGP support
doesn't provide agplock functionality.
Oct 12 10:28:09 localhost kernel: [4294788.076000] [fglrx] AGP detected,
AgpState = 0x1f00421b (hardware caps of chipset)
Oct 12 10:28:09 localhost kernel: [4294788.076000] mtrr: no more MTRRs available
Oct 12 10:28:09 localhost kernel: [4294788.076000] [fglrx:firegl_unlock] *ERROR*
Process 7304 using kernel context 0

My system has a radeon 9700 mobile graphics card, and amd64 cpu. This happens
whether I use the 386, 686, or k7 kernel. I'm running the current Breezy
preview, with xorg-driver-fglrx 8.16.20 from the repositories.

Revision history for this message
Nick Harvey (nmhdh8) wrote :

Here is the output from "cat /proc/mtrr", in case it is helpful:

reg00: base=0x00000000 ( 0MB), size= 16MB: write-back, count=1
reg01: base=0x01000000 ( 16MB), size= 16MB: write-back, count=1
reg02: base=0x02000000 ( 32MB), size= 32MB: write-back, count=1
reg03: base=0x04000000 ( 64MB), size= 64MB: write-back, count=1
reg04: base=0x08000000 ( 128MB), size= 128MB: write-back, count=1
reg05: base=0x10000000 ( 256MB), size= 256MB: write-back, count=1
reg06: base=0x20000000 ( 512MB), size= 512MB: write-back, count=1

Revision history for this message
Flabdablet (flabdablet) wrote :

(In reply to comment #1)
> Here is the output from "cat /proc/mtrr", in case it is helpful:
>
> reg00: base=0x00000000 ( 0MB), size= 16MB: write-back, count=1
> reg01: base=0x01000000 ( 16MB), size= 16MB: write-back, count=1
> reg02: base=0x02000000 ( 32MB), size= 32MB: write-back, count=1
> reg03: base=0x04000000 ( 64MB), size= 64MB: write-back, count=1
> reg04: base=0x08000000 ( 128MB), size= 128MB: write-back, count=1
> reg05: base=0x10000000 ( 256MB), size= 256MB: write-back, count=1
> reg06: base=0x20000000 ( 512MB), size= 512MB: write-back, count=1

Nick, it looks to me like you could combine all these entries into a single one
that has the same effect, thus freeing up enough mtrr's for the fglrx driver to
be able to allocate two more of its own (there are only eight, and your present
setup is using seven of them). Try this:

sudo su -
echo "disable=0" >| /proc/mtrr #At some point during this part,
echo "disable=1" >| /proc/mtrr #your system will become as slow
echo "disable=2" >| /proc/mtrr #as a drunken snail - that's OK.
echo "disable=3" >| /proc/mtrr
echo "disable=4" >| /proc/mtrr #No, really, I mean SLOW - so
echo "disable=5" >| /proc/mtrr #slow it might look like it's hung
echo "disable=6" >| /proc/mtrr
echo "base=0 size=0x40000000 type=write-back" >| /proc/mtrr #Should be snappy
again now

Having done that, restart X (ctrl-alt-Backspace).

If the fglrx driver is now working, wrap all those commands up in a boot script:

sudo cat <<eof >/etc/init.d/fix_mtrr
#!/bin/sh
# Combine all main memory mtrr ranges into a single register
echo "disable=0" >| /proc/mtrr
echo "disable=1" >| /proc/mtrr
echo "disable=2" >| /proc/mtrr
echo "disable=3" >| /proc/mtrr
echo "disable=4" >| /proc/mtrr
echo "disable=5" >| /proc/mtrr
echo "disable=6" >| /proc/mtrr
echo "base=0 size=0x40000000 type=write-back" >| /proc/mtrr
eof
cd /etc/rcS.d
sudo ln -s ../init.d/fix_mtrr S03fix_mtrr

See also bug 24640.

I'd love to know where all these bizarro mtrr settings originate from.

Revision history for this message
Nick Harvey (nmhdh8) wrote :

Hey, I kinda forgot about this... Thanks for the suggestion. The problem was
actually resolved when I removed one of my two ram chips, so that's the setup
I've got right now. I'm planning on doing a clean install sometime in the next
couple weeks though, so I'll give this a try then, to see if I can use both
chips again.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.