![由于错误的 mtrr 设置导致图形性能不佳](https://linux22.com/image/957957/%E7%94%B1%E4%BA%8E%E9%94%99%E8%AF%AF%E7%9A%84%20mtrr%20%E8%AE%BE%E7%BD%AE%E5%AF%BC%E8%87%B4%E5%9B%BE%E5%BD%A2%E6%80%A7%E8%83%BD%E4%B8%8D%E4%BD%B3.png)
我在配备 8GB RAM 的 Dell LAtitude E4310 上使用最新内核
2.6.38-10-generic #44-Ubuntu SMP Thu Jun 2 21:32:22 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
在启动时我收到以下消息
[drm] MTRR allocation failed. Graphics performance may suffer.
/proc/mtrr
我的长相确实很奇怪
reg00: base=0x000000000 ( 0MB), size= 8192MB, count=1: write-back
reg01: base=0x200000000 ( 8192MB), size= 512MB, count=1: write-back
reg02: base=0x0e0000000 ( 3584MB), size= 512MB, count=1: uncachable
reg03: base=0x0dc000000 ( 3520MB), size= 64MB, count=1: uncachable
reg04: base=0x0db400000 ( 3508MB), size= 4MB, count=1: uncachable
reg05: base=0x21c000000 ( 8640MB), size= 64MB, count=1: uncachable
我试过了mtrr-uncover
,但是没有用:
./mtrr-uncover
Initial MTRR configuration:
0 0x000000000-0x1ffffffff write-back
4 0x0db400000-0x0db7fffff uncachable
3 0x0dc000000-0x0dfffffff uncachable
2 0x0e0000000-0x0ffffffff uncachable
1 0x200000000-0x21fffffff write-back
5 0x21c000000-0x21fffffff uncachable
./mtrr-uncover: 9 MTRRs needed but only 8 in architecture.
有人知道如何在我的架构中正确设置 mtrr 吗?
这里的相关输出lspci -v
00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 02) (prog-if 00 [VGA controller])
Subsystem: Dell Device 0410
Flags: bus master, fast devsel, latency 0, IRQ 42
Memory at f0000000 (64-bit, non-prefetchable) [size=4M]
Memory at e0000000 (64-bit, prefetchable) [size=256M]
I/O ports at 60b0 [size=8]
Expansion ROM at <unassigned> [disabled]
Capabilities: <access denied>
Kernel driver in use: i915
Kernel modules: i915
答案1
有一个简单的解决方案。只需使用内核启动参数enable_mtrr_cleanup
。
编辑/etc/default/grub
配置文件:
$ sudo nano /etc/default/grub
找到包含以下内容的行GRUB_CMDLINE_LINUX_DEFAULT
,您可能会看到以下默认参数:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
因此要使用enable_mtrr_cleanup
你可以像这样添加它:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash enable_mtrr_cleanup"
然后您必须使用此命令更新您的 grub 配置:
$ sudo update-grub2
然后重启:
$ sudo reboot
然后消息就会消失,你会看到系统已经找到了 MTRR 的正确值。